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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-width: 0;
    overflow-x: hidden;
    /* Ensure body doesn't break sticky positioning */
    overflow-y: visible;
}

html {
    min-width: 0;
}

body.primary-page {
    /* Ensure primary page body doesn't break sticky */
    overflow-y: visible;
    height: auto;
}

.logo span {
    color: var(--color-text-primary);
    font-weight: 700;
}

.logo #boxtext {
    color: #0E2431;
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
}

/* Auth buttons styling - match tindex.php */
.auth-buttons .signup {
    background: #26262d !important;
    color: var(--color-bg-primary) !important;
    border: 2px solid #26262d !important;
    box-shadow: 0 2px 2px #0f0a1f0a, 0 2px 6px #0f0a1f0f !important;
}

.auth-buttons .signup:hover {
    background-color: #3161ff !important;
    border: 2px solid #3161ff !important;
}

.auth-buttons .login {
    color: var(--color-text-secondary);
    padding: 0.625rem 1.25rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.auth-buttons .login:hover {
    color: var(--color-text-primary);
}

/* Quick Access Section - Full Width */
.quick-access-section {
    width: 100%;
    background-color: var(--color-bg-primary);
    padding: 2rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.quick-access-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.quick-access-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background-color: var(--color-bg-primary);
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
}

.quick-access-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.quick-access-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-tertiary);
    border-radius: 0.75rem;
    color: var(--color-primary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Individual card icon colors */
.quick-access-card:nth-child(1) .quick-access-icon {
    background-color: #dbeafe;
    color: var(--color-primary);
}

.quick-access-card:nth-child(1):hover .quick-access-icon {
    background-color: #bfdbfe;
    color: var(--color-primary-hover);
}

.quick-access-card:nth-child(2) .quick-access-icon {
    background-color: #fef3c7;
    color: #d97706;
}

.quick-access-card:nth-child(2):hover .quick-access-icon {
    background-color: #fde68a;
    color: #b45309;
}

.quick-access-card:nth-child(3) .quick-access-icon {
    background-color: #e9d5ff;
    color: #9333ea;
}

.quick-access-card:nth-child(3):hover .quick-access-icon {
    background-color: #ddd6fe;
    color: #7e22ce;
}

.quick-access-card:nth-child(4) .quick-access-icon {
    background-color: #dbeafe;
    color: var(--color-primary);
}

.quick-access-card:nth-child(4):hover .quick-access-icon {
    background-color: #bfdbfe;
    color: var(--color-primary-hover);
}

.quick-access-card:nth-child(5) .quick-access-icon {
    background-color: #fef3c7;
    color: #d97706;
}

.quick-access-card:nth-child(5):hover .quick-access-icon {
    background-color: #fde68a;
    color: #b45309;
}

.quick-access-card:nth-child(6) .quick-access-icon {
    background-color: #e9d5ff;
    color: #9333ea;
}

.quick-access-card:nth-child(6):hover .quick-access-icon {
    background-color: #ddd6fe;
    color: #7e22ce;
}

.quick-access-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: var(--color-text-secondary);
}

.quick-access-card:hover .quick-access-label {
    color: var(--color-text-primary);
}

/* Responsive adjustments for quick access section */
@media (max-width: 1024px) {
    .quick-access-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .quick-access-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .quick-access-card {
        padding: 1.25rem 0.75rem;
    }
    
    .quick-access-icon {
        width: 56px;
        height: 56px;
    }
    
    .quick-access-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .quick-access-label {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .quick-access-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    .quick-access-card {
        padding: 1rem 0.5rem;
    }
    
    .quick-access-icon {
        width: 48px;
        height: 48px;
    }
    
    .quick-access-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .quick-access-label {
        font-size: 0.75rem;
    }
}

/* Page Wrapper with max-width */
.page-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    background-color: var(--color-bg-primary);
    padding: 0 1rem;
}

/* Page back button container - positioned inside page-wrapper */
.page-back-button-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 2rem 1rem 2rem;
}

.page-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem;
    margin-left: -0.75rem;
    border-radius: 0.5rem;
}

.page-back-link:hover {
    color: #1d4ed8;
    background-color: #eff6ff;
}

.page-back-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .page-back-button-container {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .page-back-button-container {
        padding: 1rem 1rem 0.75rem 1rem;
    }
    
    .page-back-link {
        font-size: 0.8125rem;
    }
}

/* Page Layout */
.page-container {
    display: grid;
    grid-template-columns: 400px 1fr;
}

/* Left Sidebar */
.sidebar {
    padding: 2.5rem 2rem;
    padding-left: 2rem;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--color-primary);
    transform: translateX(-4px);
}


.sidebar-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* A Level specific styling - carousel background matching free resources QG card */
body.alevel-page .carousel-display {
    background: linear-gradient(135deg, #fb7185 0%, #ef4444 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* A Level specific styling - carousel arrows white background */
body.alevel-page .carousel-arrow {
    background-color: #ffffff;
}

body.alevel-page .carousel-arrow:hover {
    background-color: #ffffff;
}

/* A Level specific styling - thumbnail backgrounds matching red carousel */
body.alevel-page .thumbnail {
    background-color: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: 0.875rem;
    padding: 0.75rem;
    opacity: 0.8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.alevel-page .thumbnail:hover {
    opacity: 1;
    border-color: rgba(248, 113, 113, 0.4);
    background-color: rgba(248, 113, 113, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.2);
}

body.alevel-page .thumbnail.active {
    opacity: 1;
    border: 1px solid #f87171;
    background-color: rgba(248, 113, 113, 0.25);
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.3) 0%, rgba(248, 113, 113, 0.2) 100%);
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.2);
}

/* Primary specific styling - carousel background matching free resources QG card */
body.primary-page .carousel-display {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Remove grid pattern from Primary carousel */
body.primary-page .carousel-display::before {
    display: none;
}

/* Secondary specific styling - carousel background matching free resources QG card */
body.secondary-page .carousel-display {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Remove grid pattern from Secondary carousel */
body.secondary-page .carousel-display::before {
    display: none;
}

/* Secondary specific styling - thumbnail backgrounds matching carousel (blue theme) */
body.secondary-page .thumbnail {
    background-color: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 0.875rem;
    padding: 0.75rem;
    opacity: 0.8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.secondary-page .thumbnail:hover {
    opacity: 1;
    border-color: rgba(59, 130, 246, 0.3);
    background-color: rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

body.secondary-page .thumbnail.active {
    opacity: 1;
    border: 1px solid #3b82f6;
    background-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0.15) 100%);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* Primary specific styling - thumbnail backgrounds matching carousel */
body.primary-page .thumbnail {
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 0.875rem;
    padding: 0.75rem;
    opacity: 0.8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.primary-page .thumbnail:hover {
    opacity: 1;
    border-color: rgba(16, 185, 129, 0.3);
    background-color: rgba(16, 185, 129, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

body.primary-page .thumbnail.active {
    opacity: 1;
    border: 1px solid #10b981;
    background-color: rgba(16, 185, 129, 0.18);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(16, 185, 129, 0.15) 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    transform: translateY(-3px) scale(1.02);
}

.sidebar-description {
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.free-resources-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    background: var(--color-primary);
    color: var(--color-bg-primary);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.free-resources-btn:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pdf-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1e40af;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #93c5fd;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.1);
}

.pdf-link:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.pdf-link svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.subscribe-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: fit-content;
    background: #26262d;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.subscribe-button:hover {
    background: #3161ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(49, 97, 255, 0.3);
}

.info-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.info-section:last-of-type {
    border-bottom: none;
    padding-bottom: 1rem;
}

.info-section:has(.sidebar-link-button) {
    border-bottom: none;
    padding-bottom: 1rem;
}

.years-covered-section {
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.years-covered-section .info-text {
    margin-bottom: 0;
}

.sidebar-stats-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.sidebar-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.375rem;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.sidebar-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.info-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.info-text {
    font-size: 0.9375rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 1rem;
}

.info-text-large {
    font-weight: 700;
    color: #4b5563;
    margin: 0;
}

.info-section:has(.stats-container) {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
}

.stats-container {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.stat-item {
    flex: 1;
}

.stat-item .info-text-large {
    font-size: 1rem;
    line-height: 1.4;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tag {
    display: inline-block;
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;

}

.info-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.info-stat {
    text-align: center;
}

.info-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 0.25rem 0;
}

.info-stat-label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-links:has(.sidebar-link-button) {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0.375rem !important;
}

.sidebar-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link svg {
    flex-shrink: 0;
    margin-left: 0.375rem;
    transition: transform 0.2s ease;
}

.sidebar-link:hover {
    color: #1d4ed8;
}

.sidebar-link:hover svg {
    transform: translateX(4px);
}

.sidebar-link-button {
    display: inline-block;
    text-align: center;
    flex: 0 1 auto;
    background-color: #ffffff;
    color: #374151;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
    white-space: nowrap;
}

.sidebar-link-button:hover {
    background-color: #f3f4f6;
    color: #111827;
    border-color: #d1d5db;
    opacity: 1;
}


.sidebar-cta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
}

.cta-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    background: #26262d;
    color: var(--color-bg-primary);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 2px #0f0a1f0a, 0 2px 6px #0f0a1f0f;
}

.cta-primary:hover {
    background: #3161ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(49, 97, 255, 0.3);
}

.cta-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.cta-secondary:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Main Content */
.main-content3 {
    padding: 0 3rem 4rem 3rem;
    max-width: 100%;
    background-color: var(--color-bg-primary);
}

/* Carousel Section */
.carousel-section {
    margin-bottom: 3rem;
    position: relative;
    overflow: visible;
}

.carousel-main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.carousel-display {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    background: #3b82f6;
    border-radius: 1.25rem;
    padding: 2.5rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 20px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 20px);
    background-size: 20px 20px;
    border-radius: 1.25rem;
    pointer-events: none;
}

.carousel-image {
    display: none;
    max-width: 90%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
}

.carousel-image.active {
    display: block;
    animation: fadeInScale 0.4s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.carousel-arrow {
    position: absolute;
    background-color: var(--color-bg-primary);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-arrow:hover {
    background-color: #ffffff;
    color: #1f2937;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.carousel-arrow.left {
    left: -28px;
}

.carousel-arrow.right {
    right: -28px;
}

.carousel-arrow svg {
    stroke: currentColor;
}

.carousel-thumbnails {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 0.5rem 1rem;
    overflow: visible;
}

.thumbnail {
    width: 90px;
    height: 68px;
    object-fit: contain;
    background-color: #dbeafe;
    border: 3px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.thumbnail:hover {
    opacity: 0.8;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--color-primary);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

/* Content Sections */
.content-section {
    margin-bottom: 5rem;
    margin-top: 4rem;
}

.content-section:first-of-type {
    margin-top: 0;
}

/* General paragraph spacing within content sections */
.content-section p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.content-section p:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
    margin-top: 0;
}

.section-description {
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.75;
    margin-bottom: 2.5rem;
    margin-top: 0;
}

.section-description a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.section-description a:hover {
    color: var(--color-primary-hover);
    text-decoration-thickness: 2px;
}

.create-resources-link {
    color: #6b7280 !important;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.create-resources-link:hover {
    color: #4b5563 !important;
    text-decoration-thickness: 2px;
}

/* Skills Check Content Wrapper with Fade Effect */
.skills-check-content-wrapper {
    position: relative;
}

.skills-check-content-wrapper:not(.expanded) {
    max-height: 200px;
    overflow: hidden;
}

.skills-check-content-wrapper.expanded {
    max-height: none;
}

.skills-check-content-wrapper:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.6) 30%, rgba(255, 255, 255, 0.95) 70%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

.skills-check-content-wrapper.expanded::after {
    display: none;
}

.skills-check-view-more-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.skills-check-view-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    background-color: #ffffff;
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.skills-check-view-more:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.skills-check-view-more:active {
    transform: translateY(0);
}

/* Mental Arithmetic Content Wrapper with Fade Effect */
.mental-arithmetic-content-wrapper {
    position: relative;
    margin-top: 0;
}

.mental-arithmetic-content-wrapper:not(.expanded) {
    max-height: 200px;
    overflow: hidden;
}

.mental-arithmetic-content-wrapper.expanded {
    max-height: none;
}

.mental-arithmetic-content-wrapper:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.6) 30%, rgba(255, 255, 255, 0.95) 70%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

.mental-arithmetic-content-wrapper.expanded::after {
    display: none;
}

.mental-arithmetic-view-more-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.mental-arithmetic-view-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.5rem;
    background-color: #ffffff;
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.mental-arithmetic-view-more:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.mental-arithmetic-view-more:active {
    transform: translateY(0);
}

.benefits-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
    margin-left: 2rem;
}

#mental-arithmetic-section .benefits-list {
    gap: 0.5rem;
}

/* Free resources link container */
.content-section > div[style*="text-align: center"] {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.benefits-list li {
    padding: 0;
    padding-left: 1.5rem;
    position: relative;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.6;
}

.gcse-includes-list li strong {
    font-weight: 700;
    color: #4b5563;
}

.qgen-steps-list li::before {
    content: none !important;
    display: none !important;
}

.qgen-steps-list li {
    padding-left: 0;
    list-style: none;
}

.benefits-list.qgen-steps-list li::before {
    content: none !important;
    display: none !important;
}

.benefits-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-border-dark);
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 1;
}

/* Question Generator How To Section */
.collapsible-section-content .qgen-howto-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding-top: 3rem;
    border-top: 1px solid #e5e7eb;
}


.qgen-howto-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.qgen-step {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 2rem 1.5rem;
    position: relative;
}

.qgen-step-content {
    text-align: left;
}

.qgen-step-content h4,
.qgen-step-content p {
    text-align: left;
}

.qgen-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: var(--color-border-light);
}

.qgen-step-content {
    margin-bottom: 1.5rem;
}

.collapsible-section-content .qgen-step-content h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    font-family: 'Roboto', sans-serif;
}

.collapsible-section-content .qgen-step-content p {
    margin: 0;
    font-size: 1rem;
    color: var(--color-text-tertiary);
    line-height: 1.7;
}

.qgen-step-image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

.qgen-step-image img {
    max-width: 200px;
    width: 100%;
    height: auto;
    opacity: 0.7;
}

.collapsible-section-content .qgen-try-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
    margin-bottom: 0;
    padding: 2rem 0 0 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: none;
}

.collapsible-section-content .qgen-try-text {
    font-size: 1.0625rem;
    color: var(--color-text-secondary);
    font-weight: 600;
}

.qgen-try-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: var(--color-bg-primary);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    white-space: nowrap;
}

.qgen-try-button:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}


/* Topics Covered Section */
.collapsible-section-content .topics-section {
    margin-top: 0;
    margin-bottom: 3rem;
}

#question-generator-section.topics-section {
    margin-bottom: 1rem;
}

/* Reduce top margin for topics-section within L2 Further Maths section */
#l2-further-maths-section .topics-section {
    margin-top: 2rem;
}

.collapsible-section-content .tabs-container {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.tabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    gap: 2rem;
}

.tabs-buttons {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    width: 100%;
}

.tab-button {
    padding: 0.875rem 1.05rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
    text-align: center;
    white-space: nowrap;
}

.tab-button:hover {
    color: var(--color-primary);
    background: var(--color-bg-secondary);
}

.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.collapsible-section-content .topics-list {
    list-style: none;
    padding: 0;
    margin-left: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    row-gap: 0.75rem;
}

.topics-list-3col {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 2rem;
    row-gap: 0.5rem;
}

.collapsible-section-content .topics-list li {
    padding: 0.375rem 0;
    padding-left: 0;
    position: relative;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.topics-list li::before {
    content: '•';
    position: absolute;
    left: -1rem;
    color: var(--color-border-dark);
    font-weight: 400;
    font-size: 0.875rem;
}

/* L2 FM Topics Preview with fade */
.l2-fm-topics-preview {
    position: relative;
    max-height: 400px;
    overflow: hidden;
}

.l2-fm-topics-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

.pdf-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    background: var(--color-primary);
    color: var(--color-bg-primary);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
    flex-shrink: 0;
}

.pdf-download-button:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.l2-view-all-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    transition: all 0.3s ease;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.l2-view-all-button:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Resource Types Section */
.resource-types-section {
    margin-top: 3rem;
    margin-bottom: 0;
}

.subsection-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 2rem;
    margin-top: 2.5rem;
}

.subsection-title:first-child {
    margin-top: 0;
}

/* Better hierarchy for subsection titles in collapsible content */
.collapsible-section-content .subsection-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
    margin-top: 0;
    font-family: 'Roboto', sans-serif;
}

.collapsible-section-content .qgen-section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    color: var(--color-text-primary);
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
}

.collapsible-section-content .qgen-section-description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.75;
    margin: 0 0 2.5rem 0;
}

.resource-showcase {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.resource-showcase:not(.expanded) {
    max-height: calc(3 * 200px + 3.75rem + 150px);
    overflow: hidden;
    padding-bottom: 100px;
}

.resource-showcase:not(.expanded) .resource-item:nth-child(n+4) {
    opacity: 0.15;
    pointer-events: none;
}

.resource-showcase:not(.expanded)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.5) 20%, rgba(255, 255, 255, 0.95) 60%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

.resource-showcase.expanded::after {
    display: none;
}

.resource-showcase.expanded {
    max-height: none;
}

.resource-item {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--color-bg-secondary);
    border: none;
    border-radius: 1rem;
    transition: opacity 0.3s ease;
}

.resource-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0.875rem;
    padding: 2rem;
}

.resource-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    .resource-image img {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Primary page specific image colors - all cards use the same grey background */
body.primary-page .resource-image {
    background: transparent;
}

/* Other image containers on primary-info page should have grey background */
body.primary-page .gcse-image-card-1,
body.primary-page .gcse-image-card-2,
body.primary-page .gcse-image-card-3,
body.primary-page .starter-challenge-card-1 .starter-challenge-image,
body.primary-page .starter-challenge-card-2 .starter-challenge-image,
body.primary-page .starter-challenge-card-3 .starter-challenge-image,
body.primary-page .starter-challenge-card-4 .starter-challenge-image,
body.primary-page .section-image {
    background: #f7f8f8;
}

/* Image containers on secondary-info page should have grey background */
body.secondary-page .gcse-image-card-1,
body.secondary-page .gcse-image-card-2,
body.secondary-page .gcse-image-card-3,
body.secondary-page .starter-challenge-card-1 .starter-challenge-image,
body.secondary-page .starter-challenge-card-2 .starter-challenge-image,
body.secondary-page .starter-challenge-card-3 .starter-challenge-image,
body.secondary-page .starter-challenge-card-4 .starter-challenge-image,
body.secondary-page .section-image {
    background: #f7f8f8;
}

/* A Level page specific resource image colors - grey to match secondary */
body.alevel-page .resource-image {
    background: #f7f8f8;
}

/* A Level page resource-item background - grey to match secondary */
body.alevel-page .resource-item {
    background: #f7f8f8;
}

/* A Level page sidebar stats row - no gap */
body.alevel-page .sidebar-stats-row {
    gap: 0;
}

/* A Level page final CTA button styling - yellow button */
body.alevel-page .final-cta-button-primary {
    background-color: #fbbf24;
    color: #78350f;
    border: none;
}

body.alevel-page .final-cta-button-primary:hover {
    background-color: #f59e0b;
    color: #78350f;
}

.resource-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.resource-description {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-description p {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.resource-description strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.view-all-resources-btn {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.875rem 2rem;
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.view-all-resources-btn:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-dark);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.resource-showcase.expanded .view-all-resources-btn {
    display: none;
}

.qgen-banner {
    width: 100%;
    padding: 0;
    margin: 2rem 0 0 0;
}

.qgen-banner-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.qgen-banner-content {
    background: #0f172a;
    border-radius: 1rem;
    border: 1px solid #1e293b;
    padding: 1.5rem 2rem;
    position: relative;
    overflow: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2rem;
    transition: all 0.2s ease;
}

.qgen-banner-link:hover .qgen-banner-content {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-color: #334155;
}

.qgen-banner-text h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    letter-spacing: -0.01em;
    color: #ffffff;
    line-height: 1.3;
}

.qgen-banner-text p {
    margin: 0.5rem 0 0 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #cbd5e1;
    max-width: 560px;
}

.qgen-banner-cta {
    justify-self: end;
    align-self: center;
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #ffffff;
    color: #0f172a;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.qgen-banner-link:hover .qgen-banner-cta {
    background-color: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(2px);
}



/* FAQ Section */
.faq-section {
    margin-top: 0;
    margin-bottom: 0;
    background-color: transparent !important;
}

.faq-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    font-family: 'Roboto', sans-serif;
    color: #2d2d2d;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-size: 1.2rem;
    color: #2d2d2d;
}

.faq-item.expanded .faq-question::after {
    content: '−';
    color: #007BFF;
}

.faq-answer {
    padding: 0 20px 16px;
    font-size: 0.95rem;
    color: #555;
    display: none;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
}

.faq-item.expanded .faq-answer {
    display: block;
}

/* Final CTA */
.final-cta {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.final-cta-text {
    flex: 1;
    text-align: left;
}

.final-cta h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    line-height: 1.3;
}

.final-cta p {
    font-size: 1rem;
    margin: 0;
    color: #d1d5db;
    font-family: 'Roboto', sans-serif;
}

.final-cta-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}

.final-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
    border: none;
    white-space: nowrap;
}

.final-cta-button-primary {
    background: var(--color-accent-yellow);
    color: var(--color-accent-yellow-text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.final-cta-button-primary:hover {
    background: var(--color-accent-yellow-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.final-cta-button-secondary {
    background: transparent;
    color: #ffffff;
    border: 1px solid #6b7280;
}

.final-cta-button-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .page-wrapper {
        max-width: 100%;
        padding: 0 1rem;
    }

    .page-container {
        grid-template-columns: 350px 1fr;
    }

    .sidebar {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 1024px) {
    .page-container {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .page-wrapper {
        min-width: 0;
        width: 100%;
        padding: 0 1rem;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 2rem 1.5rem;
        min-width: 0;
    }

    .main-content,
    .main-content3 {
        padding: 0 1.5rem 2rem 1.5rem;
        min-width: 0;
    }

    .carousel-display {
        height: 300px;
    }

    .topics-list {
        grid-template-columns: 1fr;
    }

    .topics-list-3col {
        grid-template-columns: 1fr;
    }
    
    /* Ensure square aspect ratio on tablets */
    .resource-image,
    .gcse-image-card,
    .section-image,
    .starter-challenge-image {
        aspect-ratio: 1 / 1;
        height: auto;
        min-height: 0;
    }
    
    /* Question Generator section image should be 2:1 ratio */
    #question-generator-section .section-image {
        aspect-ratio: 2 / 1;
    }
    
    #l2-further-maths-section .section-image {
        aspect-ratio: 2 / 1;
    }
    
    #mathsloops-section .gcse-image-card {
        aspect-ratio: 2 / 1;
    }
}

@media (max-width: 768px) {
    .resource-image img {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .year-accordions-container {
        gap: 0.5rem;
    }
    
    .year-accordion-header {
        padding: 0.875rem 1rem;
    }
    
    .year-accordion-title {
        font-size: 0.875rem;
    }
    
    .year-accordion-icon {
        font-size: 1.125rem;
        width: 18px;
    }
    
    .year-content {
        padding: 0.75rem 1rem 1rem 1rem;
    }
    
    .year-content .topics-list {
        column-count: 1;
        column-gap: 0;
        gap: 0.5rem;
    }
    
    .year-content .topics-list li {
        font-size: 0.875rem;
        padding: 0.125rem 0;
        line-height: 1.3;
    }
    
    .question-structures-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .topic-group {
        gap: 0.375rem;
    }
    
    .topic-group-name {
        font-size: 0.875rem;
    }
    
    .topic-item {
        font-size: 0.8125rem;
    }
    
    .sidebar,
    .main-content,
    .main-content3 {
        padding: 0 1rem 1.5rem 1rem;
    }
    
    /* Ensure main container has proper padding */
    .main-content3 {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0;
    }

    .sidebar-title {
        font-size: 2.75rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .tabs-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .tabs-buttons {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .tab-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .qgen-howto-container {
        grid-template-columns: 1fr;
    }

    .qgen-step {
        padding: 1.5rem 1rem;
    }
    
    .qgen-step:not(:last-child)::after {
        display: none;
    }
    
    .qgen-step:not(:last-child) {
        border-bottom: 1px solid #e5e7eb;
    }

    .qgen-step-content h4 {
        font-size: 1rem;
    }

    .qgen-step-content p {
        font-size: 0.875rem;
    }
    
    .qgen-step-image img {
        max-width: 150px;
    }

    .qgen-try-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .qgen-try-text {
        font-size: 0.9375rem;
        text-align: center;
    }
    
    .qgen-try-button {
        width: 100%;
        font-size: 0.9375rem;
        padding: 0.875rem 1.25rem;
    }

    .pdf-download-button {
        width: 100%;
        text-align: center;
    }

    .topics-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

/* Explore Free Resources Section - use resources-grid to match freeresources.php exactly */
.explore-free-resources-section .resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 1.5rem;
    align-items: stretch;
    }

/* Explore Free Resources Section - responsive grid */
section.explore-free-resources-section .explore-free-resources-grid,
.explore-free-resources-section .explore-free-resources-grid {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 768px) {
    section.explore-free-resources-section .explore-free-resources-grid,
    .explore-free-resources-section .explore-free-resources-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Hide cards 3-6 on tablet and mobile, show only first 2 */
    .explore-free-resources-section .explore-resource-card:nth-child(n+3) {
        display: none;
    }
}

@media (max-width: 480px) {
    section.explore-free-resources-section .explore-free-resources-grid,
    .explore-free-resources-section .explore-free-resources-grid {
        grid-template-columns: 1fr !important;
    }

    /* Hide cards 3-6 on mobile, show only first 2 */
    .explore-free-resources-section .explore-resource-card:nth-child(n+3) {
        display: none;
    }
}

    .resource-item {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
        justify-items: center;
    }

    .resource-image {
        max-width: 300px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .resource-image img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        margin: 0;
        display: block;
    }

    .view-all-resources-btn {
        bottom: 40px;
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }

    .subsection-title {
        font-size: 1.25rem;
    }

    .carousel-section {
        padding: 0 1rem;
    }

    .carousel-display {
        padding: 2rem 1.5rem;
        height: 350px;
    }

    .carousel-arrow {
        width: 44px;
        height: 44px;
    }

    .carousel-arrow.left {
        left: 8px;
    }

    .carousel-arrow.right {
        right: 8px;
    }

    .thumbnail {
        width: 70px;
        height: 52px;
    }

    .carousel-thumbnails {
        gap: 0.5rem;
        overflow-x: auto;
        overflow-y: visible;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
    
    .carousel-thumbnails::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .qgen-banner-content {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 1.25rem 1.5rem;
        gap: 1rem;
    }
    
    .qgen-banner-cta {
        justify-self: start;
        margin-top: 0.25rem;
        width: 100%;
        justify-content: center;
    }
    
    .qgen-banner-link:hover .qgen-banner-cta {
        transform: none;
    }

    .final-cta {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .final-cta-text {
        text-align: center;
    }

    .final-cta h3 {
        font-size: 1.25rem;
    }

    .final-cta p {
        font-size: 0.9375rem;
    }

    .final-cta-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .final-cta-button {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .main-content3 {
        padding: 1.5rem 1rem;
    }

    .content-section {
        margin-top: 2rem;
    }

    .section-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .stats-container {
        flex-direction: column;
        gap: 1rem;
    }

    .tags-container {
        gap: 0.5rem;
    }

    .tag {
        font-size: 0.6875rem;
        padding: 0.25rem 0.5rem;
    }

    .sidebar-links {
        gap: 0.5rem;
    }

    .topic-pdfs-links {
        flex-direction: column;
    }

    .topic-pdf-link {
        width: 100%;
        justify-content: center;
    }

    .collapsible-section-content .topics-list {
        grid-template-columns: 1fr;
        margin-left: 0.5rem;
    }

    .qgen-howto-container {
        gap: 0;
    }

    .benefits-list {
        margin-left: 1rem;
    }

    .resource-showcase {
        gap: 1rem;
    }

    .resource-item {
        padding: 1rem;
    }

    .section-image {
        padding: 2rem;
    }

    .gcse-image-card {
        padding: 2rem;
    }
    
    /* Ensure square aspect ratio on tablets */
    .resource-image,
    .gcse-image-card,
    .section-image,
    .starter-challenge-image {
        aspect-ratio: 1 / 1;
        height: auto;
        min-height: 0;
    }
}

@media (max-width: 550px) {
    .gcse-images-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        width: calc(100% + 2rem);
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .gcse-image-card {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
}

@media (max-width: 480px) {
    .sidebar,
    .main-content,
    .main-content3 {
        padding: 1rem 0.75rem;
    }
    
    /* Ensure main container has proper padding */
    .main-content3 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .question-structures-container {
        grid-template-columns: 1fr !important;
    }
    
    .year-content .topics-list {
        column-count: 1 !important;
        column-gap: 0;
        gap: 1.5rem;
    }

    .gcse-images-container {
        width: calc(100% + 1.5rem);
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    .sidebar-title {
        font-size: 2.25rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .subsection-title {
        font-size: 1.125rem;
    }

    .carousel-display {
        height: 250px;
        padding: 1.5rem 1rem;
    }

    .carousel-arrow {
        width: 36px;
        height: 36px;
    }

    .carousel-arrow.left {
        left: 4px;
    }

    .carousel-arrow.right {
        right: 4px;
    }

    .carousel-arrow svg {
        width: 18px;
        height: 18px;
    }

    .thumbnail {
        width: 60px;
        height: 45px;
    }

    .carousel-thumbnails {
        gap: 0.375rem;
        padding: 0.5rem 0.5rem 0.5rem 0.5rem;
        overflow-y: visible;
    }

    .info-text-large {
        font-size: 0.9375rem;
    }

    .subscribe-button,
    .cta-primary {
        width: 100%;
        justify-content: center;
    }

    .sidebar-link-button {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
        white-space: normal;
    }

    .section-description {
        font-size: 0.9375rem;
    }

    .content-section p {
        font-size: 0.9375rem;
    }

    .benefits-list li {
        font-size: 0.9375rem;
        padding-left: 1.25rem;
    }

    .topics-list li {
        font-size: 0.875rem;
    }

    .qgen-step {
        padding: 1.25rem 0.75rem;
    }

    .qgen-step-content h4 {
        font-size: 0.9375rem;
    }

    .qgen-step-content p {
        font-size: 0.8125rem;
    }

    .qgen-step-image img {
        max-width: 120px;
    }

    .resource-item {
        padding: 0.75rem;
        justify-items: center;
    }
    
    .resource-image {
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .resource-image img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        margin: 0;
        display: block;
    }
    
    .gcse-image-card,
    .section-image,
    .starter-challenge-image {
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .gcse-image-card img,
    .section-image img,
    .starter-challenge-image img {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
        display: block;
    }

    .resource-name {
        font-size: 1.125rem;
    }

    .resource-description p {
        font-size: 0.875rem;
    }

    .section-image {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .gcse-image-card {
        padding: 1.5rem;
    }

    .qgen-banner-content {
        padding: 1.25rem 1.25rem;
        gap: 1rem;
    }

    .qgen-banner-text h3 {
        font-size: 1.125rem;
    }

    .qgen-banner-text p {
        font-size: 0.875rem;
    }

    .qgen-banner-cta {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        width: 100%;
        justify-content: center;
    }
    
    .qgen-banner-link:hover .qgen-banner-cta {
        transform: none;
    }

    .final-cta {
        padding: 1.25rem;
    }

    .final-cta h3 {
        font-size: 1.125rem;
    }

    .final-cta p {
        font-size: 0.875rem;
    }

    .final-cta-button {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }

    .topic-pdf-link {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .topic-pdf-link svg {
        width: 18px;
        height: 18px;
    }

    .tab-button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .collapsible-section-header {
        padding: 1rem 0;
    }

    .collapsible-section-header .section-title,
    .collapsible-section-header .subsection-title {
        font-size: 1.125rem;
    }

    .collapsible-section-content {
        padding: 1.25rem 0;
    }

    .faq-question {
        padding: 12px 16px;
        font-size: 0.9375rem;
    }

    .faq-answer {
        padding: 0 16px 12px;
        font-size: 0.875rem;
    }
}

@media (max-width: 410px) {
    .page-wrapper {
        min-width: 0;
        width: 100%;
        padding: 0 0.75rem;
    }
    
    .page-container {
        min-width: 0;
        width: 100%;
    }

    .sidebar-link-button {
        white-space: normal;
        word-break: break-word;
    }

    .qgen-try-button,
    .final-cta-button,
    .topic-pdf-link {
        white-space: normal;
    }
}

@media (max-width: 350px) {
    .sidebar,
    .main-content,
    .main-content3 {
        padding: 0.75rem 0.5rem;
    }
    
    /* Ensure main container has proper padding */
    .main-content3 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .page-wrapper {
        min-width: 0;
        width: 100%;
        padding: 0 0.5rem;
    }
    
    .page-container {
        min-width: 0;
        width: 100%;
    }

    .sidebar-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .subsection-title {
        font-size: 1rem;
    }

    .carousel-display {
        height: 200px;
        padding: 1rem 0.75rem;
    }

    .carousel-arrow {
        width: 32px;
        height: 32px;
    }

    .carousel-arrow svg {
        width: 16px;
        height: 16px;
    }

    .thumbnail {
        width: 50px;
        height: 38px;
    }

    .gcse-images-container {
        width: calc(100% + 1rem);
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        gap: 0.75rem;
    }

    .gcse-image-card {
        padding: 1.5rem;
    }

    .section-image {
        padding: 1.5rem;
    }

    .content-section p {
        font-size: 0.875rem;
    }

    .benefits-list li {
        font-size: 0.875rem;
        padding-left: 1rem;
    }

    .topics-list li {
        font-size: 0.8125rem;
    }

    .qgen-step {
        padding: 1rem 0.5rem;
    }

    .qgen-step-content h4 {
        font-size: 0.875rem;
    }

    .qgen-step-content p {
        font-size: 0.75rem;
    }

    .qgen-step-image img {
        max-width: 100px;
    }

    .resource-item {
        padding: 0.5rem;
    }

    .resource-name {
        font-size: 1rem;
    }

    .resource-description p {
        font-size: 0.8125rem;
    }

    .final-cta {
        padding: 1rem;
    }

    .final-cta h3 {
        font-size: 1rem;
    }

    .final-cta p {
        font-size: 0.8125rem;
    }

    .final-cta-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.6875rem;
    }

    .topic-pdf-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    .collapsible-section-header {
        padding: 0.875rem 0;
    }

    .collapsible-section-header .section-title,
    .collapsible-section-header .subsection-title {
        font-size: 1rem;
    }

    .faq-question {
        padding: 10px 12px;
        font-size: 0.875rem;
    }

    .faq-answer {
        padding: 0 12px 10px;
        font-size: 0.8125rem;
    }
}

/* Explore Free Resources Section - 3 columns override (after index.css) */
/* Explore Free Resources Section */
.explore-free-resources-section {
    background-color: var(--color-bg-primary);
    padding: 3rem 1rem;
    margin: 3rem 0;
}

.explore-free-resources-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.explore-free-resources-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    text-align: center;
    margin: 0 0 3rem 0;
    font-family: 'Roboto', sans-serif;
    position: relative;
    display: inline-block;
    width: 100%;
}

.explore-free-resources-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: var(--color-accent-yellow);
    border-radius: 2px;
    opacity: 0.9;
}

.explore-free-resources-grid-wrapper {
    position: relative;
    margin-bottom: 0rem;
}

.explore-free-resources-section .explore-free-resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Resources grid in explore section - match freeresources.php exactly */
.explore-free-resources-section .resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 1.5rem;
    align-items: stretch;
}

.explore-grid-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

.explore-resource-card {
    background-color: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    border: none;
    transition: transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0;
    text-decoration: none;
    color: inherit;
}

.explore-resource-card:hover {
    transform: translateY(-2px);
}

.explore-resource-card:focus,
.explore-resource-card:active {
    outline: none;
    -webkit-tap-highlight-color: transparent;
    background-color: transparent;
}

.explore-resource-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.explore-resource-image {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    padding-top: 1.25rem;
    background-color: #f7f8f8;
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.explore-resource-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: capitalize;
    white-space: nowrap;
    z-index: 10;
}

.explore-resource-badge.primary {
    background-color: #047857;
    color: var(--color-bg-primary);
}

.explore-resource-badge.secondary {
    background-color: #2563eb;
    color: var(--color-bg-primary);
}

.explore-resource-badge.gcse {
    background-color: #fcd34d;
    color: var(--color-text-primary);
}

.explore-resource-badge.alevel {
    background-color: #f87171;
    color: #ffffff;
}

.explore-resource-badge.l2fm {
    background-color: #ec4899;
    color: var(--color-bg-primary);
}

.explore-resource-image img {
    max-width: 90%;
    width: auto;
    height: auto;
    min-height: 200px;
    object-fit: contain;
    object-position: top center;
}

.explore-resource-content {
    padding: 0.75rem 0;
}

.explore-resource-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.explore-resource-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.explore-resource-meta span:nth-child(even) {
    color: #000000;
    font-weight: 700;
}

.explore-free-resources-link {
    text-align: center;
    margin-top: 3rem;
}

.explore-free-resources-link a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
}

.explore-free-resources-link a:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    color: var(--color-text-primary);
}

@media (max-width: 1200px) {
    .explore-free-resources-section .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .explore-free-resources-section .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .explore-free-resources-section .explore-free-resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .explore-free-resources-section .explore-resource-card:nth-child(n+3) {
        display: none;
    }
}

@media (max-width: 640px) {
    .explore-free-resources-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .explore-free-resources-section .explore-free-resources-grid {
        grid-template-columns: 1fr;
    }
    
    .explore-free-resources-title {
        font-size: 2rem;
    }
}

/* Year Accordions Container */
.year-accordions-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.year-accordion {
    background: var(--color-bg-primary);
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.year-accordion:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.year-accordion.expanded {
    border-color: #9ca3af;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.year-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Roboto', sans-serif;
    color: #111827;
    text-decoration: none;
}

.year-accordion-header:focus {
    outline: none;
    color: #111827;
}

.year-accordion-header:visited {
    color: #111827;
}

.year-accordion-header:hover {
    background-color: #f9fafb;
    color: #111827;
}

.year-accordion.expanded .year-accordion-header {
    background-color: #f9fafb;
}

.year-accordion-icon {
    font-size: 1.5rem;
    font-weight: 400;
    color: #6b7280;
    line-height: 1;
    width: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    flex-shrink: 0;
    font-family: 'Roboto', sans-serif;
}

.year-accordion.expanded .year-accordion-icon {
    color: #374151;
    transform: none; /* Don't rotate when using minus sign */
}

.year-accordion-title {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    flex: 1;
}

.year-accordion-header * {
    color: inherit;
}

.year-accordion-count {
    font-weight: 400;
    font-size: 0.8125rem;
    color: #6b7280;
    flex-shrink: 0;
}

.year-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.year-accordion.expanded .year-accordion-content {
    max-height: 5000px;
}

.year-content {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    background: transparent;
    border-top: 1px solid #f3f4f6;
}

.year-content .topics-list {
    list-style: none;
    padding: 0;
    margin: 0;
    column-count: 2;
    column-gap: 1rem;
}

.year-content .topics-list li {
    padding: 0.125rem 0;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.3;
    font-weight: 400;
    font-family: 'Roboto', sans-serif;
}

.year-content-placeholder {
    color: #6b7280;
    text-align: center;
    margin: 2rem 0;
    font-size: 0.9375rem;
}

.question-structures-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.question-structures-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.topic-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.topic-group-name {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.9375rem;
    margin: 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.topic-items-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.topic-item {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
    padding: 0.25rem 0;
    line-height: 1.4;
}


/* Collapsible Sections */
.collapsible-section {
    position: relative;
    width: 100%;
    margin: 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    overflow: visible;
}

/* Override content-section margins for collapsible sections */
.collapsible-section.content-section {
    margin-bottom: 0;
    margin-top: 0;
}

.collapsible-section:last-child {
    border-bottom: none;
}

.collapsible-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0;
    background: transparent;
    color: var(--color-text-secondary);
    border: none;
    border-radius: 0;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.875rem;
}

.collapsible-section-header:hover {
    background: transparent;
}

.collapsible-section-header .section-title,
.collapsible-section-header .subsection-title {
    margin: 0;
    flex: 1;
    font-size: 1.25rem;
    font-weight: 600;
    color: #000000;
    font-family: 'Roboto', sans-serif;
}

.collapsible-section-icon {
    transition: transform 0.3s ease;
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-left: 1rem;
}

.collapsible-section.expanded .collapsible-section-icon {
    transform: rotate(180deg);
}

.collapsible-section-content {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    display: none;
}

.collapsible-section.expanded .collapsible-section-content {
    max-height: none;
    padding: 1.5rem 0;
    display: block;
}

/* Section Image (above sections) */
.section-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    background: #3b82f6;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    margin: 0 auto 2rem auto;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Question Generator section image should be 2:1 ratio */
#question-generator-section .section-image {
    aspect-ratio: 2 / 1;
}

#l2-further-maths-section .section-image {
    aspect-ratio: 2 / 1;
}

#mathsloops-section .gcse-image-card {
    aspect-ratio: 2 / 1;
}

.section-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Question Generator section - 90% width image, shorter container */
#question-generator-section .section-image {
    aspect-ratio: 3 / 1;
    padding: 2rem;
}

#question-generator-section .section-image img {
    width: 90%;
    height: auto;
    max-width: none;
}

.section-image:hover {
    transform: translateY(-4px);
}

/* SATS Image Container */
.sats-image-container {
    width: 100%;
    background-color: #f9fafb;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.sats-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* GCSE Images Container - Two cards side by side */
.gcse-images-container {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-bottom: 2rem;
    margin-left:auto;
    margin-right:auto;
}

.gcse-image-card {
    flex: 1;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gcse-image-card-1 {
    background: #3b82f6;
}

.gcse-image-card-2 {
    background: #fbbf24;
}

.gcse-image-card-3 {
    background: #8b5cf6;
}

/* A Level specific image card colors */
body.alevel-page .gcse-image-card-1 {
    background: var(--color-accent-yellow);
}

body.alevel-page .gcse-image-card-2 {
    background: #8b5cf6;
}

body.alevel-page .gcse-image-card-3 {
    background: #3b82f6;
}

/* A Level Further Maths section image cards */
body.alevel-page #a-level-further-maths-section .gcse-image-card-1 {
    background: #cd3855;
}

body.alevel-page #a-level-further-maths-section .gcse-image-card-2 {
    background: #cd3855;
}

/* A Level 3 Questions section - 2:1 aspect ratio */
body.alevel-page #three-questions-section .section-image {
    aspect-ratio: 2 / 1;
}

/* A Level 3 Questions section - larger on mobile */
@media (max-width: 768px) {
    body.alevel-page #three-questions-section .section-image {
        min-height: 300px;
        padding: 2.5rem;
    }
    
    body.alevel-page #three-questions-section .section-image img {
        width: 150%;
        max-width: 150%;
        height: auto;
    }
}

/* A Level Revision Notes - grey backgrounds */
body.alevel-page #revision-notes-section .gcse-image-card-1,
body.alevel-page #revision-notes-section .gcse-image-card-2 {
    background: #f7f8f8;
}

.gcse-image-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gcse-image-card:hover {
    transform: translateY(-4px);
}

/* Explore Free Resources Link Styling */
.explore-free-resources-link a {
    background-color: var(--color-bg-primary) !important;
    border: 1px solid #d1d5db !important;
    color: var(--color-text-primary) !important;
    padding: 0.625rem 1.25rem !important;
}

.explore-free-resources-link a:hover {
    background-color: var(--color-bg-secondary) !important;
    border-color: var(--color-border-medium) !important;
    color: var(--color-text-primary) !important;
}

/* Topic PDFs Section */
.topic-pdfs-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.topic-pdfs-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 1rem 0;
    font-family: 'Roboto', sans-serif;
}

.topic-pdfs-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.qgen-buttons-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.qgen-buttons-row .topic-pdf-link {
    width: 100%;
}

@media (max-width: 768px) {
    .qgen-buttons-row {
        grid-template-columns: 1fr !important;
        display: grid !important;
    }
    
    .qgen-buttons-row .topic-pdf-link {
        width: 100%;
    }
}

.topic-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-bg-primary);
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--color-text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Roboto', sans-serif;
}

.topic-pdf-link:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-dark);
    color: var(--color-text-primary);
}

.topic-pdf-link svg {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.topic-pdf-link:hover svg {
    color: var(--color-text-secondary);
}

.topic-pdf-link-text {
    display: inline-block;
}

/* Prevent content shift by maintaining consistent margins */
.collapsible-section-content > * {
    margin-left: 0;
    margin-right: 0;
}

/* Starters and Challenges Section */
.starters-challenges-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
    margin-top: 2rem;
}

.starter-challenge-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-primary);
    border-radius: 1rem;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.starter-challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.starter-challenge-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.starter-challenge-card-1 .starter-challenge-image {
    background: #3b82f6;
}

.starter-challenge-card-2 .starter-challenge-image {
    background: #fbbf24;
}

.starter-challenge-card-3 .starter-challenge-image {
    background: #8b5cf6;
}

.starter-challenge-card-4 .starter-challenge-image {
    background: #10b981;
}



.starter-challenge-image img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

@media (max-width: 1024px) {
    .starters-challenges-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 550px) {
    .starters-challenges-container {
        grid-template-columns: 1fr;
    }
    
    .starter-challenge-image {
        padding: 2rem;
    }
}

/* Resource Card Styles (from free-resources.css) for Explore Free Resources section */
.resource-card {
    background-color: transparent;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: none;
    border: none;
    transition: transform 0.2s;
    cursor: pointer;
    display: block;
    position: relative;
    padding: 0;
    height: 100%;
}

.resource-card:hover {
    transform: translateY(-2px);
}

.resource-card-image-container {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    padding-top: 1.25rem;
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: var(--color-bg-secondary);
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.resource-card-image {
    max-width: 90%;
    width: auto;
    height: auto;
    min-height: 200px;
    object-fit: contain;
    object-position: top center;
    position: relative;
    z-index: 1;
}

.resource-card-content {
    background-color: var(--color-bg-primary);
    width: 100%;
    padding: 0.5rem 0 1.25rem 0;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: none;
    margin-top: -30px;
    z-index: 2;
}

.resource-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0.75rem 0 0 0;
    text-align: left;
    line-height: 1.4;
    width: 100%;
    padding: 0;
}

.resource-card-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: capitalize;
    white-space: nowrap;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--color-text-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.resource-card-badge.primary {
    background-color: #10b981;
    color: #ffffff;
}

.resource-card-bottom-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-border-dark);
    width: 100%;
}

.resource-card-bottom-type,
.resource-card-bottom-info-text {
    color: var(--color-text-muted);
}

.resource-card-bottom-separator {
    color: var(--color-text-muted);
    font-weight: 700;
}

.resource-card-bottom-print-project {
    color: var(--color-text-muted);
}

/* Ensure resource cards work in the explore grid */
.explore-free-resources-grid .resource-card {
    display: flex;
    flex-direction: column;
}
