/* ========================================
   NihonGo! — Dashboard Styles
   ======================================== */

.dashboard-body {
    overflow: hidden;
    height: 100vh;
}

.dashboard-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 100;
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo .logo-icon { font-size: 1.4rem; }
.sidebar-logo .logo-name { font-size: 1.2rem; }

.sidebar-close {
    display: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 4px;
}

/* User Card */
.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.user-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-badges {
    display: flex;
    gap: 8px;
}

.xp-badge, .streak-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.xp-badge {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
}

.streak-badge {
    background: rgba(245, 158, 11, 0.15);
    color: var(--amber);
}

/* Current Course Button */
.current-course-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 16px 8px;
    padding: 14px 16px;
    background: var(--gradient-purple-pink);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.current-course-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.cc-icon { font-size: 1.3rem; }

.cc-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cc-label {
    font-size: 0.7rem;
    opacity: 0.8;
}

.cc-name {
    font-size: 0.9rem;
    font-weight: 700;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--surface);
}

.sidebar-link.active {
    color: var(--text-primary);
    background: rgba(168, 85, 247, 0.1);
    border-left: 3px solid var(--purple);
}

.sl-icon {
    width: 24px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.sidebar-link.signout {
    color: var(--red);
}

.sidebar-link.signout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ─── MAIN CONTENT ─── */
.dashboard-main {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: var(--bg-primary);
}

/* Mobile Header */
.mobile-dash-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.mobile-sidebar-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-btn span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

/* Greeting Banner */
.greeting-banner {
    padding: 32px 32px 24px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.06), rgba(6, 182, 212, 0.05));
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.greeting-content h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.greeting-content p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.greeting-decoration {
    font-size: 5rem;
    font-weight: 900;
    color: rgba(168, 85, 247, 0.06);
    position: absolute;
    right: 30px;
    pointer-events: none;
}

/* Dashboard Grid */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    padding: 24px 32px;
    align-items: start;
}

.dash-section {
    margin-bottom: 28px;
}

.dash-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Lesson Progress */
.lesson-progress-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-item {
    padding: 20px;
}

.lesson-item.active-lesson {
    border-color: var(--purple) !important;
    background: rgba(168, 85, 247, 0.05) !important;
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.lesson-number {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.lesson-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-top: 2px;
}

.lesson-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.lesson-status.unlocked {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}

.lesson-status.in-progress {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
}

.lesson-status.locked-status {
    background: var(--surface);
    color: var(--text-muted);
}

.lesson-tabs {
    display: flex;
    gap: 8px;
}

.lesson-tab {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
}

.lesson-tab.completed {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
}

.lesson-tab.current {
    background: rgba(168, 85, 247, 0.15);
    color: var(--purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.lesson-tab.locked {
    background: var(--surface);
    color: var(--text-muted);
}

/* Practice Grid */
.practice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.practice-card {
    padding: 20px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.practice-card:hover {
    border-color: var(--pc-color);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.pc-icon-wrap {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    margin: 0 auto 12px;
    font-size: 1.3rem;
    font-weight: 800;
}

.practice-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.practice-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Premium Banner */
.premium-banner {
    padding: 28px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(236, 72, 153, 0.08)) !important;
    border: 1px solid rgba(168, 85, 247, 0.15) !important;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.premium-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-purple-pink);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.premium-content h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.premium-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Test Cards */
.test-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-card {
    padding: 16px 20px;
}

.tc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tc-level {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.tc-level.n5 { background: var(--green); }
.tc-level.n4 { background: var(--blue); }
.tc-level.n3 { background: var(--amber); }
.tc-level.n2 { background: var(--orange); }
.tc-level.n1 { background: var(--red); }

.tc-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.test-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tc-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Side Panel */
.dash-side-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 24px;
}

.dash-stat-card {
    padding: 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 16px;
}

.dsc-icon {
    font-size: 2rem;
}

.dsc-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
}

.dsc-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.quick-stats {
    padding: 20px;
}

.quick-stats h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.qs-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.qs-row:last-child {
    border-bottom: none;
}

.qs-label {
    color: var(--text-secondary);
}

.qs-value {
    font-weight: 700;
    color: var(--text-primary);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .dash-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .dash-side-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        position: static;
    }
    
    .quick-stats {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        z-index: 200;
        transition: left var(--transition-base);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .mobile-dash-header {
        display: flex;
    }
    
    .greeting-banner {
        padding: 20px;
    }
    
    .greeting-content h1 {
        font-size: 1.2rem;
    }
    
    .greeting-decoration {
        display: none;
    }
    
    .dash-grid {
        padding: 16px;
    }
    
    .practice-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dash-side-col {
        grid-template-columns: 1fr;
    }
}
