/* Past Papers Year Page Styles */
:root {
    /* Your Color Scheme */
    --bg-primary: #0b0b0b;
    --bg-secondary: #111111;
    --bg-card: #181818;
    --text-primary: #ffffff;
    --text-secondary: #bdbdbd;
    --accent-primary: #f97316;
    --accent-secondary: #ff9a3d;
    --border-color: #2a2a2a;
    --success-color: #22c55e;
    --info-color: #3b82f6;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Remove gap between header and hero */
#header-container + main {
    margin-top: 0;
}

/* Hero Section */
.papers-hero {
    padding: 30px 0 40px;
    background: linear-gradient(135deg, 
        #0b0b0b 0%, 
        #151515 25%, 
        #1a0a00 50%, 
        #331100 75%, 
        #4a1a00 100%);
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--accent-primary);
}

.papers-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(249, 115, 22, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--text-primary);
}

.breadcrumb i {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Papers Info */
.papers-info {
    text-align: center;
    margin-bottom: 30px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(90deg, 
        var(--accent-primary) 0%, 
        var(--accent-secondary) 50%, 
        var(--accent-primary) 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: badgeGlow 3s ease-in-out infinite;
}

@keyframes badgeGlow {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
    }
    50% { 
        box-shadow: 0 4px 25px rgba(249, 115, 22, 0.7);
    }
}

.hero-badge i {
    margin-right: 8px;
    font-size: 0.95rem;
}

.papers-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-primary);
    line-height: 1.2;
    background: linear-gradient(to right, 
        #ffffff 0%, 
        #ffb380 50%, 
        #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

/* Papers Meta */
.papers-meta {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.meta-item:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-2px);
}

.meta-item i {
    color: var(--accent-primary);
    font-size: 0.95rem;
}

/* Years Section */
.years-section {
    padding: 50px 0;
    background: var(--bg-primary);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Years Grid - SQUARE CARDS */
.years-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin: 0 auto;
    max-width: 1200px;
}

.year-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.year-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px rgba(249, 115, 22, 0.15);
}

.year-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.year-card:hover::before {
    opacity: 1;
}

.year-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--success-color), #4ade80);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

.year-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.year-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 15px;
    line-height: 1;
    text-align: center;
}

.year-info {
    flex: 1;
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.year-title {
    display: none;
}

.year-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 0 10px;
}

.year-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 8px;
    transition: all 0.3s;
}

.year-card:hover .year-action {
    background: var(--accent-primary);
    transform: translateY(-2px);
}

.action-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-primary);
    transition: color 0.3s;
}

.year-card:hover .action-text {
    color: white;
}

.action-icon {
    color: var(--accent-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.year-card:hover .action-icon {
    color: white;
    transform: translateX(5px);
}

/* ============================================ */
/* UPDATED DEMO BANNER - WITH TWO BUTTONS      */
/* ============================================ */
.coaching-banner {
    padding: 60px 20px;
    background: var(--bg-secondary);
}

.demo-content {
    background: linear-gradient(135deg, 
        rgba(249, 115, 22, 0.15) 0%, 
        rgba(249, 115, 22, 0.05) 100%);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 20px;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 1000px;
    margin: 0 auto;
}

.demo-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), #ff9a3d);
}

.demo-content h2 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.demo-subtitle {
    font-size: 1.2rem;
    color: var(--accent-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.demo-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 35px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero Button Base Styles */
.hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    min-width: 220px;
    white-space: nowrap;
    margin: 0 8px;
}

/* Primary Button */
.hero-button.primary {
    background: linear-gradient(135deg, var(--accent-primary), #ff9a3d);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.hero-button.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

/* Secondary Button */
.hero-button.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--accent-primary);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.2);
}

.hero-button.secondary:hover {
    background: rgba(249, 115, 22, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

.hero-button i {
    font-size: 1.1rem;
}

/* Demo Note */
.demo-note {
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Gradient Overlay */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 20% 50%,
        rgba(249, 115, 22, 0.15) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 80% 20%,
        rgba(249, 115, 22, 0.1) 0%,
        transparent 50%
    );
    z-index: 1;
    pointer-events: none;
}

/* ============================================ */
/* MODAL COMPONENT - Popup Styles */
/* ============================================ */

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.popup-overlay.active {
    display: flex;
}

.popup-container {
    background: var(--popup-bg, #1a1a1a);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(249, 115, 22, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--popup-bg, #1a1a1a);
    border-radius: 20px 20px 0 0;
    z-index: 2;
}

.popup-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary, #ffffff);
    font-weight: 700;
    margin: 0;
}

.popup-close {
    background: none;
    border: none;
    color: var(--text-secondary, #bdbdbd);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-primary, #f97316);
}

.popup-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary, #ffffff);
    font-weight: 500;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary, #f97316);
    background: rgba(255, 255, 255, 0.1);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group select option {
    background: var(--popup-bg, #1a1a1a);
    color: var(--text-primary, #ffffff);
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 25px;
    transition: transform 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.submit-btn i {
    font-size: 1.2rem;
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .popup-container {
        max-height: 85vh;
    }

    .popup-header {
        padding: 20px 25px;
    }

    .popup-header h2 {
        font-size: 1.3rem;
    }

    .popup-body {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .popup-body {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 14px;
        font-size: 1rem;
    }
}

/* ========== BUTTON STYLES for open-popup-btn ========== */
.open-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #f97316, #ff9a3d);
    color: white;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.open-popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.open-popup-btn:active {
    transform: translateY(0);
}

.open-popup-btn i {
    font-size: 1.1rem;
}

.open-popup-btn.small {
    padding: 8px 20px;
    font-size: 0.85rem;
}

.open-popup-btn.large {
    padding: 18px 45px;
    font-size: 1.2rem;
}

.open-popup-btn.outline {
    background: transparent;
    border: 2px solid #f97316;
    color: #f97316;
    box-shadow: none;
}

.open-popup-btn.outline:hover {
    background: rgba(249, 115, 22, 0.1);
    transform: translateY(-2px);
}

/* ========================= */
/* RESPONSIVE BREAKPOINTS    */
/* ========================= */

/* Tablet (768px and up) */
@media (min-width: 768px) {
    .papers-hero {
        padding: 50px 0 60px;
        margin-top: -60px;
    }
    
    .papers-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .meta-item {
        font-size: 0.95rem;
        padding: 10px 20px;
    }
    
    .years-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    /* Demo banner tablet adjustments */
    .hero-button {
        padding: 14px 28px;
        min-width: 200px;
        margin: 0 6px;
    }
    
    .demo-note {
        margin-top: 28px;
        font-size: 0.9rem;
        gap: 10px;
    }
}

/* Desktop (992px and up) */
@media (min-width: 992px) {
    .papers-hero {
        padding: 60px 0 80px;
        margin-top: 0px;
    }

    .papers-title {
        font-size: 4rem;
    }
    
    .years-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .year-card {
        height: 260px;
    }
    
    .year-number {
        font-size: 3rem;
    }
}

/* Mobile (767px and below) */
@media (max-width: 767px) {
    .papers-hero {
        padding: 30px 0 40px;
        margin-top: -60px;
    }
    
    .breadcrumb {
        font-size: 0.8rem;
        gap: 6px;
        margin-bottom: 20px;
    }
    
    .hero-badge {
        font-size: 0.85rem;
        padding: 8px 16px;
        margin-bottom: 15px;
    }
    
    .papers-title {
        font-size: 2.2rem;
        margin-bottom: 12px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .papers-meta {
        gap: 10px;
        margin-top: 20px;
    }
    
    .meta-item {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .years-section {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .years-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .year-card {
        height: 230px;
        padding: 20px;
    }
    
    .year-number {
        font-size: 2.5rem;
    }
    
    .year-action {
        padding: 8px 12px;
    }
    
    .action-text {
        font-size: 0.9rem;
    }
    
    /* Demo banner mobile styles */
    .coaching-banner {
        padding: 40px 20px;
    }
    
    .demo-content {
        padding: 40px 25px;
    }
    
    .demo-content h2 {
        font-size: 1.6rem;
    }
    
    .demo-subtitle {
        font-size: 1.1rem;
    }
    
    .demo-description {
        margin-bottom: 30px;
        font-size: 0.95rem;
    }
    
    /* Stack buttons vertically on mobile */
    .hero-button {
        display: flex;
        width: 100%;
        max-width: 320px;
        margin: 0 auto 12px auto;
        padding: 14px 24px;
        font-size: 0.95rem;
        white-space: normal;
        word-break: keep-all;
    }
    
    .demo-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-button.primary {
        margin-bottom: 16px;
    }
    
    .hero-button.secondary {
        margin-bottom: 8px;
    }
    
    .demo-note {
        margin-top: 28px;
        font-size: 0.85rem;
        gap: 8px;
        padding: 10px 16px;
        width: 100%;
        text-align: center;
        border-radius: 30px;
    }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
    .years-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .year-card {
        height: 220px;
        padding: 20px;
    }
    
    .papers-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .papers-meta {
        flex-direction: column;
        align-items: center;
    }
    
    .meta-item {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .year-number {
        font-size: 2.2rem;
    }
    
    .year-desc {
        font-size: 0.85rem;
    }
    
    /* Demo banner small mobile */
    .coaching-banner {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .demo-content {
        padding: 30px 20px;
    }
    
    .demo-content h2 {
        font-size: 1.4rem;
    }
    
    .hero-button {
        max-width: 280px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .hero-button i {
        font-size: 1rem;
    }
    
    .demo-note {
        font-size: 0.8rem;
        padding: 8px 12px;
        margin-top: 24px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .year-card,
    .hero-button,
    .meta-item,
    .open-popup-btn {
        min-height: 44px;
    }
    
    .year-card:active,
    .hero-button:active,
    .meta-item:active,
    .open-popup-btn:active {
        transform: scale(0.97);
    }
    
    .year-card:hover,
    .hero-button:hover,
    .meta-item:hover,
    .open-popup-btn:hover {
        transform: none;
    }
    
    .year-card:active .year-action {
        background: var(--accent-primary);
    }
    
    .year-card:active .action-text,
    .year-card:active .action-icon {
        color: white;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .hero-badge,
    .year-card,
    .hero-button,
    .meta-item,
    .year-badge,
    .open-popup-btn {
        transition: none;
        animation: none;
    }
    
    .year-card:hover,
    .hero-button:hover,
    .meta-item:hover,
    .open-popup-btn:hover {
        transform: none;
    }
    
    .year-badge {
        animation: none;
    }
}