/* Cool Graphite + Indigo Accent — updated 2026-06-26 */
/* ==========================================
   StudyHub - Modern Learning Platform Styles
   Cool Graphite + Indigo Accent Theme
   ========================================== */

/* ==========================================
   CSS RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ── Primary — Cool Graphite ── */
    --primary:           #18181B;
    --primary-dark:      #09090B;
    --primary-hover:     #27272A;
    --primary-active:    #3F3F46;
    --primary-subtle:    #F4F4F5;
    --primary-border:    #D4D4D8;
    --primary-gradient:  none;
    --primary-start:     #18181B;
    --primary-end:       #27272A;

    /* ── Accent — Indigo ── */
    --accent:            #6366F1;
    --accent-hover:      #4F46E5;
    --accent-active:     #4338CA;
    --accent-subtle:     rgba(99,102,241,0.15);
    --accent-border:     rgba(99,102,241,0.3);

    /* ── Backgrounds ── */
    --bg-page:           #0F0F11;
    --bg-card:           #1C1C1F;
    --bg-surface:        #242428;
    --bg-hover:          #2A2A2E;
    --bg-primary:        var(--bg-card);
    --bg-secondary:      var(--bg-page);
    --bg-tertiary:       var(--bg-surface);

    /* ── Legacy aliases (keep old code working) ── */
    --primary-blue:       #6366F1;
    --primary-blue-dark:  #4F46E5;
    --primary-blue-light: #818CF8;
    --primary-blue-pale:  rgba(99,102,241,0.15);
    --primary-blue-hover: #4F46E5;
    --accent-cyan:   #06b6d4;
    --accent-indigo: #6366F1;
    --accent-purple: #8b5cf6;
    --white:   #FAFAFA;

    /* ── Neutrals (remapped to dark scale) ── */
    --gray-50:  #1C1C1F;
    --gray-100: #242428;
    --gray-200: #27272A;
    --gray-300: #3F3F46;
    --gray-400: #52525B;
    --gray-500: #71717A;
    --gray-600: #A1A1AA;
    --gray-700: #D4D4D8;
    --gray-800: #E4E4E7;
    --gray-900: #FAFAFA;

    /* ── Text ── */
    --text-primary:   #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-meta:      #71717A;
    --text-tertiary:  #52525B;

    /* ── Borders ── */
    --border:       #27272A;
    --border-light: #1F1F22;

    /* ── Status Colors ── */
    --success:       #10B981;
    --warning:       #F59E0B;
    --danger:        #EF4444;
    --info:          #6366F1;

    /* ── Shadows ── */
    --shadow-sm:  0 1px 2px  rgba(0,0,0,0.4);
    --shadow-md:  0 2px 8px  rgba(0,0,0,0.5);
    --shadow-lg:  0 4px 16px rgba(0,0,0,0.6);
    --shadow-xl:  0 8px 32px rgba(0,0,0,0.7);
    --shadow-blue: 0 10px 25px -5px rgba(99,102,241,0.25);

    /* ── Spacing (unchanged) ── */
    --spacing-xs:  0.25rem;
    --spacing-sm:  0.5rem;
    --spacing-md:  1rem;
    --spacing-lg:  1.5rem;
    --spacing-xl:  2rem;
    --spacing-2xl: 3rem;

    /* ── Border Radius (unchanged) ── */
    --radius-sm:   0.375rem;
    --radius-md:   0.5rem;
    --radius-lg:   0.75rem;
    --radius-xl:   1rem;
    --radius-full: 9999px;

    /* ── Transitions (unchanged) ── */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;

    /* ── Z-index layers ── */
    --z-dropdown:       1000;
    --z-sticky:         1020;
    --z-fixed:          1030;
    --z-modal-backdrop: 1040;
    --z-modal:          1050;
    --z-popover:        1060;
    --z-tooltip:        1070;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ==========================================
   NAVIGATION BAR
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Logo */
.navbar-logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform var(--transition-base);
}

.navbar-logo a:hover {
    transform: scale(1.05);
}

.logo-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 4px rgba(99,102,241,0.3));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, #818CF8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Search Bar */
.navbar-search {
    flex: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: all var(--transition-base);
    outline: none;
}

.search-input:focus {
    border-color: var(--accent);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-icon-btn {
    position: relative;
    background: var(--bg-surface);
    border: none;
    padding: 0.625rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-icon-btn:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.navbar-icon-btn .icon {
    font-size: 1.25rem;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 4px rgba(239,68,68,0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Profile Dropdown */
.navbar-profile-dropdown {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-primary);
}

.profile-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-border);
    box-shadow: var(--shadow-md);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--accent-border);
}

.profile-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

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

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.5rem 0;
}

.text-danger {
    color: var(--danger) !important;
}

.text-danger:hover {
    background: rgba(239,68,68,0.1) !important;
}

/* ==========================================
   MAIN WRAPPER & LAYOUT
   ========================================== */
.main-wrapper {
    margin-top: 70px;
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 1.5rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem;
    min-height: calc(100vh - 70px);
}

/* ==========================================
   LEFT SIDEBAR
   ========================================== */
.sidebar {
    position: sticky;
    top: 85px;
    height: fit-content;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    position: relative;
    font-weight: 500;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    transition: height var(--transition-base);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item:hover::before {
    height: 70%;
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.nav-item.active::before {
    display: none;
}

.nav-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
    font-size: 0.9rem;
}

.nav-badge {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.nav-item.active .nav-badge {
    background: var(--accent-subtle);
    color: var(--accent);
}

.sidebar-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.content-area {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    min-height: 500px;
    animation: fadeInUp 0.6s ease-out;
    color: var(--text-primary);
}

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

/* ==========================================
   RIGHT SIDEBAR
   ========================================== */
.right-sidebar {
    position: sticky;
    top: 85px;
    height: fit-content;
    animation: slideInRight 0.5s ease-out;
}

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

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
    color: var(--text-primary);
}

.widget:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-xl);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-muted {
    color: var(--text-meta);
    font-size: 0.875rem;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1200px) {
    .main-wrapper {
        grid-template-columns: 250px 1fr;
    }
    
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        padding: 0.75rem 1rem;
        gap: 1rem;
    }
    
    .navbar-search {
        display: none;
    }
    
    .profile-name {
        display: none;
    }
    
    .main-wrapper {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }
    
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        padding: 1rem;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.25rem;
    }
    
    .nav-item {
        flex-direction: column;
        gap: 0.25rem;
        padding: 0.5rem;
        min-width: 70px;
        text-align: center;
    }
    
    .nav-item::before {
        display: none;
    }
    
    .nav-label {
        font-size: 0.75rem;
    }
    
    .sidebar-divider {
        display: none;
    }
    
    .content-area {
        margin-bottom: 80px;
        padding: 1.5rem;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.btn-primary {
    background: var(--primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-active);
    color: var(--text-primary);
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-page);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-active);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}
