/*
 * Last Modified: 2025-10-09 16:45:00 AEST
 * Changes: Added loading spinner styles for delete buttons
 *          Added message close button styles
 *          Added fade-out animation for dismissible messages
 *          Added slide-in animation for messages
 *          Added styles for closed competition badge and message
 */

body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

.search-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

input[type="number"],
input[type="email"] {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.submit-btn {
    background-color: #007cba;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

.submit-btn:hover {
    background-color: #005a87;
}

.error-message,
.success-message {
    padding: 12px 45px 12px 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.error-message.fade-out,
.success-message.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.message-close:hover {
    opacity: 1;
}

.results-header {
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}

.results-header h2 {
    color: #007cba;
    margin: 0;
}

.user-info {
    background: #e7f3ff;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.entries-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.entry-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.entry-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.entry-subject {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.entry-type {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.entry-grade {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
}

.closed-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
}

.closed-message {
    display: inline-block;
    color: #6c757d;
    font-size: 13px;
    font-style: italic;
    margin-top: 10px;
}

.entry-details {
    margin: 15px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-label {
    font-weight: bold;
    color: #555;
}

.detail-value {
    color: #333;
}

.images-list {
    margin: 15px 0;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.images-list h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #555;
}

.image-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-info {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 40px);
}

p#deleteImageInfo{
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.image-filename {
    font-weight: bold;
    font-size: 13px;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

.image-title {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

.image-type-badge {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-right: 5px;
}

.delete-image-btn {
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    background: #dc3545;
    border-radius: 4px;
}

.delete-image-btn:hover {
    opacity: 0.7;
}

.delete-image-btn img {
    width: 24px;
    height: auto;
    display: block;
}

.view-entry-btn {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 10px;
    margin-right: 10px;
}

.view-entry-btn:hover {
    background: #218838;
    text-decoration: none;
    color: white;
}

.delete-entry-btn {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 10px;
    border: none;
    cursor: pointer;
}

.delete-entry-btn:hover {
    background: #c82333;
    text-decoration: none;
    color: white;
}

.results-btn {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 10px;
}

.results-btn:hover {
    background: #005a87;
    text-decoration: none;
    color: white;
}

.no-entries {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 40px 0;
}

.gallery-link-box {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 124, 186, 0.2);
}

.gallery-link-box p {
    margin: 0 0 15px 0;
    font-size: 16px;
}

.gallery-link-btn {
    display: inline-block;
    background: white;
    color: #007cba;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-link-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #005a87;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    background: #dc3545;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    position: relative;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-danger:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading spinner styles */
.btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .entries-grid {
        grid-template-columns: 1fr;
    }
    
    .image-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .delete-image-btn {
        margin-top: 8px;
    }
}
