:root {
    --primary: #818cf8; /* Pastel Indigo */
    --primary-glow: rgba(129, 140, 248, 0.2);
    --secondary: #f472b6; /* Pastel Pink */
    --bg-dark: #f8fafc; /* Very light slate */
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1e293b; /* Dark slate */
    --text-muted: #64748b; /* Muted slate */
    --accent-gold: #fbbf24;
    --glass-border: rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Background Effects */
.glow-bg {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(80px);
    pointer-events: none;
}

/* Header & Navigation */
header {
    padding: 1.5rem 0;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.8);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 15px var(--primary-glow);
}

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

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    text-align: center;
    background: url('hero.png') no-repeat center center;
    background-size: cover;
    border-radius: 40px;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.2), var(--bg-dark) 98%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--text-main), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Subject Grid */
.grid-title {
    margin-bottom: 2.5rem;
}

.grid-title h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.title-accent {
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
}

.subject-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.subject-card:hover {
    transform: translateY(-10px);
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card-content {
    position: relative;
    z-index: 1;
}

.subject-card .icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
    display: block;
    color: var(--primary);
    transition: all 0.4s ease;
}

.subject-card .icon svg {
    width: 100%;
    height: 100%;
}

.subject-card:hover .icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.subject-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.subject-card .arrow {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--primary);
}

.subject-card:hover .arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* Views Management */
.view {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Detail View */
.back-btn {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.detail-header {
    margin-bottom: 4rem;
}

.detail-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.detail-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
}

.resource-card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.resource-card:hover {
    border-color: var(--primary);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.resource-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.resource-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Resource Lists */
.resource-list {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    animation: fadeIn 0.4s ease-out;
}

.resource-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
    text-transform: uppercase;
}

.list-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-item {
    background: #ffffff;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.list-item:hover {
    background: #fdfdfd;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chapter-item {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
}

.chapter-item:hover .arrow {
    transform: translateX(5px);
    opacity: 1;
}

.list-item .muted {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.mcq-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.show-ans {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.show-ans:hover {
    opacity: 0.9;
}

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

/* Footer */
footer {
    padding: 3rem 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Responsiveness */
/* Loader */
.loader {
    text-align: center;
    padding: 2rem;
    font-weight: 600;
    color: var(--primary);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .hero h1 { font-size: 2.25rem; }
    .resource-grid { grid-template-columns: 1fr; }
    .hero { padding: 3rem 0; border-radius: 20px; }
    .detail-header h1 { font-size: 2rem; }
}
