/* Common Styles for CSA System */
/* This file contains shared styles used across admin, judge, and participant portals */

/* ===== MFA (Multi-Factor Authentication) Styles ===== */
.login-card {
    background: white;
    padding: 28px 24px 20px 24px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.10);
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .login-card {
        padding: 24px 20px 18px 20px;
        margin-bottom: 20px;
    }
}

.login-card h2 {
    color: #1e3a5f;
    font-size: 1.5rem;
    margin-bottom: 16px;
    text-align: center;
}

@media (max-width: 768px) {
    .login-card h2 {
        margin-bottom: 14px;
    }
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 2px;
}

.form-input:focus {
    outline: none;
    border-color: #1e3a5f;
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

.form-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2c3e50 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.form-btn:hover {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    box-shadow: 0 5px 15px rgba(30, 58, 95, 0.3);
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 18px;
    text-align: center;
}

.forgot-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

/* Email display for MFA */
.email-display {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
    color: #495057;
}

/* MFA secondary actions */
.mfa-secondary-actions {
    text-align: center;
    margin-top: 20px;
}

.mfa-secondary-actions a {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 500;
    margin: 0 10px;
}

.mfa-secondary-actions a:hover {
    text-decoration: underline;
}

/* ===== Header Controls and Session Info ===== */
.header-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.session-label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.countdown {
    font-weight: 500;
    color: inherit;
    font-size: 0.9rem;
    min-width: 45px;
    text-align: center;
}

/* ===== Common Button Styles ===== */
.btn-logout, .btn-back, .btn-upload-more, .btn-enter-marks {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-logout:hover, .btn-back:hover, .btn-upload-more:hover, .btn-enter-marks:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== Banner Section Styles ===== */
.banner-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c3e50 100%);
    color: white;
    padding: 5px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    position: relative;
    overflow: visible !important;
    margin-bottom: 30px;
    z-index: 1;
    min-height: auto; /* Allow height to be determined by content */
}

/* Banner Section for Login Pages - Auto-fit to image height */
.banner-section:has(.banner-image) {
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header Controls positioning in banner sections */
.banner-section .header-controls {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    margin-top: 15px !important;
    padding: 0 20px !important;
    position: relative !important;
    z-index: 100 !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.banner-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.banner-section > * {
    position: relative;
    z-index: 2;
}

.banner-image {
    width: 790px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    margin: 0 auto 15px auto;
    background: rgba(255, 255, 255, 0.1);
    max-width: calc(100% - 10px);
    display: block;
}

.default-banner {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 20px;
}

.default-banner i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.default-banner div {
    font-size: 1.2rem;
    font-weight: 600;
}

.award-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.page-header {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
    width: 100%;
    padding: 0 5px;
    position: relative;
}

.page-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex: 1;
}

.page-header-language {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: auto;
}

/* ===== Message Styles ===== */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .banner-section {
        padding: 15px 20px;
        margin-bottom: 20px;
    }
    
    .award-title {
        font-size: 1.5rem;
    }
    
    .page-header {
        font-size: 1.2rem;
    }
    
    .header-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .session-info {
        justify-content: center;
    }
    
    .btn-logout, .btn-back, .btn-upload-more, .btn-enter-marks {
        justify-content: center;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .banner-section {
        padding: 12px 15px;
    }
    
    .award-title {
        font-size: 1.3rem;
    }
    
    .page-header {
        font-size: 1.1rem;
    }
    
    .login-card {
        padding: 20px 15px 15px 15px;
    }
}

/* ===== Additional Common Styles ===== */

/* Common button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c3e50 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Alert styles */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1e3a5f;
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
}

/* Container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Grid utilities */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Card styles */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 25px;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.card-title {
    color: #333;
    font-size: 1.5rem;
    margin: 0;
}

/* Status indicators */
.status-success {
    color: #28a745;
    font-weight: 600;
}

.status-error {
    color: #dc3545;
    font-weight: 600;
}

.status-warning {
    color: #C0C0C0;
    font-weight: 600;
}

.status-info {
    color: #17a2b8;
    font-weight: 600;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e3a5f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Language Switcher Styles ===== */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

.language-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.language-current:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.language-flag {
    font-size: 1rem;
}

.language-name {
    font-weight: 500;
    color: #333;
    font-size: 0.75rem;
}

.language-current i {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.2s ease;
}

/* Removed hover-based dropdown - now using click-based */

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 100000;
    display: none;
    margin-top: 5px;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
}

.language-option.active {
    background: #fff3e0;
    color: #e65100;
    font-weight: 500;
}

.language-option.active:hover {
    background: #ffcc80;
}

.language-option .language-flag {
    font-size: 1rem;
}

.language-option .language-name {
    font-size: 0.8rem;
}

/* Login page language switcher */
.login-language-switcher {
    position: absolute;
    bottom: 15px;
    right: 25px;
    z-index: 10000;
}

.login-language-switcher .language-switcher {
    margin-left: 0;
}

.login-language-switcher .language-current {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-language-switcher .language-dropdown {
    /* Open downwards for better UX */
    position: absolute;
    top: calc(100% + 8px);
    bottom: auto;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-language-switcher .language-dropdown.show {
    display: block;
}

/* Dashboard and other pages language switcher */
.dashboard-language-switcher,
.upload-language-switcher,
.view-files-language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.dashboard-language-switcher .language-switcher,
.upload-language-switcher .language-switcher,
.view-files-language-switcher .language-switcher {
    margin-left: 0;
}

.dashboard-language-switcher .language-current,
.upload-language-switcher .language-current,
.view-files-language-switcher .language-current {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-language-switcher .language-dropdown,
.upload-language-switcher .language-dropdown,
.view-files-language-switcher .language-dropdown {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile responsive for language switcher */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .language-dropdown {
        right: auto;
        left: 0;
        min-width: 160px;
    }
    
    /* Adjust login page language switcher for mobile */
    .login-language-switcher {
        bottom: 10px;
        right: 20px;
    }
    
    .login-language-switcher .language-current {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .login-language-switcher .language-name {
        display: none; /* Hide text on mobile, show only flag */
    }
    
    /* Adjust dashboard language switcher for mobile */
    .dashboard-language-switcher,
    .upload-language-switcher,
    .view-files-language-switcher {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 15px;
        display: flex;
        justify-content: center;
    }
    
    .dashboard-language-switcher .language-switcher,
    .upload-language-switcher .language-switcher,
    .view-files-language-switcher .language-switcher {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .login-language-switcher {
        bottom: 8px;
        right: 15px;
    }
    
    .login-language-switcher .language-current {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
}

/* ===== Language Switcher Styles ===== */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

.language-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.language-current:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.language-flag {
    font-size: 1rem;
}

.language-name {
    font-weight: 500;
    color: #333;
    font-size: 0.75rem;
}

.language-current i {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.2s ease;
}

/* Click-based dropdown styles */
.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 100000;
    display: none;
    margin-top: 5px;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
}

.language-option.active {
    background: #fff3e0;
    color: #e65100;
    font-weight: 500;
}

.language-option.active:hover {
    background: #ffcc80;
}

.language-option .language-flag {
    font-size: 1rem;
}

.language-option .language-name {
    font-size: 0.8rem;
}



/* Dashboard and other pages language switcher */
.dashboard-language-switcher,
.upload-language-switcher,
.view-files-language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.dashboard-language-switcher .language-switcher,
.upload-language-switcher .language-switcher,
.view-files-language-switcher .language-switcher {
    margin-left: 0;
}

.dashboard-language-switcher .language-current,
.upload-language-switcher .language-current,
.view-files-language-switcher .language-current {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-language-switcher .language-dropdown,
.upload-language-switcher .language-dropdown,
.view-files-language-switcher .language-dropdown {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile responsive for language switcher */
@media (max-width: 768px) {
    .language-switcher {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .language-dropdown {
        right: auto;
        left: 0;
        min-width: 160px;
    }
    
    /* Adjust login page language switcher for mobile */
    .login-language-switcher {
        bottom: 10px;
        right: 20px;
    }
    
    .login-language-switcher .language-current {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .login-language-switcher .language-name {
        display: none; /* Hide text on mobile, show only flag */
    }
    
    /* Adjust dashboard language switcher for mobile */
    .dashboard-language-switcher,
    .upload-language-switcher,
    .view-files-language-switcher {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 15px;
        display: flex;
        justify-content: center;
    }
    
    .dashboard-language-switcher .language-switcher,
    .upload-language-switcher .language-switcher,
    .view-files-language-switcher .language-switcher {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .login-language-switcher {
        bottom: 8px;
        right: 15px;
    }
    
    .login-language-switcher .language-current {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
}
