/*
==========================================================================
LMS - Dashboard Styles
==========================================================================
Star Digital Software - EduCall AI
https://stardigitalsoftware.com
Version: 1.0
==========================================================================
*/

/* ========================================
   CSS Reset & Base
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   CSS Variables - Dark Theme (Default)
======================================== */
:root, [data-theme="dark"] {
    --bg-primary: #1c1c1e;
    --bg-secondary: #232325;
    --bg-card: #2c2c2e;
    --bg-card-hover: #343436;
    --accent-copper: #b87333;
    --accent-copper-light: #c9845a;
    --accent-gradient: linear-gradient(135deg, #b87333 0%, #d4945a 50%, #c9845a 100%);
    --accent-gradient-hover: linear-gradient(135deg, #c9845a 0%, #daa57a 50%, #d4945a 100%);
    --text-primary: #f5f0e8;
    --text-secondary: #a8a8a8;
    --text-muted: #6e6e6e;
    --gain: #6b8e6b;
    --loss: #c27878;
    --border: #3a3a3c;
    --shadow: rgba(0, 0, 0, 0.3);
    --chart-grid: rgba(255, 255, 255, 0.05);
    --overlay: rgba(0, 0, 0, 0.5);
}

/* ========================================
   CSS Variables - Light Theme
======================================== */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f2;
    --accent-copper: #d4945a;
    --accent-copper-light: #e8b88a;
    --accent-gradient: linear-gradient(135deg, #d4945a 0%, #e8b88a 50%, #f0c89a 100%);
    --accent-gradient-hover: linear-gradient(135deg, #e8b88a 0%, #f0c89a 50%, #f5d4a8 100%);
    --text-primary: #1c1c1e;
    --text-secondary: #6e6e6e;
    --text-muted: #9a9a9a;
    --gain: #5a9a5a;
    --loss: #c76b6b;
    --border: #e0e0e2;
    --shadow: rgba(0, 0, 0, 0.08);
    --chart-grid: rgba(0, 0, 0, 0.05);
    --overlay: rgba(0, 0, 0, 0.5);
}

/* ========================================
   Body & Typography
======================================== */
body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================
   Dashboard Layout
======================================== */
.dashboard {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* ========================================
   Mobile Menu Toggle
======================================== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 46px;
    height: 46px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: var(--bg-card-hover);
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu-toggle.active {
    left: auto;
    right: 20px;
}

/* ========================================
   Sidebar Overlay
======================================== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--overlay);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   Sidebar
======================================== */
.sidebar {
    background-color: var(--bg-secondary);
    padding: 32px 24px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 1000;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-copper), var(--accent-copper-light));
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-copper-light), var(--accent-copper));
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-copper) transparent;
}

/* ========================================
   Logo
======================================== */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: #1c1c1e;
    box-shadow: 0 4px 12px rgba(184, 115, 51, 0.25);
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================================
   Navigation
======================================== */
.nav-section {
    margin-bottom: 32px;
}

.nav-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: #1c1c1e;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(184, 115, 51, 0.3);
}

.nav-item.active:hover {
    background: var(--accent-gradient-hover);
}

.nav-icon {
    width: 22px;
    height: 22px;
    opacity: 0.8;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

/* ========================================
   Sidebar Footer
======================================== */
.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    background-color: var(--bg-secondary);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 16px;
}

.theme-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background-color: var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.theme-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

[data-theme="light"] .theme-switch {
    background: var(--accent-gradient);
}

[data-theme="light"] .theme-switch::after {
    transform: translateX(24px);
    background-color: #ffffff;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    color: var(--loss);
    text-decoration: none;
    width: 100%;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background-color: rgba(194, 120, 120, 0.15);
}

.logout-btn svg {
    width: 22px;
    height: 22px;
}

/* ========================================
   Main Content
======================================== */
.main-content {
    padding: 32px 40px;
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.main-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-copper), var(--accent-copper-light));
    border-radius: 10px;
}

.main-content {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-copper) var(--bg-primary);
}

/* ========================================
   Page Header
======================================== */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ========================================
   Cards
======================================== */
.card {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 28px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Stats Cards Specific */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.users { background: rgba(184, 115, 51, 0.15); color: var(--accent-copper); }
.stat-icon.active { background: rgba(107, 142, 107, 0.15); color: var(--gain); }
.stat-icon.roles { background: rgba(194, 120, 120, 0.15); color: var(--loss); }
.stat-icon.dept { background: rgba(184, 115, 51, 0.15); color: var(--accent-copper); }

.stat-details h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 13px;
    color: var(--text-muted);
}

.stat-change .positive {
    color: var(--gain);
}

.stat-change .negative {
    color: var(--loss);
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    border: 1px solid var(--border);
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Recent Users Table */
.recent-users {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 24px;
    border: 1px solid var(--border);
}

.recent-users h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background-color: var(--bg-card-hover);
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(184, 115, 51, 0.15);
    color: var(--accent-copper);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--bg-card-hover);
    color: var(--accent-copper);
}

/* ========================================
   Buttons
======================================== */
.btn {
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--text-primary);
}

.btn:hover {
    background-color: var(--bg-card-hover);
}

.btn.primary {
    background: var(--accent-gradient);
    border: none;
    color: #1c1c1e;
}

.btn.primary:hover {
    background: var(--accent-gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(184, 115, 51, 0.3);
}

.btn.danger {
    color: var(--loss);
    border-color: var(--loss);
}

.btn.danger:hover {
    background-color: rgba(194, 120, 120, 0.15);
}

.btn-group {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

/* ========================================
   Form Elements (Dashboard Forms)
======================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-copper);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    padding: 14px 18px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236e6e6e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-copper);
}

/* ========================================
   Toggle Switches
======================================== */
.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.toggle-item:last-child {
    border-bottom: none;
}

.toggle-info {
    flex: 1;
}

.toggle-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toggle-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background-color: var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background-color: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active {
    background: var(--accent-gradient);
}

.toggle-switch.active::after {
    transform: translateX(24px);
    background-color: #1c1c1e;
}

/* ========================================
   Coin Icons
======================================== */
.coin-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.coin-icon.btc { background: linear-gradient(135deg, #f7931a, #c77b15); }
.coin-icon.eth { background: linear-gradient(135deg, #627eea, #4a5fc1); }
.coin-icon.usdt { background: linear-gradient(135deg, #26a17b, #1a7a5c); }
.coin-icon.bnb { background: linear-gradient(135deg, #f3ba2f, #c99a27); }
.coin-icon.sol { background: linear-gradient(135deg, #9945ff, #14f195); }
.coin-icon.xrp { background: linear-gradient(135deg, #23292f, #000000); }
.coin-icon.ada { background: linear-gradient(135deg, #0033ad, #002276); }
.coin-icon.doge { background: linear-gradient(135deg, #c3a634, #ba9f33); }
.coin-icon.dot { background: linear-gradient(135deg, #e6007a, #c40068); }
.coin-icon.matic { background: linear-gradient(135deg, #8247e5, #6b3bc4); }

/* ========================================
   Widget Icons (for cards)
======================================== */
.widgets-icons-2 {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: 12px;
}

.bg-gradient-primary {
    background: linear-gradient(45deg, #b87333, #d4945a);
}

.bg-gradient-success {
    background: linear-gradient(45deg, #5a9a5a, #7cb57c);
}

.bg-gradient-danger {
    background: linear-gradient(45deg, #c76b6b, #d88a8a);
}

.bg-gradient-info {
    background: linear-gradient(45deg, #4a90e2, #7bb0f0);
}

.bg-gradient-warning {
    background: linear-gradient(45deg, #f39c12, #f5b554);
}

.bg-gradient-orange {
    background: linear-gradient(45deg, #e67e22, #f39c12);
}

.bg-gradient-ohhappiness {
    background: linear-gradient(45deg, #00b09b, #96c93d);
}

.bg-gradient-blues {
    background: linear-gradient(45deg, #2b5876, #4e4376);
}

.bg-gradient-burning {
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
}

/* ========================================
   Copyright Footer
======================================== */
.copyright {
    text-align: center;
    padding: 24px 40px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.copyright a {
    color: var(--accent-copper);
    text-decoration: none;
}

.copyright a:hover {
    color: var(--accent-copper-light);
}

/* ========================================
   Responsive - Tablet
======================================== */
@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .dashboard {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px var(--shadow);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        padding: 24px;
        padding-top: 80px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Responsive - Mobile
======================================== */
@media (max-width: 640px) {
    .main-content {
        padding: 16px;
        padding-top: 80px;
    }

    .btn-group {
        flex-direction: column;
    }

    .card {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }
}

/* ========================================
   Utility Classes
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }

.rounded-circle { border-radius: 50%; }
.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }

.border { border: 1px solid var(--border); }
.border-top { border-top: 1px solid var(--border); }
.border-bottom { border-bottom: 1px solid var(--border); }
.border-start { border-left: 1px solid var(--border); }
.border-end { border-right: 1px solid var(--border); }

.border-0 { border: none; }
.border-4 { border-width: 4px; }

.border-primary { border-color: var(--accent-copper); }
.border-success { border-color: var(--gain); }
.border-danger { border-color: var(--loss); }
.border-warning { border-color: #f39c12; }
.border-info { border-color: #4a90e2; }

.bg-primary { background-color: var(--accent-copper); }
.bg-success { background-color: var(--gain); }
.bg-danger { background-color: var(--loss); }
.bg-warning { background-color: #f39c12; }
.bg-info { background-color: #4a90e2; }

.text-primary { color: var(--accent-copper); }
.text-success { color: var(--gain); }
.text-danger { color: var(--loss); }
.text-warning { color: #f39c12; }
.text-info { color: #4a90e2; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal { font-weight: 400; }

.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fs-18 { font-size: 18px; }
.fs-20 { font-size: 20px; }
.fs-24 { font-size: 24px; }
.fs-32 { font-size: 32px; }