/* ==========================================================================
   EESO 597 "José Alberto Tur" - Global Design & Reset
   ========================================================================== */
:root {
    /* Color Palette */
    --primary-color: #0431b8;
    --primary-dark: #00228c;
    --primary-light: #eff3ff;
    --secondary-color: #d4af37;
    --secondary-dark: #af8d1d;
    --secondary-light: #fdfaf2;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    /* UI System Tokens */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(4, 49, 184, 0.05), 0 4px 6px -2px rgba(4, 49, 184, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(4, 49, 184, 0.1), 0 10px 10px -5px rgba(4, 49, 184, 0.04);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Navigation / Top Navbar
   ========================================================================== */
.navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--secondary-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    gap: 15px;
}

.nav-logo {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.nav-brand:hover .nav-logo {
    transform: rotate(-5deg) scale(1.05);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.school-number {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.school-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-badge {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    background: url('assets/images/school/slider.jpg') no-repeat center center/cover;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 80px 24px;
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 18, 84, 0.9) 0%, rgba(4, 49, 184, 0.75) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-school-logo {
    max-height: 120px;
    width: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    color: var(--secondary-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 3px;
    display: inline-block;
    margin-bottom: 16px;
    background-color: rgba(212, 175, 55, 0.15);
    padding: 6px 18px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(212, 175, 55, 0.25);
}

.hero-announcement {
    background-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    margin: 0 auto 30px auto;
    max-width: 680px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.announcement-bell {
    font-size: 1.8rem;
    animation: ring 2s ease infinite;
    display: inline-block;
}

.hero-announcement p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

@keyframes ring {
    0% { transform: rotate(0); }
    5% { transform: rotate(15deg); }
    10% { transform: rotate(-15deg); }
    15% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(5deg); }
    30% { transform: rotate(-5deg); }
    35% { transform: rotate(0); }
    100% { transform: rotate(0); }
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 35px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-btn {
    display: inline-block;
    padding: 16px 36px;
    background-color: var(--secondary-color);
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: var(--transition-smooth);
    border: 2px solid transparent;
}

.hero-btn:hover {
    transform: translateY(-3px);
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
    width: 100%;
}

/* ==========================================================================
   Tribute & Institutional Card
   ========================================================================== */
.institutional-section {
    margin-bottom: 80px;
}

.tribute-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: flex;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.tribute-card:hover {
    box-shadow: var(--shadow-hover);
}

.tribute-image-wrapper {
    flex: 0 0 320px;
    position: relative;
    background-color: #f1f5f9;
}

.tribute-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tribute-card:hover .tribute-image {
    transform: scale(1.03);
}

.tribute-signature-box {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.tribute-signature {
    max-height: 48px;
    width: auto;
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.tribute-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tribute-badge {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary-dark);
    background-color: var(--secondary-light);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 15px;
}

.tribute-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--primary-dark);
    margin-bottom: 18px;
    line-height: 1.2;
}

.tribute-text {
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 25px;
}

.school-info-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.info-pill {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(4, 49, 184, 0.1);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.materials-section {
    border-top: 1px dashed var(--border-color);
    padding-top: 60px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
}

.section-tag {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--primary-dark);
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Search Bar Area
   ========================================================================== */
.search-container {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 650px;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-full);
    background: white;
    border: 2px solid var(--border-color);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    padding: 6px 20px;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px -5px rgba(4, 49, 184, 0.12);
}

.search-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-right: 12px;
}

.search-box input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 1.05rem;
    color: var(--text-main);
    font-family: inherit;
}

.search-box input:focus {
    outline: none;
}

.search-badge {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    margin-left: 10px;
}

/* ==========================================================================
   Grid of Years
   ========================================================================== */
.years-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* Year Card Element */
.year-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.year-card.active {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.year-card-header {
    display: flex;
    align-items: center;
    padding: 24px;
    cursor: pointer;
    background-color: var(--bg-card);
    transition: var(--transition-fast);
}

.year-card-header:hover {
    background-color: var(--primary-light);
}

.year-badge {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-color);
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    box-shadow: 0 4px 10px rgba(4, 49, 184, 0.2);
}

.year-card.active .year-badge {
    background-color: var(--secondary-color);
    color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.year-card-info {
    flex: 1;
}

.year-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.year-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.year-arrow {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: bold;
    transition: transform 0.3s;
}

.year-card.active .year-arrow {
    color: var(--primary-color);
}

/* Year Expanded Content */
.year-card-content {
    border-top: 1px solid var(--border-color);
    background-color: #fcfdfe;
    max-height: 10000px;
    transition: max-height 0.4s ease-out;
}

.year-card-content.collapsed {
    max-height: 0;
    overflow: hidden;
    border-top: none;
}

.subjects-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================================================
   Subject Accordions
   ========================================================================== */
.subject-accordion {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: white;
    overflow: hidden;
    transition: var(--transition-fast);
}

.subject-accordion:hover {
    border-color: #cbd5e1;
}

.subject-header {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: var(--transition-fast);
}

.subject-header:hover {
    background-color: #fafbfd;
}

.subject-header.active {
    background-color: var(--primary-light);
}

.subject-icon {
    font-size: 1.3rem;
    margin-right: 14px;
}

.subject-title {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.subject-header.active .subject-title {
    color: var(--primary-color);
}

.subject-count {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-right: 14px;
}

.subject-header.active .subject-count {
    background-color: var(--primary-color);
    color: white;
}

.subject-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.subject-header.active .subject-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
}

/* Subject Content Expansion */
.subject-content {
    background-color: #fafbfc;
    border-top: 1px solid var(--border-color);
    max-height: 2000px;
    transition: max-height 0.35s ease;
}

.subject-content.collapsed {
    max-height: 0;
    overflow: hidden;
    border-top: none;
}

.files-list {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   File Cards & Items
   ========================================================================== */
.file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.file-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.file-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0; /* Ensures text truncation works */
}

.file-type-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.file-card-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 15px;
}

.file-download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.file-download-btn:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(4, 49, 184, 0.15);
}

.dl-icon {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.file-download-btn:hover .dl-icon {
    transform: translateY(2px);
}

/* ==========================================================================
   State Indicators (Loading, Empty, Spinners)
   ========================================================================== */
.loading-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 16px auto;
    animation: spin 1s linear infinite;
}

.empty-message-card {
    text-align: center;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 60px 40px;
    max-width: 500px;
    margin: 40px auto;
    box-shadow: var(--shadow-sm);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.8;
}

.empty-message-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.empty-message-card p {
    color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: #0b1530;
    color: white;
    padding: 50px 24px 30px 24px;
    border-top: 4px solid var(--secondary-color);
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.footer-logo {
    height: 44px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.footer-brand-text h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.footer-brand-text p {
    font-size: 0.9rem;
    opacity: 0.75;
}

.footer-divider {
    width: 100%;
    max-width: 300px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.footer-info {
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

.footer-credits {
    margin-top: 6px;
    font-style: italic;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive Breakpoints & Adjustments
   ========================================================================== */
@media (min-width: 900px) {
    .years-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .tribute-card {
        flex-direction: column;
    }
    
    .tribute-image-wrapper {
        flex: 0 0 250px;
    }
    
    .tribute-image {
        height: 250px;
    }
    
    .tribute-info {
        padding: 30px 24px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 600px) {
    .nav-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .nav-badge {
        width: 100%;
        justify-content: center;
    }

    .hero {
        min-height: 400px;
        padding: 60px 16px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .tribute-title {
        font-size: 1.8rem;
    }

    .file-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
    }

    .file-card-info {
        justify-content: center;
    }

    .file-card-name {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        padding-right: 0;
    }

    .file-download-btn {
        width: 100%;
        justify-content: center;
    }
}