@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* Reset and Global Styles */
* {
    box-sizing: border-box;
}

:root {
    /* Baseline colors - overridden dynamically in head */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.2);
    --neon-glow-enabled: 1;

    --secondary: #06b6d4; /* Neon Cyan */
    --accent: #f43f5e; /* Neon Rose */
    
    --bg-space: #030712; /* Very deep space black/grey */
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-bg-hover: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 255, 255, 0.2);
    
    --text-main: #ffffff; /* Bright white headings and text */
    --text-silver: #cbd5e1; /* Silver body text */
    --text-muted: #64748b; /* Muted slate */
    --text-inverse: #030712;
    --text-dark: #ffffff;
    
    --header-bg: rgba(3, 7, 18, 0.8);
    --hero-bg: rgba(3, 7, 18, 0.95);
    --grid-color: rgba(255, 255, 255, 0.02);
    --card-shadow: 0 10px 40px rgba(0,0,0,0.5);
    
    --border-radius: 16px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

:root.theme-light {
    --bg-space: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-bg-hover: rgba(255, 255, 255, 1);
    --card-border: rgba(99, 102, 241, 0.12);
    --card-border-hover: rgba(99, 102, 241, 0.3);
    
    --text-main: #0f172a;
    --text-silver: #334155;
    --text-muted: #64748b;
    --text-inverse: #ffffff;
    --text-dark: #0f172a;
    
    --header-bg: rgba(255, 255, 255, 0.85);
    --hero-bg: rgba(255, 255, 255, 0.95);
    --grid-color: rgba(99, 102, 241, 0.03);
    --card-shadow: 0 10px 30px rgba(99, 102, 241, 0.05);
}

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-space);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
        radial-gradient(var(--grid-color) 1px, transparent 0);
    background-size: 100% 100%, 100% 100%, 40px 40px;
    color: var(--text-silver);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(0.5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.05), 0 0 0px var(--primary-glow);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.1), 0 0 15px var(--primary-glow);
    }
}

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

@keyframes glow-border {
    0%, 100% { border-color: var(--card-border); }
    50% { border-color: var(--primary); }
}

/* Header & Navigation */
header {
    background-color: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

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

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.logo-text span {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: var(--text-silver);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    padding: 8px 0;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--text-main);
}

nav ul li a:hover::after, nav ul li.active a::after {
    width: 100%;
}

nav ul li.active a {
    color: var(--text-main);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Base Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 20px;
    box-sizing: border-box;
}

/* SaaS Hero Section */
.hero-wrapper {
    background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.12), transparent 50%), 
                radial-gradient(circle at 10% 80%, rgba(6, 182, 212, 0.08), transparent 50%), 
                var(--hero-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 100px 0 80px 0;
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 50px;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1.3;
}

.hero-content h1 {
    font-size: 50px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 25px;
    color: var(--text-main);
    letter-spacing: -2px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.hero-content h1 span {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

.hero-content p {
    font-size: 18px;
    color: var(--text-silver);
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-image {
    flex: 0.9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 30px var(--primary-glow);
    animation: float 6s ease-in-out infinite;
}

/* Search Bar Container */
.search-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    max-width: 650px;
    margin-bottom: 35px;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-container:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4), 0 0 25px var(--primary-glow);
    background: rgba(255, 255, 255, 0.05);
}

.search-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 14px 15px;
    font-size: 16px;
    color: var(--text-main);
    font-family: inherit;
}

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

.search-input::placeholder {
    color: #4b5563;
}

.search-container select {
    border: none;
    background: transparent;
    color: var(--text-silver);
    font-size: 14px;
    font-weight: 600;
    padding-right: 15px;
    border-right: 1px solid var(--card-border);
    margin-right: 10px;
    outline: none;
    cursor: pointer;
    display: inline-block;
    height: 40px;
}

.search-container select option {
    background-color: var(--bg-space);
    color: var(--text-main);
}

.search-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* Hero Stats Bar */
.hero-stats {
    display: flex;
    gap: 35px;
    margin-top: 45px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-silver);
}

.stat-icon {
    font-size: 22px;
    filter: drop-shadow(0 0 8px var(--primary));
}

.stat-item strong {
    color: var(--text-main);
    font-size: 17px;
    font-weight: 700;
}

/* Category Grid & Cards */
.section-title-wrapper {
    text-align: center;
    margin-bottom: 60px;
    animation: slideInUp 0.6s ease;
}

.section-title-wrapper h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 12px 0;
    letter-spacing: -1px;
}

.section-title-wrapper h2 span {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.section-title-wrapper p {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.category-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 35px 30px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.category-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--card-bg-hover);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 20px var(--primary-glow);
}

.category-card .icon {
    font-size: 36px;
    margin-bottom: 24px;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

.category-card h3 {
    font-size: 21px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.category-card p {
    color: var(--text-silver);
    font-size: 14px;
    margin: 0 0 24px 0;
    line-height: 1.6;
    flex-grow: 1;
}

.category-card .action-text {
    font-weight: 700;
    color: var(--primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.category-card:hover .action-text {
    color: var(--text-main);
    gap: 8px;
    text-shadow: 0 0 10px var(--primary);
}

/* Benefits Section */
.benefits-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.benefit-item {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.benefit-item:hover {
    background: var(--card-bg);
    border-color: var(--card-border);
}

.benefit-icon {
    font-size: 32px;
    margin-bottom: 15px;
    display: inline-block;
    filter: drop-shadow(0 0 8px var(--primary));
}

.benefit-item h4 {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.benefit-item p {
    color: var(--text-silver);
    font-size: 14px;
    margin: 0;
    line-height: 1.6;
}

/* Document Cards */
.latest-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 50px;
}

.doc-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    min-height: 200px;
}

.doc-card:hover {
    transform: translateY(-4px);
    background: var(--card-bg-hover);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5), 0 0 15px var(--primary-glow);
}

.doc-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-badge-pdf {
    background-color: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

.doc-badge-docx {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.doc-badge-other {
    background-color: rgba(100, 116, 139, 0.15);
    border: 1px solid rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
}

.doc-subject {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.doc-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 20px 0;
    line-height: 1.5;
    padding-right: 50px;
}

.doc-meta {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.doc-meta strong {
    color: var(--text-silver);
}

.doc-download-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.doc-download-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Call to Action Banner */
.cta-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 24px;
    padding: 40px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 100px;
    gap: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 35px rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cta-content {
    display: flex;
    align-items: center;
    gap: 25px;
}

.cta-icon {
    font-size: 40px;
    filter: drop-shadow(0 0 12px var(--primary));
}

.cta-text h3 {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
}

.cta-text p {
    margin: 0;
    color: var(--text-silver);
    font-size: 15px;
}

.cta-btn {
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    transition: var(--transition);
    box-shadow: 0 5px 15px var(--primary-glow);
}

.cta-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
    box-shadow: 0 8px 25px var(--primary-glow);
}

/* Inner Page layouts & lists */
.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.group-button {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 24px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.group-button:hover {
    border-color: var(--primary);
    background-color: var(--card-bg-hover);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), 0 0 12px var(--primary-glow);
}

.group-button span.arrow {
    color: var(--primary);
    font-size: 18px;
    transition: var(--transition);
}

.group-button:hover span.arrow {
    transform: translateX(4px);
    text-shadow: 0 0 8px var(--primary);
}

/* Subject view layout */
.subject-header {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 25px;
}

.subject-info h1 {
    font-size: 36px;
    margin: 0 0 8px 0;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subject-info p {
    color: var(--text-silver);
    margin: 0;
    font-size: 15px;
}

.subject-guide-btn {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
}

.subject-guide-btn:hover, .subject-guide-btn.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Subject Document Listings */
.exam-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 50px;
}

.exam-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.exam-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--card-bg-hover);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3), 0 0 10px var(--primary-glow);
}

.exam-details {
    display: flex;
    align-items: center;
    gap: 25px;
}

.exam-year {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    width: 65px;
    height: 65px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
}

.exam-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.exam-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}

.exam-meta strong {
    color: var(--text-silver);
}

.exam-badge {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 800;
}

.exam-badge-resuelto { color: #10b981; }
.exam-badge-examen { color: #f43f5e; }
.exam-badge-apuntes { color: #60a5fa; }

.download-btn {
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: 0 4px 10px var(--primary-glow);
}

.download-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 15px var(--primary-glow);
    transform: translateY(-1px);
}

/* Footer Section */
footer {
    background-color: rgba(3, 7, 18, 0.98);
    color: var(--text-muted);
    padding: 80px 20px 40px 20px;
    margin-top: 120px;
    border-top: 1px solid var(--card-border);
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 50px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 50px;
    margin-bottom: 40px;
}

.footer-col h5 {
    color: var(--text-main);
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 24px 0;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: var(--text-silver);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: var(--text-main);
    text-shadow: 0 0 8px var(--primary);
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.7;
    margin: 20px 0;
}

.footer-socials {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.footer-socials a {
    color: var(--text-silver);
    font-size: 18px;
    text-decoration: none;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.03);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
}

.footer-socials a:hover {
    color: var(--text-main);
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.footer-copyright {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-copyright a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 20px;
    transition: var(--transition);
}

.footer-copyright a:hover {
    color: var(--text-main);
}

/* Generic Hero element used on secondary pages */
.hero {
    text-align: center;
    margin-bottom: 60px;
    padding: 50px 20px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 60%);
}

.hero h1 {
    font-size: 44px;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 15px 0;
    letter-spacing: -1.5px;
}

.hero h1 span {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.hero p {
    font-size: 17px;
    color: var(--text-silver);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Alert Notification Boxes */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    font-weight: 600;
    font-size: 14px;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.alert-error {
    background-color: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: #fda4af;
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 40px;
    }
    .hero-content h1 {
        font-size: 40px;
    }
    .search-container {
        margin: 0 auto 30px auto;
    }
    .hero-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-container {
        height: auto;
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    nav ul {
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .container {
        padding: 40px 20px;
    }
    .section-title-wrapper h2 {
        font-size: 28px;
    }
    .category-grid {
        grid-template-columns: 1fr;
    }
    .exam-item {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        text-align: center;
        padding: 25px 20px;
    }
    .exam-details {
        flex-direction: column;
        gap: 15px;
    }
    .exam-year {
        margin: 0 auto;
    }
    .exam-meta {
        justify-content: center;
    }
    .cta-banner {
        flex-direction: column;
        padding: 30px;
        text-align: center;
    }
    .cta-content {
        flex-direction: column;
        gap: 15px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer-socials {
        justify-content: center;
    }
    .footer-col form {
        justify-content: center;
    }
    .footer-copyright {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .footer-copyright a {
        margin: 5px 10px 0 10px;
    }
}

@media (max-width: 500px) {
    .search-container {
        flex-direction: column;
        border-radius: var(--border-radius);
        padding: 10px;
        align-items: stretch;
    }
    .search-container select {
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        padding: 10px 0;
        margin-right: 0;
        width: 100%;
        text-align: center;
    }
    .search-input {
        text-align: center;
        padding: 10px 0;
    }
    .search-button {
        width: 100%;
        padding: 14px;
    }
    .subject-header {
        text-align: center;
        flex-direction: column;
        align-items: center;
        padding: 25px;
    }
    .subject-info h1 {
        font-size: 28px;
    }
}
