/* ================================================
   LMS PRO - Modern UI Design System
   Sidebar Layout | Scroll-native approach
   ================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary:        #667eea;
    --primary-dark:   #5a67d8;
    --secondary:      #764ba2;
    --grad-primary:   linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-success:   linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --grad-danger:    linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --grad-warning:   linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    --grad-info:      linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --sidebar-width:  260px;
    --header-height:  64px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
    --shadow:         0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:      0 8px 32px rgba(0,0,0,.14);
    --radius:         12px;
    --radius-sm:      8px;
    --transition:     0.25s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    background: #f0f2f7;
    color: #2d3748;
    min-height: 100%;
}

/* =============================================
   SIDEBAR LAYOUT
   ============================================= */
.lms-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition);
}

/* Sidebar Brand */
.lms-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
}
.lms-sidebar-brand-icon {
    width: 42px; height: 42px;
    background: var(--grad-primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 20px; flex-shrink: 0;
}
.lms-sidebar-brand-text { color: white; font-weight: 700; font-size: 18px; letter-spacing: 0.5px; }
.lms-sidebar-brand-sub  { color: rgba(255,255,255,0.45); font-size: 11px; }

/* Sidebar Nav */
.lms-nav { padding: 16px 12px; flex: 1; }
.lms-nav-label {
    color: rgba(255,255,255,0.35);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 8px 10px 4px;
    margin-top: 8px;
}
.lms-nav-item { margin-bottom: 2px; }
.lms-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: all var(--transition);
    position: relative;
}
.lms-nav-link i { width: 20px; text-align: center; font-size: 16px; }
.lms-nav-link:hover, .lms-nav-link.active {
    background: rgba(255,255,255,0.10);
    color: white;
}
.lms-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--grad-primary);
    border-radius: 0 3px 3px 0;
}
.lms-nav-link .badge {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 7px;
}

/* Sidebar User Footer */
.lms-sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.lms-sidebar-user {
    display: flex; align-items: center; gap: 10px;
}
.lms-sidebar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.lms-sidebar-username { color: white; font-size: 13px; font-weight: 600; }
.lms-sidebar-role     { color: rgba(255,255,255,0.45); font-size: 11px; }

/* =============================================
   TOP HEADER
   ============================================= */
.lms-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid #e8ecf0;
    display: flex; align-items: center;
    padding: 0 24px;
    z-index: 999;
    box-shadow: var(--shadow-sm);
    gap: 16px;
}
.lms-header-title {
    font-size: 18px; font-weight: 700; color: #2d3748;
    flex: 1;
}
.lms-header-actions { display: flex; align-items: center; gap: 8px; }
.lms-header-btn {
    width: 38px; height: 38px;
    border: none; background: #f0f2f7; border-radius: 10px;
    color: #718096; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.lms-header-btn:hover { background: #e2e8f0; color: var(--primary); }

/* =============================================
   MAIN CONTENT WRAPPER
   ============================================= */
.lms-wrapper {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
}
.lms-content { padding: 28px 28px 48px; }

/* =============================================
   GUEST LAYOUT (no sidebar)
   ============================================= */
.lms-guest { min-height: 100vh; }

/* =============================================
   CARDS
   ============================================= */
.card {
    background: white;
    border-radius: var(--radius) !important;
    border: 1px solid #e8ecf0 !important;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}
.card-header {
    background: white !important;
    border-bottom: 1px solid #e8ecf0;
    padding: 16px 20px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.card-body { padding: 20px; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow) !important; }

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e8ecf0;
    display: flex; align-items: center; gap: 16px;
}
.stat-card-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white; flex-shrink: 0;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn { border-radius: var(--radius-sm) !important; font-weight: 500; transition: all var(--transition); }
.btn-primary  { background: var(--grad-primary); border: none !important; color: white !important; }
.btn-success  { background: var(--grad-success);  border: none !important; color: white !important; }
.btn-danger   { background: var(--grad-danger);   border: none !important; color: white !important; }
.btn-primary:hover, .btn-success:hover, .btn-danger:hover {
    opacity: 0.9; transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--grad-primary); color: white; border-color: transparent; }

/* =============================================
   FORMS
   ============================================= */
.form-control, .form-select {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid #e2e8f0;
    padding: 0.6rem 0.9rem;
    font-size: 14px;
    transition: border var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}
.form-label { font-weight: 600; font-size: 13px; color: #4a5568; margin-bottom: 6px; }

/* =============================================
   TABLES
   ============================================= */
.table { margin-bottom: 0; }
.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e8ecf0;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}
.table tbody td { padding: 14px 16px; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbff; }

/* =============================================
   BADGES
   ============================================= */
.badge { border-radius: 6px !important; font-weight: 500; padding: 4px 10px; font-size: 11.5px; }
.bg-primary-subtle { background: rgba(102,126,234,0.12) !important; }
.text-primary      { color: var(--primary) !important; }
.bg-success-subtle { background: rgba(17,153,142,0.12) !important; }
.bg-danger-subtle  { background: rgba(235,51,73,0.12) !important; }
.bg-warning-subtle { background: rgba(247,151,30,0.12) !important; }
.bg-info-subtle    { background: rgba(79,172,254,0.12) !important; }

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb { background: none; padding: 0; margin-bottom: 20px; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: #718096; }

/* =============================================
   PROGRESS
   ============================================= */
.progress { border-radius: 50px; height: 8px; background: #e8ecf0; }
.progress-bar { border-radius: 50px; background: var(--grad-primary); }

/* =============================================
   ALERTS
   ============================================= */
.alert { border-radius: var(--radius) !important; border: none; }

/* =============================================
   MODALS
   ============================================= */
.modal-content  { border: none !important; border-radius: var(--radius) !important; box-shadow: var(--shadow-lg); }
.modal-header   { border-radius: var(--radius) var(--radius) 0 0 !important; }

/* =============================================
   ACCORDION
   ============================================= */
.accordion-button { font-weight: 600; }
.accordion-button:not(.collapsed) { background: rgba(102,126,234,0.08); color: var(--primary); box-shadow: none; }
.accordion-item { border-color: #e8ecf0; }

/* =============================================
   HERO (public pages)
   ============================================= */
.hero-section {
    background: var(--grad-primary);
    position: relative; overflow: hidden;
}
.hero-section::after {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='40' cy='40' r='30'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* =============================================
   GRADIENT BG HELPERS
   ============================================= */
.bg-gradient-primary { background: var(--grad-primary) !important; }
.bg-gradient-success { background: var(--grad-success)  !important; }
.bg-gradient-danger  { background: var(--grad-danger)   !important; }
.bg-gradient-warning { background: var(--grad-warning)  !important; }
.bg-gradient-info    { background: var(--grad-info)     !important; }

/* =============================================
   UTILITIES
   ============================================= */
.text-gradient {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.shadow-custom    { box-shadow: var(--shadow) !important; }
.shadow-custom-lg { box-shadow: var(--shadow-lg) !important; }
.rounded-custom   { border-radius: var(--radius) !important; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }

/* Sidebar scrollbar – thinner */
.lms-sidebar::-webkit-scrollbar { width: 4px; }
.lms-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.4s ease both; }

/* =============================================
   RESPONSIVE – collapse sidebar on mobile
   ============================================= */
@media (max-width: 992px) {
    .lms-sidebar  { width: 0; overflow: hidden; }
    .lms-wrapper  { margin-left: 0; }
    .lms-header   { left: 0; }
    .lms-sidebar.open { width: var(--sidebar-width); }
}
