/* SSC Past Papers 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;
}

/* CSS-only Toggle System */
.toggle-content {
    display: none;
}

#past-papers:target ~ .toggle-content.papers-section,
#answer-keys:target ~ .toggle-content.keys-section {
    display: block;
}

/* Default state - Show Past Papers */
.toggle-content.papers-section {
    display: block;
}

#answer-keys:target ~ .toggle-content.papers-section {
    display: none;
}

/* FIXED: Toggle Button Active States - CORRECT SELECTOR */
.toggle-btn[href="#past-papers"] {
    background: linear-gradient(135deg, var(--accent-primary), #ff8c42);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

/* When answer-keys is targeted, switch active button */
#answer-keys:target ~ .paper-hero .toggle-btn[href="#past-papers"] {
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
}

#answer-keys:target ~ .paper-hero .toggle-btn[href="#answer-keys"] {
    background: linear-gradient(135deg, var(--accent-primary), #ff8c42);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}
/* 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;
}
/* Hero Section with Correct Gradient (Same as HSSC) */
.paper-hero {
    padding: 80px 20px 60px;
    background: linear-gradient(135deg, 
        #0b0b0b 0%, 
        #151515 25%, 
        #1a0a00 50%, 
        #331100 75%, 
        #4a1a00 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--accent-primary);
}

.paper-hero .container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* 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;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, 
        var(--accent-primary) 0%, 
        #ff8c42 50%, 
        var(--accent-primary) 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 25px;
    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;
    position: relative;
    z-index: 2;
}

@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: 1.1rem;
}

.paper-hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 20px;
    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);
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

/* Level Toggle Container with Gradient (Same as HSSC) */
.level-toggle-container {
    position: relative;
    z-index: 2;
    margin-top: 30px;
    display: inline-block;
    background: linear-gradient(135deg, 
        rgba(24, 24, 24, 0.9) 0%, 
        rgba(40, 20, 0, 0.9) 100%);
    padding: 4px;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

/* Level Toggle */
.level-toggle {
    display: inline-flex;
    background: rgba(11, 11, 11, 0.7);
    padding: 6px;
    border-radius: 12px;
    gap: 6px;
    backdrop-filter: blur(10px);
}

.toggle-btn {
    padding: 14px 35px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.toggle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--accent-primary) 0%, 
        #ff8c42 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

/* FIXED: Active toggle button styling */
.toggle-btn[href="#past-papers"] {
    background: linear-gradient(135deg, var(--accent-primary), #ff8c42);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.toggle-btn:hover:not([href="#past-papers"]) {
    color: var(--accent-primary);
    background: rgba(249, 115, 22, 0.15);
    transform: translateY(-2px);
}

/* Subject Meta (SSC Specific - HSSC doesn't have this) */
.subject-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
    position: relative;
    z-index: 2;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    min-width: 160px;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.meta-item:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: rgba(249, 115, 22, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(249, 115, 22, 0.2);
}

.meta-item i {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

/* Subject Cards Section */
.subject-cards-section {
    padding: 60px 20px;
    background: var(--bg-secondary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.section-title i {
    color: var(--accent-primary);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Notes Grid (Same as HSSC) */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.subject-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--accent-primary) 0%, 
        #ff8c42 50%, 
        var(--accent-primary) 100%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.subject-card:hover::before {
    transform: translateX(0);
}

.subject-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(249, 115, 22, 0.15);
}

.subject-icon {
    width: 70px;
    height: 70px;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--accent-primary);
    font-size: 1.8rem;
    transition: all 0.3s ease;
}

.subject-card:hover .subject-icon {
    background: rgba(249, 115, 22, 0.2);
    transform: scale(1.1);
}

.subject-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.subject-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

.chapters-count {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
    background: rgba(249, 115, 22, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.subject-card:hover .chapters-count {
    background: rgba(249, 115, 22, 0.2);
    transform: scale(1.05);
}

/* Grade Buttons */
.grade-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.grade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
    border: 1px solid transparent;
}

.grade-btn.grade-ix {
    background: linear-gradient(135deg, var(--accent-primary), #ff8c42);
    color: white;
}

.grade-btn.grade-ix:hover {
    background: linear-gradient(135deg, #ff8c42, #ea580c);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.3);
}

.grade-btn.grade-xi {
    background: linear-gradient(135deg, var(--accent-primary), #ff8c42);
    color: white;
}

.grade-btn.grade-xi:hover {
    background: linear-gradient(135deg, #ff8c42, #ea580c);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.3);
}

.grade-btn.grade-x {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.grade-btn.grade-x:hover {
    background: rgba(249, 115, 22, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.1);
}

.grade-btn.grade-xii {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.grade-btn.grade-xii:hover {
    background: rgba(249, 115, 22, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.1);
}

.grade-btn i {
    font-size: 14px;
}

/* ============================================ */
/* 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;
}

/* FAQ Section (Same as HSSC) */
.notes-faq {
    padding: 80px 20px;
    background: var(--bg-secondary);
}

.notes-faq h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-primary);
    font-weight: 700;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.faq-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.1);
}

.faq-item h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(249, 115, 22, 0.2);
}

.faq-item p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 10px;
}

.faq-item ul {
    margin: 15px 0 15px 20px;
    list-style-type: none;
}

.faq-item ul li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 25px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-item ul li::before {
    content: "•";
    color: var(--accent-primary);
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -2px;
}

/* ============================================ */
/* 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;
}

/* ========== 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 DESIGN         */
/* ========================= */

@media (max-width: 992px) {
    .paper-hero h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .notes-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .demo-content h2,
    .notes-faq h2 {
        font-size: 2rem;
    }
    
    .faq-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .subject-meta {
        gap: 15px;
    }
    
    .meta-item {
        min-width: 140px;
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    /* Button adjustments for tablet */
    .hero-button {
        padding: 14px 28px;
        min-width: 200px;
        margin: 0 6px;
    }
    
    .demo-note {
        margin-top: 28px;
        font-size: 0.9rem;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .paper-hero {
        padding: 60px 15px 40px;
    }
    .breadcrumb {
        font-size: 0.75rem;
        gap: 5px;
        margin-bottom: 15px;
        padding: 0 15px;
    }
    .paper-hero h1 {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .toggle-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .subject-card {
        padding: 25px 20px;
    }
    
    .subject-cards-section,
    .coaching-banner,
    .notes-faq {
        padding: 60px 15px;
    }
    
    .demo-content {
        padding: 40px 25px;
    }
    
    .demo-content h2 {
        font-size: 1.8rem;
    }
    
    .demo-subtitle {
        font-size: 1.1rem;
    }
    
    .demo-description {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }
    
    /* 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;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .faq-item {
        padding: 25px 20px;
    }
    
    .faq-item h3 {
        font-size: 1.2rem;
    }
    
    .faq-item p {
        font-size: 0.95rem;
    }
    
    .grade-buttons {
        flex-direction: column;
    }
    
    .subject-meta {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .meta-item {
        width: 100%;
        max-width: 250px;
        justify-content: flex-start;
        min-width: auto;
    }
    
    /* Responsive Modal Styles */
    .popup-container {
        max-height: 85vh;
    }

    .popup-header {
        padding: 20px 25px;
    }

    .popup-header h2 {
        font-size: 1.3rem;
    }

    .popup-body {
        padding: 25px;
    }
}

@media (max-width: 576px) {
    .paper-hero h1 {
        font-size: 2rem;
    }
    
    .hero-badge {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
    
    .level-toggle-container {
        width: 100%;
        max-width: 320px;
    }
    
    .level-toggle {
        width: 100%;
    }
    
    .toggle-btn {
        width: 50%;
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .coaching-banner {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .demo-content {
        padding: 30px 20px;
    }
    
    .demo-content h2,
    .notes-faq h2 {
        font-size: 1.6rem;
    }
    
    .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;
    }
    
    .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;
    }
}

/* Small mobile (320px - 375px) */
@media (max-width: 375px) {
    .paper-hero h1 {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .toggle-btn {
        font-size: 0.9rem;
        padding: 10px 8px;
    }
    
    .toggle-btn i {
        font-size: 12px;
    }
    
    .subject-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .subject-card h3 {
        font-size: 1.2rem;
    }
    
    .subject-description {
        font-size: 0.85rem;
    }
    
    .grade-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .meta-item {
        font-size: 0.85rem;
        padding: 10px 15px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .subject-card:hover,
    .demo-button:hover,
    .faq-item:hover,
    .grade-btn:hover,
    .toggle-btn:hover,
    .hero-button:hover {
        transform: none;
    }
    
    .subject-card:active,
    .demo-button:active,
    .grade-btn:active,
    .hero-button:active {
        transform: scale(0.98);
    }
    
    .hero-button,
    .stat-item,
    .stand-out-card {
        min-height: 44px;
    }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    .subject-card,
    .demo-button,
    .faq-item,
    .grade-btn,
    .toggle-btn,
    .hero-button {
        transition: none;
    }
    
    .hero-badge {
        animation: none;
    }
    
    .subject-card:hover .subject-icon {
        transform: none;
    }
    
    .demo-button:hover,
    .subject-card:hover,
    .grade-btn:hover,
    .toggle-btn:hover,
    .hero-button:hover {
        transform: none;
    }
    
    .demo-button::before,
    .subject-card::before {
        display: none;
    }
    
    .mission-card:hover .card-icon,
    .vision-card:hover .card-icon,
    .stand-out-card:hover .stand-out-icon {
        transform: none;
    }
    
    .mission-card::before,
    .vision-card::before {
        display: none;
    }
}

