:root {
    --physics-primary: #3b82f6;
    --chemistry-primary: #a855f7;
    --biology-primary: #22c55e;
    --earth-science-primary: #f97316;
    --gk-maths-primary: #6366f1;
}

.theory-container {
    padding-top: 160px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 2rem;
}

.theory-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.theory-hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: white;
}

.theory-hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

.back-prep-btn, .back-theory-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.back-prep-btn:hover, .back-theory-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.theory-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 3rem;
}

.theory-card {
    background: rgba(13, 15, 26, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    flex: 1 1 320px;
    max-width: 350px;
}

.theory-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(13, 15, 26, 1), transparent);
}

.card-content {
    padding: 2.5rem;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content h2, .card-content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.card-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.card-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
}

/* Physics Theme */
.card-physics h2, .card-physics h3, .physics-theme h1 { color: var(--physics-primary); }
.card-physics .card-btn, .physics-theme .back-theory-btn {
    background: rgba(59, 130, 246, 0.2);
    color: var(--physics-primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.card-physics .card-btn:hover, .physics-theme .back-theory-btn:hover {
    background: var(--physics-primary);
    color: white;
}

/* Chemistry Theme */
.card-chemistry h2, .card-chemistry h3 { color: var(--chemistry-primary); }
.card-chemistry .card-btn {
    background: rgba(168, 85, 247, 0.2);
    color: var(--chemistry-primary);
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.card-chemistry .card-btn:hover {
    background: var(--chemistry-primary);
    color: white;
}

/* Biology Theme */
.card-biology h2, .card-biology h3 { color: var(--biology-primary); }
.card-biology .card-btn {
    background: rgba(34, 197, 94, 0.2);
    color: var(--biology-primary);
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.card-biology .card-btn:hover {
    background: var(--biology-primary);
    color: white;
}

/* Earth Science Theme */
.card-earth-science h2, .card-earth-science h3 { color: var(--earth-science-primary); }
.card-earth-science .card-btn {
    background: rgba(249, 115, 22, 0.2);
    color: var(--earth-science-primary);
    border: 1px solid rgba(249, 115, 22, 0.3);
}
.card-earth-science .card-btn:hover {
    background: var(--earth-science-primary);
    color: white;
}

/* GK Maths Theme */
.card-gk-maths h2, .card-gk-maths h3 { color: var(--gk-maths-primary); }
.card-gk-maths .card-btn {
    background: rgba(99, 102, 241, 0.2);
    color: var(--gk-maths-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
}
.card-gk-maths .card-btn:hover {
    background: var(--gk-maths-primary);
    color: white;
}

/* Topic List (Vertical Cards) */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.topic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: white;
    text-decoration: none;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.topic-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.topic-item:hover::before {
    transform: translateX(100%);
}

.topic-item:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.2);
}

.topic-item h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

.topic-item:hover h3 {
    background: linear-gradient(135deg, #fff 0%, var(--physics-primary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topic-arrow {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.topic-item:hover .topic-arrow {
    background: var(--physics-primary);
    color: white;
    transform: rotate(-45deg) scale(1.1);
}

/* Notes & Content Pages */
.content-card {
    background: rgba(13, 15, 26, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 2.5rem;
    margin-top: 1.5rem;
    color: #e2e8f0;
    line-height: 1.8;
}

.notes-section {
    margin-bottom: 2.5rem;
    padding: 0 !important;
}

.notes-section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.notes-section p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.notes-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    overflow: hidden;
}

.notes-table th, .notes-table td {
    padding: 0.8rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.notes-table th {
    background: rgba(59, 130, 246, 0.15);
    color: var(--physics-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.notes-table tr:last-child td {
    border-bottom: none;
}

.notes-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.callout-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 2rem;
    margin-top: 1.5rem;
    position: relative;
}

.callout-box h3 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0;
    color: #ffd700;
}

.math-highlight {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    color: var(--physics-primary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .theory-container { 
        padding-top: 60px;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 3rem;
    }
    .theory-hero h1 { font-size: 2.2rem; }
    .theory-hero p { font-size: 1rem; }
    
    .theory-grid { 
        justify-content: center;
        gap: 1.5rem;
    }
    .theory-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .topic-item { 
        padding: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .topic-item h3 { font-size: 1.3rem; }
    .topic-arrow { align-self: flex-end; }
    
    .content-card { 
        padding: 1.2rem;
        border-radius: 20px;
    }
    
    .notes-section h2 { font-size: 1.6rem; }
    .notes-section p { font-size: 1rem; }
    
    .notes-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        margin: 1.5rem 0;
    }
    
    .notes-table th, .notes-table td {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
    
    .callout-box {
        padding: 1.5rem;
    }
    
    .dynamic-island {
        padding: 0.6rem 1.5rem;
        gap: 1.5rem;
        width: 90%;
    }
}
