/* ================================================================
   ROOT VARIABLES & GLOBAL RESET
   ================================================================ */
:root {
    --navbar-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #eeeeee;
    --text-color: #333333;
    --primary-color: #d4af37;
    --nav-height: 60px;
    --bg-white: #ffffff; /* Explicit light background */
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --navbar-bg: #121212;
    --bg-white: #1a1a1a;
    --card-bg: #242424;
    --text-color: #e0e0e0;
    --border-color: #333333;
    --primary-color: #f1c40f; /* Slightly brighter gold for dark bg */
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

body {
    background-color: var(--bg-white);
    color: var(--text-color);
}

/* Top Announcement Bar */
.top {
    width: 100%;
    background-color: #ffff; /* Dark bar for contrast, remains same in light theme */
    color: var(--text-color);
    padding: 8px 0;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

/* ================================================================
   NAVBAR CORE STRUCTURE
   ================================================================ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background: var(--navbar-bg);
    height: var(--nav-height);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 2000;
}

#hamburger { display: none; cursor: pointer; color: var(--text-color); }
/* Logo Container */
.logo {
    height: 100%; /* Navbar ki height ke hisaab se */
    display: flex;
    align-items: center;
    max-width: 150px; /* Aap apni marzi se width set kar sakte hain */
}

/* Logo Image */
.nav-logo {
    height: 130px; /* Navbar height 60px hai, to 45px perfect lagega */
    width: auto;  /* Aspect ratio maintain rahega */
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

/* Hover effect (Optional) */
.nav-logo:hover {
    transform: scale(1.05);
}

/* Mobile View ke liye adjustment */
@media (max-width: 768px) {
    .nav-logo {
        height: 90px; /* Mobile par thoda chota */
    }
}
.top {
  background-color: var(--bg-color);
}
/* ================================================================
   DESKTOP VIEW SECTION
   ================================================================ */

.nav-links { display: flex; list-style: none; gap: 20px; }
.nav-links a { 
    text-decoration: none; 
    color: var(--text-color); 
    font-size: 15px; 
    font-weight: 500; 
    padding: 10px 15px;
}

.drop-down { position: relative; }
.dropdown-box { display: none; list-style: none; z-index: 3000; }
.dropdown-box.show { display: flex; animation: fadeIn 0.4s ease forwards; }

[data-theme="dark"] .dropdown-box { background: #1e1e1e !important;
    border-color: #444;}
    
[data-theme="dark"] .subject-link:hover, 
[data-theme="dark"] .notes-link:hover {
    background: #2a2a2a;
}

[data-theme="dark"] .color1:hover { background: #1a2633; }
[data-theme="dark"] .color2:hover { background: #2b2618; }
[data-theme="dark"] .color3:hover { background: #2d1a21; }
[data-theme="dark"] .color4:hover { background: #1b2d1c; }
[data-theme="dark"] .color5:hover { background: #251a2d; }
/* SUBJECT DROPDOWN */
.subject-dropdown {
    position: absolute;
    top: 60px;
    left: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary-color)!important;
    border-radius: 15px;
    min-width: 180px;
    flex-direction: column;
    padding: 10px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.subject-link {
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    border-left: 4px solid transparent;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.subject-link:active {
    transform: scale(0.96); 
    filter: brightness(0.9); 
}

.subject-link::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease-out, height 0.4s ease-out;
}

.subject-link:active::after {
    width: 200px;
    height: 200px;
    opacity: 0;
}
/* Subject Hover Colors - Strictly Light Palette */
.color1:hover { background: #f0f7ff; border-left-color: #2196f3; }
.color2:hover { background: #fffdf5; border-left-color: #ffc107; }
.color3:hover { background: #fff5f8; border-left-color: #e91e63; }
.color4:hover { background: #f7fff6; border-left-color: #4caf50; }
.color5:hover { background: #fbf5ff; border-left-color: #9c27b0; }

/* NOTES DROPDOWN */
.notes-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    background: #fafafa; 
    border: 1px solid #dddddd;
    border-top: 3px solid var(--primary-color)!important;
    border-radius: 15px; 
    min-width: 160px;
    flex-direction: column;
    padding: 12px 0;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.08);
}

.notes-link {
    padding: 10px 18px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.4s;
}
.notes-link:hover { background: #f8f9fa; color: var(--primary-color); }
.notes-link .material-symbols-outlined { font-size: 18px; color: #666; margin-right: 10px; transition: 0.4s;}
.notes-link:hover .material-symbols-outlined{
  color: var(--primary-color);
  transform: translateX(3px);
}

/* PROFILE SECTION */
.profile-sec { position: relative; height: 100%; display: flex; align-items: center; }
.profile-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.profile-avatar { 
    width: 25px; height: 25px; 
    background: var(--primary-color); 
    color: #fff; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; font-weight: bold; 
}

.profile-dropdown {
    position: absolute;
    top: 65px;
    right: 0; 
    background: #ffffff;
    border: 1.3px solid #ddd;
    border-top: 4px solid var(--primary-color)!important;
    border-radius: 15px;
    min-width: 140px ;
    flex-direction: column;
    padding: 5px 0;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.08);
}

.profile-link {
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 13px;
    display: flex;
    align-items: center !important;
    gap: 12px;
}
.profile-link:hover { background: #f9f9f9; color: var(--primary-color); }
.logout-text { color: #d9534f;}

/* Divider Line (HR) styling */
.dropdown-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 5px 0;
}
/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(10px); } }
.dropdown-box.hiding { animation: fadeOut 0.4s ease forwards; }

/* ================================================================
   MOBILE VIEW SECTION (Max-width: 768px)
   ================================================================ */
@media (max-width: 768px) {
    #hamburger { display: block; order: 1; }
    .logo { order: 2; }
    .profile-sec { order: 3; }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height); 
        left: 0; 
        width: 100%;
        background: var(--navbar-bg); /* Force light background */
        padding: 10px 20px;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
    }

    .nav-links.active { display: flex; }

    .subject-dropdown, .notes-dropdown { 
        position: static;      
        width: 50px; 
        background: #ffffff;   
        border: 1.3px solid var(--border-color);
   border-top: 4px solid var(--primary-color)!important;
        box-shadow: 5px 5px 15px rgba(0,0,0,0,0.8); 
        margin: 10px 15px;
        border-radius: 15px;
        padding: 5px 0;
    }
    
    .subject-link {
        padding: 15px;
        font-size: 15px; 
        border-bottom: 1px solid rgba(0,0,0,0.03);
    }
    
    /* NOTES DROPDOWN */
.notes-dropdown {
    position: static;
    top: var(--nav-height);
    left: 0;
    background: #fafafa; 
    border: 1px solid #dddddd;
    border-top: 3px solid var(--primary-color);
    border-radius: 15px; 
    min-width: 160px;
    flex-direction: column;
    padding: 12px 0;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.08);
}

.notes-link {
    padding: 10px 18px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.4s;
}
.notes-link:hover { background: #f8f9fa; color: var(--primary-color); }
.notes-link .material-symbols-outlined { font-size: 18px; color: #666; margin-right: 10px; transition: 0.4s;}

    #profileMenu.profile-dropdown {
        position: absolute;    
        top: 65px;
        right: 0;
        width: 120px !important;
        min-width: 120px;
        background: #ffffff;
        display: none;         
    }

    #profileMenu.profile-dropdown.show { display: flex; }
}

.guest-only, .user-only {
    display: none; /* Default hide, JS will show them */
    align-items: center;
}

/* --- HERO SECTION STYLES --- */
.hero-section {
    width: 100%;
    background: var(--card-bg);
    padding: 60px 0; /* Desktop par thoda zyada padding */
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    /* DESKTOP GAP: Text aur Image ke beech kafi jagah */
    gap: 100px; 
}

.hero-info { 
    flex: 1.2; 
    text-align: left; 
}

.level-tag {
    background: #d4af37;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 15px;
}

.hero-info h1 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 0 0 15px 0;
    line-height: 1.2;
}

.slogan {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 30px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Progress Bar */
.main-progress-wrapper {
    max-width: 400px;
    margin-bottom: 30px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

[data-theme="dark"] .progress-bar-bg { background: #333; }

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #f1c40f);
    width: 0%; /* Default 0, JS se update hoga */
    transition: width 1.5s cubic-bezier(0.1, 0.5, 0.5, 1);
}

.continue-btn {
    background: #2c3e50;
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.3s ease;
}

[data-theme="dark"] .continue-btn { background: #d4af37; }

.continue-btn:hover { 
    opacity: 0.9; 
    transform: translateX(8px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.hero-image { 
    flex: 0.8; 
    display: flex;
    justify-content: flex-end;
}

.hero-image img {
    width: 100%;
    max-width: 450px;
    height: auto;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.15));
}

.subjects-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 5%;
    
}
.section { background: var(--bg-color)}
.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--text-color);
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    background: var(--bg-color);
    border-radius: 10px;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

[data-theme="dark"] .subject-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

[data-theme="dark"] .subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
    background: #2d2d2d;
}

/* Icons styling */
.card-icon {
    width: 65px;
    height: 65px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 10px;
}

/* Specific Image Styling */
.subject-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Image ki ratio kharab nahi hogi */
}
.card-icon span { font-size: 30px; color: white; }

.color1-bg { background: hsla(197, 94%, 71%, 1); }
.color2-bg { background: hsla(43, 96%, 69%, 1); }
.color3-bg { background: hsla(337, 60%, 35%, 1); }
.color4-bg { background: hsla(96, 49%, 50%, 1); } /* Mint Green */
.color5-bg { background: hsla(49, 89%, 50%, 1); } /* Gold/Sand */

/* Card Info */
.card-info { flex-grow: 1; }
.card-info h3 { font-size: 1.1rem; margin-bottom: 5px; }
.card-info p { font-size: 0.85rem; opacity: 0.7; margin-bottom: 12px; }

.subject-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.subject-progress-wrapper span { font-size: 11px; font-weight: bold; width: 30px; }

.card-btn {
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: #d4af37;
    border: 1px solid #d4af37;
    padding: 6px 15px;
    border-radius: 6px;
    transition: 0.3s;
}

.card-btn:hover { background: #d4af37; color: white; }

/* Mobile View */
@media (max-width: 480px) {
    .subject-card { flex-direction: column; text-align: center; }
    .subject-progress-wrapper { justify-content: center; }
}

/* Glow effect on click */
#subjectMenu li a.clicked-active {
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: clickPop 0.6s ease-out;
}

@keyframes clickPop {
    0% { transform: scale(0.95); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Mobile Responsive */ @media (max-width: 768px) {

.hero-section {
padding: 30px 0;
}

.hero-container {
flex-direction: column-reverse;
text-align: center;
gap: 30px;
padding: 0 20px;
}

.hero-info {
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
}

/* MOBILE IMAGE: Thodi choti kardi */
.hero-image img {
 max-width: 200px;
 margin: O auto;
}

.hero-info h1 {
  font-size: 1.6rem;
}

.slogan {
font-size: 0.95rem;
}

.main-progress-wrapper {
  width: 100%;
}
}

/* Subject Grid - Desktop Logic */
.subject-grid {
  display: grid;
/* Desktop par 3 cards ek line mein, Tablet par 2, Mobile par 1 */
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
gap: 25px;
padding: 20px 0;
}

.subject-card {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 20px;
padding: 25px;
display: flex;
align-items: center;
gap: 20px;
transition: all 0.3s ease;
/* Desktop par card ki height maintain karne ke liye */
min-height: 140px;
}

/* Card image fix */
.subject-img {
width: 100%;
height: 100%;
object-fit: contain;
/* Agar image load na ho toh ye ensure karega ke box khali na dikhe */
display: block;
}

@media (min-width: 1024px) {
.subject-grid {
grid-template-columns:repeat(3, 1fr); /* Force 3 columns on large screens */
}
}

@media (max-width: 768px) {

.subject-grid {
grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
}
}

/* Theme Switcher Button */
.theme-switch {
    position: fixed; bottom: 20px; right: 20px;
    width: 50px; height: 50px; border-radius: 50%;
    background: none; color: var(--text-color);
    border: none; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 3000;
}
