/* 
 * SE Curriculum Contest Results - Stylesheet
 * Colors from SE Branding Guide 2025
 * Primary Blue: #005EB8
 * Gold: #FDB913
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header Styles ===== */
.site-header {
    background: linear-gradient(135deg, #005EB8 0%, #003d7a 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 250px;
}

.se-logo {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    padding: 10px;
}

    .se-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.header-text h1 {
    font-size: 2em;
    margin-bottom: 5px;
    font-weight: 600;
}

.header-text p {
    font-size: 1.1em;
    opacity: 0.95;
}

.last-updated {
    background: rgba(255,255,255,0.15);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.update-label {
    font-size: 0.85em;
    opacity: 0.9;
}

.update-time {
    font-weight: 600;
}

/* User Navigation */
.user-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.welcome-text {
    color: white;
    font-size: 0.9em;
    opacity: 0.9;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 0.95em;
}

    .nav-link:hover {
        background-color: rgba(255,255,255,0.1);
    }

.nav-btn {
    background-color: #FDB913;
    color: #003d7a;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.95em;
}

    .nav-btn:hover {
        background-color: #ffc933;
        transform: translateY(-2px);
    }

/* ===== Main Container ===== */
.main-container {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Auto-Refresh Notice ===== */
.auto-refresh-notice {
    background: white;
    border-left: 4px solid #FDB913;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.refresh-icon {
    font-size: 1.5em;
    color: #FDB913;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .refresh-icon svg {
        width: 24px;
        height: 24px;
        color: #FDB913;
    }

/* Animate the icon during refresh */
.refreshing .refresh-icon svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===== View Toggle ===== */
.view-toggle {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.view-toggle button {
    padding: 14px 32px;
    font-size: 1em;
    border: 2px solid #005EB8;
    background: white;
    color: #005EB8;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 200px;
}

.view-toggle button:hover {
    background: #005EB8;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 94, 184, 0.3);
}

.view-toggle button.active {
    background: #005EB8;
    color: white;
}

/* Division Filter */
.division-filter {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

    .division-filter label {
        font-weight: 600;
        color: #005EB8;
        font-size: 1.05em;
    }

.filter-btn {
    padding: 10px 20px;
    font-size: 0.95em;
    border: 2px solid #e0e0e0;
    background: white;
    color: #333;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

    .filter-btn:hover {
        border-color: #FDB913;
        background: #fffdf7;
    }

    .filter-btn.active {
        background: #FDB913;
        color: #003d7a;
        border-color: #FDB913;
        font-weight: 600;
    }

/* ===== Results Section ===== */
.results-section {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* ===== Exam Results Grid ===== */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.exam-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.exam-card:hover {
    border-color: #FDB913;
    box-shadow: 0 4px 12px rgba(253, 185, 19, 0.2);
    transform: translateY(-2px);
}

.exam-title {
    font-size: 1.3em;
    font-weight: bold;
    color: #005EB8;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 3px solid #FDB913;
}

.division-results {
    margin-bottom: 15px;
}

.division-header {
    font-weight: bold;
    color: #003d7a;
    margin-bottom: 8px;
    font-size: 1.05em;
    padding: 5px 0;
}

.result-item {
    padding: 8px 10px;
    color: #333;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: baseline;
    gap: 5px;
}

    .result-item:last-child {
        border-bottom: none;
    }

/* Place styling - bold black for all, no colors */
.place-1st,
.place-2nd,
.place-3rd {
    font-weight: bold;
    color: #000;
    min-width: 35px;
}

/* Optional: Add subtle background colors if you want some distinction */
.result-item:has(.place-1st) {
    background: rgba(253, 185, 19, 0.08);
}

.result-item:has(.place-2nd) {
    background: rgba(0, 94, 184, 0.05);
}

.result-item:has(.place-3rd) {
    background: rgba(0, 94, 184, 0.03);
}

/* Student name - normal styling */
.student-name {
    font-weight: 600;
    color: #333;
}

/* School name - slightly muted */
.school-name {
    color: #666;
    font-style: italic;
}

/* ===== Division Standings ===== */
.division-standings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.division-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.division-card:hover {
    border-color: #005EB8;
    box-shadow: 0 4px 12px rgba(0, 94, 184, 0.2);
    transform: translateY(-2px);
}

.division-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #005EB8;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #FDB913;
}

.school-ranking {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    gap: 10px;
}

    .school-ranking:last-child {
        border-bottom: none;
    }

    .school-ranking:nth-child(1) {
        background: rgba(253, 185, 19, 0.15);
        border-radius: 4px;
        font-weight: bold;
    }

    .school-ranking:nth-child(2) {
        background: rgba(0, 94, 184, 0.08);
        border-radius: 4px;
        font-weight: bold;
    }

    .school-ranking:nth-child(3) {
        background: rgba(0, 94, 184, 0.05);
        border-radius: 4px;
        font-weight: bold;
    }

.school-points-label {
    color: #005EB8;
    font-weight: bold;
    min-width: 45px;
    text-align: right;
    font-size: 1.1em;
}

.school-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

/* ===== Footer Styles ===== */
.site-footer {
    background: #003d7a;
    color: white;
    padding: 30px 20px;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: #FDB913;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.footer-section p {
    margin: 5px 0;
    opacity: 0.9;
    line-height: 1.6;
}

.tagline {
    color: #FDB913;
    font-weight: 600;
    font-size: 1.1em;
    margin-top: 10px !important;
}

.copyright {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 10px !important;
}

/* ===== Loading Indicator ===== */
.loading {
    text-align: center;
    padding: 50px;
    color: #666;
    font-size: 1.2em;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header-text h1 {
        font-size: 1.5em;
    }
    
    .header-text p {
        font-size: 0.95em;
    }
    
    .se-logo {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .exam-grid {
        grid-template-columns: 1fr;
    }
    
    .division-standings {
        grid-template-columns: 1fr;
    }
    
    .view-toggle {
        flex-direction: column;
    }
    
    .view-toggle button {
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .last-updated {
        width: 100%;
        order: 3;
    }
    
    .header-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 10px;
    }
    
    .results-section {
        padding: 15px;
    }
    
    .exam-card,
    .division-card {
        padding: 15px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .view-toggle,
    .auto-refresh-notice,
    .site-footer {
        display: none;
    }
    
    .site-header {
        background: #005EB8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* No Results Message */
.no-results-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
}

.no-results-content {
    text-align: center;
    max-width: 500px;
}

    .no-results-content h2 {
        color: #005EB8;
        font-size: 2em;
        margin-bottom: 20px;
    }

    .no-results-content p {
        color: #666;
        font-size: 1.2em;
        line-height: 1.6;
        margin-bottom: 10px;
    }

    .no-results-content .subtext {
        color: #FDB913;
        font-weight: 600;
        font-size: 1.3em;
    }