/* 1. ROOT VARIABLES - The DNA of AcademiaFlow */
:root {
    /* Color Palette - Professional & Calm */
    --primary: #4f46e5;       /* Modern Indigo */
    --primary-light: #eef2ff;
    --accent-chem: #10b981;    /* Science Green */
    --accent-math: #f59e0b;    /* Logic Orange */
    --accent-teacher: #8b5cf6; /* Admin Purple */
    --urgent: #ef4444;        /* Alert Red */
    
    /* Neutral Tones for UI Depth */
    --bg-main: #f8fafc;       /* Soft White/Grey background */
    --bg-card: #ffffff;
    --text-main: #1e293b;     /* Deep Slate */
    --text-muted: #64748b;    /* Soft Slate */
    --border: #e2e8f0;
    
    /* Design Tokens */
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout Dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;
    --topbar-height: 70px;}

/* 2. SYSTEM RESET - The "Ground Leveling" */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--topbar-height) + 3rem);
    font-size: 16px; /* Base for REM units */}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden; }

ul { list-style: none; }
a { text-navigation: none; color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* 3. MAIN LAYOUT FRAME */
.app-wrap {
    display: flex; /* Sidebar on left, Content on right */
    min-height: 100vh;
    width: 100%;}

.main-content {
    flex: 1;
    /* Remove fixed margin-left, we will handle this with the app-wrap */
    margin-left: var(--sidebar-width); 
    padding: 1.5rem;
    /* Adjust padding-top to match topbar height exactly */
    padding-top: calc(var(--topbar-height) ); 
    transition: var(--transition);
    min-width: 0; /* Prevents content from overflowing and breaking flex */}

/* Tablet/Mobile: Remove the margin entirely so content takes full width */
@media (max-width: 1024px) {
	.sidebar.collapsed ~ .main-content,
    .sidebar.collapsed ~ .topbar {
        margin-left: 0;
        left: 0;  }
    .main-content {
        margin-left: 0; 
        margin-top:calc(var(--topbar-height) + 1rem);   }}
        
/* Responsive adjustment: When sidebar collapses, content moves left */
.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed);}

/* 4. THE OVERLAY (For Mobile UX) */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99; /* Below sidebar, above content */
    display: none; /* Hidden by default */}

/* --- 5. SIDEBAR BASE --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background-color: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column; /* Stacks Header, Content, Footer */
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
    box-shadow: 4px 0 10px rgba(0,0,0,0.02);}

/* --- 6. FIXED HEADER --- */
.sidebar-header {
    flex-shrink: 0; /* Prevents header from squishing */
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #fff;
    z-index: 10;}

/* Responsive Logo Scaling */
.sidebar-logo img {
    /* Adjusts based on height: Min 24px, Max 32px */
    width: clamp(30px, 4vh, 55px);
    height: auto;}

/* --- 7. SCROLLABLE CONTENT --- */
.sidebar-content {
    flex: 1; /* Takes up all remaining space */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 0.75rem;
    scrollbar-width: thin; /* Clean scrollbar for Firefox */
    scrollbar-color: var(--border) transparent;}

/* Custom Scrollbar for Chrome/Safari */
.sidebar-content::-webkit-scrollbar {
    width: 5px;}
.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;}

/* --- 8. FIXED FOOTER --- */
.sidebar-footer {
    flex-shrink: 0; /* Prevents footer from squishing */
    padding: 1rem 0.75rem;
    margin-bottom: 1rem;
    border-top: 1px solid var(--border);}

/* Targets navigation links specifically inside the footer area */
.sidebar-footer .nav-group a {
    font-size: 0.9rem;
    background: transparent;
    border: 1px solid transparent;}

/* Unique feature: The last link (Logout) gets a subtle warning tint */
.sidebar-footer .nav-group a:last-child {
    margin-bottom: 1.5rem;
    color: #e11d48; /* Modern Rose/Red */
    background-color: rgba(225, 29, 72, 0.03);}

.sidebar-footer .nav-group a:last-child:hover {
    background-color: rgba(225, 29, 72, 0.1);
    border-color: rgba(225, 29, 72, 0.2);}

/* --- 9. ICON SCALING & NAVIGATION --- */
.nav-link .icon {
    /* Responsive Icon Size: Min 18px, Max 22px */
    width: clamp(18px, 2.5vh, 22px);
    height: clamp(18px, 2.5vh, 22px);
    stroke-width: 2;
    transition: transform 0.2s ease;}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);}

/* Active State UX: High Contrast for visibility */
.nav-link.active {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);}

.nav-link.active .icon {
    stroke: #ffffff;
    transform: scale(1.1); /* Subtle "Pop" for the active icon */}

/* Specific styling for labels within grouped sections */
.nav-group + .nav-group > .nav-label {
    color: var(--primary); /* Makes subsequent headers pop slightly more */
    opacity: 0.9;}   

/* Soft Logout */
.nav-link.logout:hover {
    background-color: #fff1f2;
    color: #e11d48;}

/* --- UPDATED COLLAPSED LOGIC --- */

/* 1. Sidebar Width Change */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);}

/* 2. Main Content Expansion (DESKTOP) */
/* The '~' selector finds .main-content even if Topbar is in the middle */
.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);}

/* 3. Topbar Adjustment (DESKTOP) */
.sidebar.collapsed ~ .topbar {
    left: var(--sidebar-collapsed);}

/* 4. Element Hiding */
.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .link-text,
.sidebar.collapsed .user-info {
    display: none;
    opacity: 0;}

/* 5. Icon Centering */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.8rem 0;
    gap: 0;}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 0;}

.sidebar.collapsed #collapse-sidebar svg {
    transform: rotate(180deg);}
   
.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
    transition: opacity 0.2s ease;} 

/* --- 10. MOBILE REFINEMENT --- */
@media (max-width: 1024px) {
    .sidebar {
        /* FIXED: No gap at top, starts right under topbar */
        top: calc(var(--topbar-height) + 3rem); 
        height: calc(100vh - var(--topbar-height));
        width: min(280px, 80%) !important; 
        transform: translateX(-100%);
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);}
    .sidebar.mobile-active {
        transform: translateX(0);
        box-shadow: 15px 0 40px rgba(0,0,0,0.1);    }
       /* Ensure the main content doesn't move when sidebar slides OVER it */
    .sidebar ~ .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        transition: filter 0.3s ease;    }
        /* Optimize the internal spacing for touch (Fingers need more room) */
    .sidebar-content {
        padding: 1rem 0.5rem;}
    .nav-link {
        padding: 1rem 1.25rem; /* Larger touch target */
        margin-bottom: 0.5rem; }
    /* Blur logic for body */
    body:has(.sidebar.mobile-active) .main-content {
        filter: brightness(0.8) blur(2px);
        pointer-events: none;}
        /* Hide desktop-specific toggle */
    #collapse-sidebar {
        display: none;   }}

/* Specific styling for groupings in content */
.nav-group + .nav-group {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);}



/*Topbar design*/
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    /* Use ~ selector if Topbar is NOT immediately after sidebar */
    left: var(--sidebar-width); 
    min-height: var(--topbar-height);
    background: var(--bg-card); /* Solid white for maximum contrast */
    box-shadow: var(--shadow-md); /* Stronger shadow to stand out */
    border-bottom: none; /* Remove border, rely on shadow */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1000;
    transition: var(--transition);}
    
/* --- TOPBAR LEFT ALIGNMENT --- */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    height: 100%;}

/* --- THE SHIMMERING AI BADGE --- */
.ai-badge {
    background: linear-gradient(90deg, #4285f4, #9b72cb, #d96570, #4285f4);
    background-size: 300% 100%;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.2);
    transition: var(--transition);}

.ai-badge.shimmering:hover {
    animation: shimmerMove 2s linear infinite;
    transform: scale(1.05);}

@keyframes shimmerMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }}

/* --- BREADCRUMBS & TITLE --- */
.breadcrumb-nav {
    display: flex;
    align-items: center;}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;}

.breadcrumb-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);}

.breadcrumb-link:hover {
    color: var(--primary);}

.separator {
    margin: 0 8px;
    opacity: 0.4;}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin: 0;}

/* Container styling */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    background: transparent; /* Keep it clean */
}

.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 8px;
}

/* Link Styling */
.breadcrumb-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #4f46e5; /* Primary brand color */
}

/* Separator */
.separator {
    color: #cbd5e1;
    margin: 0 4px;
    display: block;
}

/* Active Title Styling */
.page-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* THE ALIVE ANIMATION */
.fade-text {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.fade-text.changing {
    opacity: 0;
    transform: translateY(5px);
}


/* --- MOBILE MENU BUTTON --- */
.menu-toggle {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);}

.menu-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);}

/* Responsive Logic */
.mobile-only { display: none; }


/* --- RIGHT SECTION LAYOUT --- */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;}

.utility-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;}

/* --- THE STANDOUT CREATE BUTTON --- */
.quick-add-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);}

.quick-add-btn .btn-content {
    display: flex;
    align-items: center;
    gap: 8px;}

.quick-add-btn:hover {
    background: #4338ca; /* Darker Indigo */
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.35);}



/* --- PROFILE TRIGGER STYLING --- */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 1.5px solid var(--border);
    padding: 4px 12px 4px 4px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);}

.profile-trigger:hover {
    border-color: var(--primary);
    background: var(--bg-card);}

.avatar-container {
    position: relative;
    width: 34px;
    height: 34px;}

.avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;}

.status-indicator.online {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    background: var(--accent-chem); /* Green */
    border: 2px solid var(--bg-card);
    border-radius: 50%;}

.user-meta {
    display: flex;
    align-items: center;
    gap: 6px;}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);}

  
/* --- CENTER SECTION LAYOUT --- */
.topbar-center {
    flex: 1;
    max-width: 720px; /* Slightly wider for better command input */
    margin: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;}

/* --- 1. THE SEARCH CONTAINER --- */
.topbar .command-palette {
    flex: 1;
    max-width: 500px; /* Prevents it from stretching too wide on massive screens */
    margin: 0 1rem;
    transition: var(--transition);}

.topbar .search-inner {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-main); /* Light gray or slightly darker than topbar */
    border: 1px solid var(--border);
    border-radius: 12px; /* Smooth modern corners */
    padding: 0 12px;
    height: 42px; /* Aligned with topbar height */
    transition: all 0.2s ease;}

/* Focus State: "Lift" the search bar */
.topbar .search-inner:focus-within {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);}

/* --- 2. PREFIX & INPUT --- */
.topbar .search-prefix {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 14px;
    margin-right: 10px;
    flex-shrink: 0;}

.topbar .search-inner input {
    border: none !important;
    background: transparent !important;
    width: 100%;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;}

/* --- 3. KEYBOARD HINTS (KBD) --- */
.topbar .search-suffix {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
    opacity: 0.6; /* Keeps it subtle */}

.topbar .kbd-pill {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: inherit;}

/* --- 4. MOBILE SPECIFIC (The "Second Row" Reveal) --- */
@media (max-width: 1024px) {
    .topbar .topbar-center {
        display: flex;
        flex-direction: row; /* Role and Search side by side */
        align-items: center;
        width: 100%;
        gap: 8px;    }
    /* Keep Search hidden until active */
    .topbar .command-palette {
        display: none;
        margin: 0;
        max-width: none;    }
    .topbar-center.is-active .command-palette {
        display: block;
        flex: 1; /* Takes space away from Role when open */    }
    .topbar-center.is-active .role-badge-container {
        flex: 0 0 auto; /* Role shrinks to make room for Search */  }
    .topbar .search-inner {
        height: 48px; /* Larger hit area for thumbs */   }}


/* --- ROLE SELECTOR (The Pill Design) --- */
.role-select-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 0 0.75rem;
    border-radius: 50px;
    height: 36px;
    transition: var(--transition);}

.role-select-wrapper:hover {
    border-color: var(--primary);}

.role-icon {
    color: var(--primary);
    margin-right: 6px;}

.role-select-styled {
    background: transparent;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    height: 40hv;
    outline: none;
    padding-right: 4px;}

/* Container for absolute positioning */
.dropdown-wrapper, .user-profile-section {
    position: relative;}

/* The actual menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;}

/* Show class toggled by JS */
.dropdown-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);}

.menu-user-info {
    padding: 10px;
    display: flex;
    flex-direction: column;}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;}

.menu-list li a {
    display: block;
    padding: 10px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.85rem;}

.menu-list li a:hover {
    background: var(--primary-light);
    color: var(--primary);}

@media (max-width: 1024px) {
    .topbar {
        left: 0 !important;
        height: auto;
        padding: 0.8rem 1rem;
        gap: 0.5rem;    }
    /* TOP ROW POSITIONING */
    .topbar .topbar-left { order: 1; flex: 1; }
    .topbar .topbar-right { order: 2; flex: 0 0 auto; }
    /* BOTTOM ROW: The Container */
    .topbar .topbar-center {
        order: 3;
        flex: 1 0 100%;
        display: flex;
        flex-direction: column; /* Stacked for better mobile spacing */
        align-items: center; 
        gap: 10px;
        position: static;
        background: transparent;    }
    /* THE SEARCH BAR: Hidden by default */
    .topbar .command-palette-wrapper {
        display: none; /* Removed !important so we can toggle it */
        width: 100%;
        order: 1;    }
    /* SHOW SEARCH: When .is-active is added via JS */
    .topbar .topbar-center.is-active .command-palette-wrapper {
        display: block;
        animation: fadeInDown 0.3s ease;    }
    /* THE ROLE SELECTOR: Centered */
    .topbar .role-badge-container {
        order: 2;
        width: auto;
        margin: 0 auto; /* This centers the role switcher */
        display: flex;
        justify-content: center;    }
    .topbar .role-select-wrapper {
        height: 40px;
        min-width: 140px;
        justify-content: center;    }
    /* INPUT STYLING */
    .topbar .input-group {
        width: 100%; /* Full width for easier typing */
        height: 48px;
        background: var(--bg-main); }
    /* ICONS & UTILITIES */
    .mobile-only { display: flex !important; }
    .desktop-only { display: none !important; }
    .topbar .quick-add-btn, 
    .topbar .mobile-search-toggle {
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;    }}

/* Optional: Smooth entry animation */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }}


/* --- Search Results Dropdown --- */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

/* Categories in Search */
.search-category-header {
    padding: 8px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.05em;
    background: #f8fafc;
    margin-top: 4px;
}
.search-category-header:first-child { margin-top: 0; }

/* Result Item */
.result-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.result-item:hover, .result-item.selected {
    background: #f1f5f9;
    border-left-color: #4f46e5;
}
.result-icon {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}
.result-info { flex: 1; }
.result-title { font-weight: 500; color: #1e293b; font-size: 0.95rem; }
.result-sub { font-size: 0.8rem; color: #64748b; }
.result-meta { font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; background: #e0e7ff; color: #4338ca; }

/* --- Mobile vs Desktop Logic --- */
/* Hide search container on mobile by default */

/* 13. OVERVIEW HERO SECTION */
.overview-hero {
    display: grid;
    grid-template-columns: 1fr 350px; /* Two columns: Greeting and Recommendation */
    gap: 1.5rem;
    margin-bottom: 2rem;}

.hero-main {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);}

.current-date {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;}

.welcome-text {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;}

.status-summary {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 400px;}

/* 14. CIRCULAR PROGRESS UX */
.hero-stats {
    width: 120px;
    height: 120px;}

.circular-chart {
    display: block;
    margin: 10px auto;
    max-width: 100%;
    max-height: 100%;}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 3.8;}

.circle {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3.8;
    stroke-linecap: round;
    transition: var(--transition);}

.percentage {
    fill: #ffffff;
    font-family: sans-serif;
    font-size: 0.55rem;
    font-weight: 700;
    text-anchor: middle;}

/* 15. SMART RECOMMENDATION CARD */
.recommendation-card {
    background: var(--bg-card);
    border: 2px border var(--primary-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--accent-math); /* Color-coded priority */}

.rec-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: grid;
    place-items: center;}

.rec-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);}

.rec-text {
    font-weight: 600;
    color: var(--text-main);}

.btn-primary-sm {
    background: var(--primary);
    color: white;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition);
    text-align: center;}

.btn-primary-sm:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);}
    
/* Animation for the Wave Emoji */
@keyframes wave-animation {
  0% { transform: rotate(0deg); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
  60% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }}

.wave {
  display: inline-block;
  animation: wave-animation 2.5s infinite;
  transform-origin: 70% 70%;}

/* Smooth transition for the circle stroke */
.circular-chart .circle {
  transition: stroke-dasharray 0.3s ease, stroke 0.5s ease;
  transform: rotate(0deg); /* Start from top */
  transform-origin: center;}

/* Make the button hover feel "clickable" */
.btn-primary-sm {
  transition: all 0.2s ease;}
.btn-primary-sm:active {
  transform: scale(0.95);}
  
  
/* --- Skeleton Loading Animation --- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    color: transparent !important;
    border-radius: 4px;
    user-select: none;}
.skeleton * { visibility: hidden; } /* Hide children icons while loading */

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }}

/* --- Weather & Greeting Tweaks --- */
.greeting-content h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;}
    
.weather-badge {
    font-size: 0.8em;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 400;
    margin-left: 10px;}

/* 16. HERO RESPONSIVENESS */
@media (max-width: 1100px) {
    .overview-hero {
        grid-template-columns: 1fr; /* Stack greeting on top of recommendation */}}

@media (max-width: 600px) {
    .hero-main {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;  }
    .welcome-text { font-size: 1.5rem; }}


/* 17. TASK CONTAINER BASE */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;}

.task-container {   padding: 1.5rem;}

/* 18. TASK HEADER & FILTERS */
.task-header {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;}

.task-filters {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-main);
    padding: 0.25rem;
    border-radius: var(--radius-md);}

.filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
    transition: var(--transition);}

.filter-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);}

/* 19. STAT PILLS */
.task-stats-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;}

.stat-pill {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: var(--bg-main);
    color: var(--text-muted);
    border: 1px solid var(--border);}

.stat-pill.urgent { border-color: #fca5a5; color: var(--urgent); }
.stat-pill.overdue { background: #fee2e2; color: var(--urgent); font-weight: 700; }

/* 20. TASK CARDS */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;}

.task-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;}

.task-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);}

/* The Color Accents */
.task-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;}
.task-accent.biology { background: var(--accent-chem); }
.task-accent.math { background: var(--accent-math); }
.task-accent.teacher { background: var(--accent-teacher); }

.task-body {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;}

/* Custom Checkbox UX */
.task-checkbox-wrapper {
    position: relative;
    cursor: pointer;
    display: block;
    width: 22px;
    height: 22px;}

.task-checkbox-wrapper input {
    opacity: 0;
    position: absolute;}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: white;
    border: 2px solid var(--border);
    border-radius: 6px;
    transition: var(--transition);}

.task-checkbox-wrapper:hover input ~ .checkmark {
    border-color: var(--primary);}

.task-checkbox-wrapper input:checked ~ .checkmark {
    background-color: var(--accent-chem);
    border-color: var(--accent-chem);}

.task-checkbox-wrapper input:checked ~ .checkmark:after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);}

/* Task Info & Tags */
.task-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;}

.task-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: var(--transition);}

.task-checkbox-wrapper input:checked + .checkmark + .task-info .task-title {
    text-decoration: line-through;
    opacity: 0.5;}

.task-metadata {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;}

.tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-main);}

.priority-high { color: var(--urgent); background: #fee2e2; }

/* 21. FOOTER */
.task-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;}

.btn-add-task {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;}
    
/* 22. DEADLINES CONTAINER */
.deadlines-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;}

.deadline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;}

.badge-count {
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 700;}

/* 23. THE DATE BOX (Calendar Leaf) */
.deadline-item {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: 1px solid transparent;}

.deadline-item:hover {
    background: var(--bg-main);
    border-color: var(--border);}

.date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 65px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;}

.date-box .month {
    background: var(--text-main);
    color: white;
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 0;}

.date-box .day {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);}

.date-box.critical {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;}

.date-box.upcoming {
    background: #ffedd5;
    color: #f97316;
    border: 1px solid #fed7aa;}

.date-box.safe {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;}    

.urgent .date-box .month { background: var(--urgent); }

/* 24. DEADLINE DETAILS & PROGRESS */
.deadline-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;}

.details-top {
    display: flex;
    justify-content: space-between;
    align-items: center;}

.subject-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;}

.subject-tag.chemistry { color: var(--accent-chem); }
.subject-tag.masters { color: var(--accent-teacher); }
.subject-tag.grading { color: var(--accent-math); }

.countdown-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);}

.countdown-text.urgent { color: var(--urgent); }

.deadline-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);}

/* Progress Bar UX */
.progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.25rem;}

.progress-mini-bar {
    flex: 1;
    background: var(--border);
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);}
    
.progress-percent {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;}

/* 25. FOOTER ACTIONS */
.card-footer {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);}

.btn-secondary {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;}

.btn-add-deadline {
    flex: 1;
    background: var(--text-main);
    color: white;
    padding: 0.6rem;
    border-radius: var(--radius-md);
    font-weight: 600;}


/* Responsive Tweak */
@media (max-width: 500px) {
    .deadline-item { flex-direction: column; gap: 0.75rem; }
    .date-box { flex-direction: row; width: 100%; height: auto; gap: 10px; justify-content: flex-start; padding: 5px 15px; }
    .date-box .month { width: auto; background: transparent; color: var(--text-muted); padding: 0; }
    .urgent .date-box .month { color: var(--urgent); }}


/* 26. PERFORMANCE CONTAINER & GRID */
.performance-container {
    padding: 1.5rem;}

.performance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;}

.performance-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;}

/* 27. METRIC CARDS */
.metric-card {
    padding: 1.25rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    transition: var(--transition);}

.metric-card:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;}

.metric-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;}

.metric-trend {
    font-size: 0.75rem;
    font-weight: 600;}

.metric-trend.positive { color: var(--accent-chem); }
.metric-trend.negative { color: var(--urgent); }

/* 28. VISUAL PROGRESS (Bars) */
.visual-progress {
    margin-top: auto;}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;}

.progress-fill.biology-fill { background: var(--accent-chem); }
.progress-fill.masters-fill { background: var(--accent-teacher); }
.progress-fill.teacher-fill { background: var(--primary); }

.progress-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    min-width: 35px;}

/* 29. FOCUS METRIC (Big Numbers) */
.focus-metric {
    background: var(--primary);
    color: white;
    border: none;}
.focus-metric .metric-label, 
.focus-metric .goal-track { color: rgba(255, 255, 255, 0.8); }

.metric-header-sm {
    display: flex;
    justify-content: space-between;
    align-items: center;}

.metric-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.5rem 0;}

.big-number {
    font-size: 2.25rem;
    font-weight: 800;}

.unit {
    font-size: 0.9rem;
    opacity: 0.8;}

.goal-track {
    font-size: 0.75rem;
    font-weight: 500;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);}

/* 30. PERFORMANCE FOOTER */
.performance-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;}

.btn-outline {
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);}

.btn-outline:hover { background: var(--bg-main); }

.full-report-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);}
    
    
    /* 31. GOALS LAYOUT FRAME */
.goals-management {
    padding: 1.5rem;}

.goals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-chem);
    background: var(--primary-light);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;}

.dot-pulse {
    width: 8px;
    height: 8px;
    background-color: var(--accent-chem);
    border-radius: 50%;
    animation: pulse 2s infinite;}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }}


/* 32. THE FORM AREA */
.goals-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* Form is slightly wider */
    gap: 2rem;}

.goals-entry-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;}

.input-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;}

.input-group input, 
.input-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    font-size: 0.9rem;
    transition: var(--transition);}

.input-group input:focus, 
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);}

.input-hint {
    font-size: 0.7rem;
    color: var(--text-muted);}

.target-date {
    width: fit-content;
    margin-top: 0.5rem;}

/* 33. THE VISION DISPLAY CARD */
.vision-display-card {
    background: #1e293b; /* Deep slate professional look */
    border-radius: var(--radius-lg);
    position: relative;
    padding: 2rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    min-height: 250px;}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(79, 70, 229, 0.2), transparent);
    pointer-events: none;}

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

.quote-icon {
    font-size: 4rem;
    font-family: serif;
    line-height: 0;
    display: block;
    margin-bottom: 1.5rem;
    opacity: 0.3;}

#display-ambition {
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 2rem;}

.target-countdown {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    display: inline-block;}

/* Vision Card Styling */
.vision-display-card {
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 250px;
    transition: transform 0.3s ease;}

.vision-display-card:hover {
    transform: translateY(-5px);}

/* Abstract shapes overlay */
.card-overlay {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;}

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

.vision-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;}

.vision-tag {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;}

.quote-icon {
    font-size: 4rem;
    line-height: 1;
    opacity: 0.3;
    font-family: serif;}

#display-target {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;}

#display-ambition {
    font-size: 1rem;
    opacity: 0.9;
    font-style: italic;
    margin-bottom: 2rem;
    line-height: 1.5;}

.target-countdown {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 1rem;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 120px;}

.countdown-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;}

.countdown-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;}

/* Pulse animation for header */
.dot-pulse {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: pulse 2s infinite;}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }}



/* 34. FORM ACTIONS */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;}

.btn-submit-goals {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: var(--transition);}

.btn-submit-goals:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);}

/* RESPONSIVE */
@media (max-width: 900px) {
    .goals-layout { grid-template-columns: 1fr; }
    .vision-display-card { min-height: 200px; }}


/* 35. SUBJECTS GRID & CONTAINER */
.subjects-container {
    padding: 1.5rem;}

.subjects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;}

/* 36. SUBJECT CARDS */
.subject-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);}

.subject-card:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);}

/* Subject Icons - High Recognition UX */
.subject-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);}

/* Subject-Specific Accents */
.subject-card[data-subject="chemistry"] { border-top: 3px solid var(--accent-chem); }
.subject-card[data-subject="physics"] { border-top: 3px solid var(--accent-math); }
.subject-card[data-subject="research"] { border-top: 3px solid var(--accent-teacher); }
.subject-card[data-subject="admin"] { border-top: 3px solid var(--primary); }

.subject-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;}

/* 37. QUICK LINKS (Chip Style) */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;}

.resource-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0,0,0,0.04);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    transition: var(--transition);
    border: 1px solid transparent;}

.resource-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);}

/* External Link Visual Cue */
.resource-link.external::after {
    content: ' ↗';
    font-size: 0.8rem;
    opacity: 0.7;}

/* 38. FOOTER */
.btn-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.5rem 0;
    transition: var(--transition);}

.btn-text:hover {
    text-decoration: underline;
    opacity: 0.8;}

    /* Resource Grid Layout */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Individual Resource Card */
.resource-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: #4f46e5;
}

.res-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.res-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #f3f4f6;
}

.res-type-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: #e0e7ff;
    color: #4338ca;
}

.res-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

.res-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

.btn-delete-res {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    opacity: 0;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}

.resource-card:hover .btn-delete-res {
    opacity: 1;
}

.btn-add-resource {
    background: #eff6ff;
    color: #2563eb;
    border: 1px dashed #2563eb;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-resource:hover {
    background: #dbeafe;
}


/* MOBILE RESPONSIVENESS */
@media (max-width: 480px) {
    .subjects-grid {
        grid-template-columns: 1fr; /* Single column for focus on tiny screens */ }}


/* 39. CALENDAR CONTAINER */
.calendar-container {
    padding: 1.5rem;}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;}

.current-month-display {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);}

.calendar-nav {
    display: flex;
    gap: 0.5rem;}

/* 40. THE LEGEND UX */
.calendar-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);}

.legend-item {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;}

.dot.lab { background: var(--accent-chem); }
.dot.deadline { background: var(--urgent); }

/* 41. THE CALENDAR GRID (TABLE) */
.calendar-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px; /* Creates the gap between cells */
    table-layout: fixed;}

.calendar-grid th {
    padding: 0.75rem 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;}

.calendar-grid td {
    height: 80px;
    vertical-align: top;
    padding: 0.6rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    transition: var(--transition);
    position: relative;
    cursor: pointer;}

.calendar-grid td:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: scale(1.02);
    z-index: 2;}

/* Specific Day States */
.prev-month, .next-month {
    opacity: 0.3;}

.today-cell {
    background: white !important;
    border: 2px solid var(--primary);
    color: var(--primary) !important;}

.today-cell small {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    margin-top: 2px;}

/* Positioning the event dots in cells */
.calendar-grid td .dot {
    position: absolute;
    bottom: 8px;
    right: 8px;}

/* 42. UPCOMING SUMMARY FOOTER */
.upcoming-summary {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);}

.upcoming-summary p {
    font-size: 0.85rem;
    color: var(--primary);}

/* RESPONSIVE CALENDAR */
@media (max-width: 600px) {
    .calendar-grid td {
        height: 60px;
        padding: 0.4rem;
        font-size: 0.8rem;  }}


/* Calendar Grid Logic */
.calendar-grid {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    table-layout: fixed; /* Ensures equal cell width */
}

.calendar-grid th {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    padding-bottom: 0.5rem;
}

.calendar-grid td {
    height: 45px;
    border-radius: 8px;
    text-align: center;
    vertical-align: top;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    padding-top: 6px;
}

.calendar-grid td:hover {
    background-color: #f1f5f9;
}

.calendar-grid td.today-cell {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: bold;
    border: 1px solid #bfdbfe;
}

.calendar-grid td.other-month {
    color: #cbd5e1;
}

/* Dots for Events */
.cal-dot-container {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-top: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.dot.urgent { background-color: #ef4444; } /* Red */
.dot.task { background-color: #3b82f6; }   /* Blue */
.dot.done { background-color: #10b981; }   /* Green */

/* Next Event Banner */
.upcoming-summary {
    background: #f8fafc;
    border-left: 4px solid #4f46e5;
    padding: 12px;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1rem;
}

.next-event-icon { font-size: 1.5rem; }

/* Notification Pulse */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: bold;
    height: 16px;
    min-width: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}

.notifications-btn.has-new .icon-stack {
    animation: shake 2s infinite;
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(0deg); }
}

/* Dropdown Styling */
.notification-dropdown {
    width: 300px;
    right: 0;
    left: auto;
}

.notify-list {
    max-height: 300px;
    overflow-y: auto;
    list-style: none;
    padding: 0;
    margin: 0;
}

.notify-item {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}
.notify-item.urgent { border-left: 3px solid #ef4444; }
.notify-item small { display: block; color: #94a3b8; margin-top: 4px; }


/* 43. SHORTCUTS CONTAINER */
.shortcuts-container {
    padding: 1.5rem;
    height: fit-content;}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;}

.shortcuts-header h3 {
    font-size: 1rem;
    font-weight: 700;}

/* 44. THE PULSE (System Health) */
.pulse-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-chem);
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }}

/* 45. ACTION TILES GRID */
.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stacks on small containers */
    gap: 0.75rem;}

.action-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 100%;}

.action-tile:hover {
    background: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);}

.action-tile:active {
    transform: translateY(0);
    background: var(--primary-light);}

/* Tile Internal Layout */
.tile-icon {
    font-size: 1.25rem;
    background: white;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);}

.tile-text {
    display: flex;
    flex-direction: column;}

.tile-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);}

.tile-text small {
    font-size: 0.7rem;
    color: var(--text-muted);}

/* 46. ROLE-SPECIFIC SHORTCUT COLORS */
.action-tile.role-ug:hover { border-left: 4px solid var(--accent-chem); }
.action-tile.role-pg:hover { border-left: 4px solid var(--accent-teacher); }
.action-tile.role-teacher:hover { border-left: 4px solid var(--primary); }

.pomodoro-start-btn {
    background: linear-gradient(to right, #fff, #fff5f5);}
.pomodoro-start-btn:hover {
    border-color: var(--urgent);}

/* 47. KEYBOARD HINT FOOTER */
.shortcuts-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);}

.keyboard-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;}

.keyboard-hint code {
    background: var(--bg-main);
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: monospace;
    font-weight: 700;}


/* 48. TOAST NOTIFICATIONS (The Feedback Loop) */
.toast-notifications {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2000; /* Highest level */
    pointer-events: none; /* Allows clicking through the container itself */}

.toast {
    pointer-events: auto; /* Buttons inside toast stay clickable */
    background: white;
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideInRight 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }}

.toast.success { border-left-color: var(--accent-chem); }
.toast.error { border-left-color: var(--urgent); }

/* 49. MODAL & BACKDROP (The Deep Task Layer) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7); /* Deep slate overlay */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    transition: opacity 0.3s ease;}

.modal-content {
    background: white;
    width: 100%;
    max-width: 550px;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalScale 0.3s ease-out;}

@keyframes modalScale {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }}
