@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 15px 30px -5px rgba(79, 70, 229, 0.15);
}

body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --primary-light: rgba(79, 70, 229, 0.15);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg-color); color: var(--text-color); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: 0.2s; }

/* HEADER */
.hs-top-bar { display: flex; justify-content: space-between; align-items: center; padding: 15px 5%; background: var(--card-bg); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow); }
.header-nav { display: flex; gap: 25px; margin-left: 40px; }
.nav-link { font-weight: 600; font-size: 15px; color: var(--text-muted); padding-bottom: 5px; border-bottom: 2px solid transparent; }
.nav-link:hover, .nav-link.active-cat { color: var(--primary); border-color: var(--primary); }

/* LAYOUT FIX (This fixes the shrinking issue) */
.dashboard-wrapper { display: flex; min-height: calc(100vh - 70px); width: 100%; }
.sidebar { width: 250px; background: var(--card-bg); border-right: 1px solid var(--border-color); padding: 25px 20px; flex-shrink: 0; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 12px 15px; margin-bottom: 8px; border-radius: 10px; font-weight: 600; color: var(--text-muted); transition: 0.2s; }
.side-link:hover, .side-link.active { background: var(--primary-light); color: var(--primary); }
.main-content { flex: 1; padding: 40px 0; width: 100%; overflow: hidden; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1150px; margin: 0 auto; padding: 0 25px; flex: 1; }

/* TYPOGRAPHY & GRIDS */
.flex-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.flex-header h2 { font-size: 1.6rem; font-weight: 800; color: var(--text-color); margin: 0; }

/* THE MAGIC GRID (Auto Responsive) */
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 30px; 
    width: 100%;
    align-items: stretch; 
}

/* BUTTONS */
.btn-primary, .hero-btn, .btn-switch, .btn-start { background: var(--primary); color: white; padding: 12px 25px; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; font-size: 14px; }
.btn-primary:hover, .hero-btn:hover, .btn-start:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3); }
.btn-switch { background: var(--card-bg); color: var(--text-color); border: 1px solid var(--border-color); box-shadow: var(--shadow); }
.btn-switch:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle-btn { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; margin-right: 15px; }

/* PREMIUM CARDS & HOVER */
.img-card { 
    position: relative; 
    background: var(--card-bg); 
    border-radius: 16px; 
    border: 1px solid var(--border-color); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: var(--shadow); 
    height: 100%; 
}
.img-card:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--shadow-float); 
    border-color: var(--primary); 
}
.card-thumb-wrapper { 
    height: 170px; 
    background: var(--bg-color); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-bottom: 1px solid var(--border-color); 
    overflow: hidden; 
    position: relative; 
}
.card-thumb-img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    padding: 15px; 
    transition: transform 0.4s ease; 
}
.img-card:hover .card-thumb-img { 
    transform: scale(1.1); 
} 
.card-thumb-fallback { 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(135deg, var(--primary), #818cf8); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    font-size: 45px; 
}
.img-card-body { 
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    flex: 1; 
}
.img-card-body h2 { 
    font-size: 1.25rem; 
    font-weight: 800; 
    margin-bottom: 15px; 
    line-height: 1.4; 
    color: var(--text-color); 
}
.card-link-new { 
    font-size: 14px; 
    font-weight: 700; 
    color: var(--primary); 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    margin-top: auto; 
}

/* BADGES */
.premium-badge { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 6px; z-index: 10; box-shadow: 0 4px 10px rgba(0,0,0,0.15); letter-spacing: 0.5px; text-transform: uppercase; }
.badge-locked { background: #fbbf24; color: #000; }
.badge-unlocked { background: #10b981; color: #fff; }

/* HERO SECTION */
.hero-section { text-align: center; padding: 80px 20px; background: linear-gradient(135deg, var(--bg-color) 0%, var(--card-bg) 100%); border-bottom: 1px solid var(--border-color); }
.hero-content h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 20px; letter-spacing: -1px; }
.hero-content p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 30px; }

/* MOBILE RESPONSIVE TWEAKS */
@media (max-width: 768px) {
    .dashboard-wrapper { flex-direction: column; }
    .sidebar { width: 100%; display: flex; overflow-x: auto; padding: 15px; border-right: none; border-bottom: 1px solid var(--border-color); }
    .side-link { white-space: nowrap; margin-bottom: 0; margin-right: 10px; }
    .header-nav { display: none; }
    .hero-content h1 { font-size: 2.5rem; }
    .grid { grid-template-columns: 1fr; } /* Mobile par 1 ke niche 1 aayega */
    .container { padding: 0 15px; }
}