/* ═══════════════════════════════════════════════════════════════════════════
   PRACTISE APP — Premium Skill Practice Platform
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --bg: #050505;
    --surface: #0a0a0a;
    --surface-2: #111111;
    --surface-3: #1a1a1a;
    --surface-4: #222222;
    --border: #1f1f1f;
    --border-hover: #333;
    --text: #f5f5f5;
    --text-secondary: #888;
    --text-muted: #555;
    --accent: #00f0ff;
    --accent-glow: rgba(0, 240, 255, 0.15);
    --accent-2: #7c3aed;
    --accent-2-glow: rgba(124, 58, 237, 0.15);
    --accent-3: #f59e0b;
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.15);
    --red: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.15);
    --pink: #ec4899;
    --orange: #f97316;
    --gradient: linear-gradient(135deg, #00f0ff, #7c3aed);
    --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-green: linear-gradient(135deg, #10b981, #00f0ff);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-glow: 0 0 60px -20px var(--accent);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

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

.sidebar-logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.sidebar-badge {
    padding: 0.2rem 0.6rem;
    background: var(--accent-glow);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 100px;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

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

.nav-item .icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    padding: 0.15rem 0.5rem;
    background: var(--red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 100px;
    min-width: 20px;
    text-align: center;
}

.nav-item .badge.green { background: var(--green); }
.nav-item .badge.purple { background: var(--accent-2); }

/* Sidebar user */
.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #000;
}

.user-info { flex: 1; }
.user-name {
    font-weight: 600;
    font-size: 0.85rem;
}
.user-streak {
    font-size: 0.7rem;
    color: var(--accent-3);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--red-glow);
    color: var(--red);
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.page-header h1 .highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   STATS CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-card:hover::before { opacity: 1; }

.stat-card .icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 0.25rem;
}

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

.stat-card .change {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
}

.stat-card .change.up {
    background: var(--green-glow);
    color: var(--green);
}

.stat-card .change.down {
    background: var(--red-glow);
    color: var(--red);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SKILL CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

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

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.section-header .action {
    font-size: 0.8rem;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.section-header .action:hover { opacity: 0.8; }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.skill-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.skill-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
}

.skill-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skill-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.skill-info { flex: 1; }

.skill-info h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.skill-info .category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.skill-level {
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.skill-level.beginner { background: var(--green-glow); color: var(--green); }
.skill-level.intermediate { background: var(--accent-2-glow); color: var(--accent-2); }
.skill-level.advanced { background: rgba(239, 68, 68, 0.15); color: var(--red); }

.skill-progress {
    margin-bottom: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

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

.progress-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.progress-bar {
    height: 6px;
    background: var(--surface-3);
    border-radius: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 100px;
    transition: width 0.5s ease;
}

.skill-stats {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.skill-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.skill-stat .icon { font-size: 0.9rem; }

.due-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.7rem;
    background: var(--red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 100px;
}

.due-badge.soon {
    background: var(--accent-3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.btn-danger {
    background: var(--red-glow);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--red);
    color: #fff;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DUE TODAY WIDGET
   ═══════════════════════════════════════════════════════════════════════════ */

.due-today-widget {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.due-today-widget::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.1), transparent);
    pointer-events: none;
}

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

.due-today-header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.due-today-header h3 .count {
    background: var(--accent);
    color: #000;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
}

.due-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.due-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.due-chip:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.due-chip .icon { font-size: 1rem; }
.due-chip .count {
    color: var(--accent);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRACTICE SESSION
   ═══════════════════════════════════════════════════════════════════════════ */

.practice-view {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 1000;
    flex-direction: column;
}

.practice-view.active { display: flex; }

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

.practice-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.practice-skill-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.practice-skill-info .icon { font-size: 1.5rem; }
.practice-skill-info h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.practice-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.practice-progress-bar {
    width: 200px;
    height: 6px;
    background: var(--surface-3);
    border-radius: 100px;
    overflow: hidden;
}

.practice-progress-fill {
    height: 100%;
    background: var(--gradient);
    transition: width 0.3s;
}

.practice-progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.practice-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.practice-timer .icon { color: var(--accent-3); }

.practice-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.flashcard-container {
    width: 100%;
    max-width: 700px;
}

.flashcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flashcard-type {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.3rem 0.8rem;
    background: var(--surface-3);
    border-radius: 100px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flashcard-difficulty {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.flashcard-question {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.flashcard-question code {
    font-family: var(--font-mono);
    background: var(--surface-3);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--accent);
}

/* Multiple choice */
.choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.choice {
    padding: 1rem 1.25rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.choice:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.choice.selected {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.choice.correct {
    border-color: var(--green);
    background: var(--green-glow);
}

.choice.incorrect {
    border-color: var(--red);
    background: var(--red-glow);
}

.choice code {
    font-family: var(--font-mono);
    background: var(--surface-3);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Fill in blank */
.fill-blank-input {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 1rem;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.fill-blank-input:focus {
    border-color: var(--accent);
}

.fill-blank-input.correct {
    border-color: var(--green);
    background: var(--green-glow);
}

.fill-blank-input.incorrect {
    border-color: var(--red);
    background: var(--red-glow);
}

/* Code challenge */
.code-editor {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: left;
}

.code-editor-header {
    padding: 0.75rem 1rem;
    background: var(--surface-3);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.code-editor-header .dots {
    display: flex;
    gap: 0.4rem;
}

.code-editor-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.code-editor-header .dot.red { background: #ff5f56; }
.code-editor-header .dot.yellow { background: #ffbd2e; }
.code-editor-header .dot.green { background: #27c93f; }

.code-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

/* Answer feedback */
.answer-feedback {
    display: none;
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: left;
}

.answer-feedback.show { display: block; }

.answer-feedback.correct {
    background: var(--green-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.answer-feedback.incorrect {
    background: var(--red-glow);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.answer-feedback h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.answer-feedback.correct h4 { color: var(--green); }
.answer-feedback.incorrect h4 { color: var(--red); }

.answer-feedback p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.answer-feedback code {
    font-family: var(--font-mono);
    background: var(--surface-3);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Practice actions */
.practice-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.rating-buttons {
    display: none;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.rating-buttons.show { display: flex; }

.rating-btn {
    padding: 0.75rem 1.25rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.rating-btn .label { font-size: 0.7rem; color: var(--text-muted); }

.rating-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.rating-btn.again { border-color: var(--red); color: var(--red); }
.rating-btn.again:hover { background: var(--red-glow); }

.rating-btn.hard { border-color: var(--orange); color: var(--orange); }
.rating-btn.hard:hover { background: rgba(249, 115, 22, 0.15); }

.rating-btn.good { border-color: var(--green); color: var(--green); }
.rating-btn.good:hover { background: var(--green-glow); }

.rating-btn.easy { border-color: var(--accent); color: var(--accent); }
.rating-btn.easy:hover { background: var(--accent-glow); }

/* ═══════════════════════════════════════════════════════════════════════════
   SESSION SUMMARY
   ═══════════════════════════════════════════════════════════════════════════ */

.session-summary {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 1001;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.session-summary.active { display: flex; }

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.summary-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.summary-card h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.summary-card .subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-stat {
    padding: 1rem;
    background: var(--surface-2);
    border-radius: var(--radius);
}

.summary-stat .value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.summary-stat .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.summary-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SKILL LIBRARY
   ═══════════════════════════════════════════════════════════════════════════ */

.library-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.category-chip {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.category-chip:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.category-chip.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

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

.library-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.library-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.library-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.library-card .icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.library-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
}

.library-card .desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.library-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

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

.add-skill-btn {
    padding: 0.4rem 0.8rem;
    background: var(--gradient);
    color: #000;
    border: none;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.add-skill-btn:hover {
    transform: scale(1.05);
}

.add-skill-btn.added {
    background: var(--green-glow);
    color: var(--green);
    border: 1px solid var(--green);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANALYTICS
   ═══════════════════════════════════════════════════════════════════════════ */

.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analytics-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.analytics-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Streak calendar */
.streak-calendar {
    display: grid;
    grid-template-columns: repeat(52, 1fr);
    gap: 3px;
}

.streak-week {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.streak-day {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--surface-3);
}

.streak-day.level-1 { background: rgba(0, 240, 255, 0.2); }
.streak-day.level-2 { background: rgba(0, 240, 255, 0.4); }
.streak-day.level-3 { background: rgba(0, 240, 255, 0.6); }
.streak-day.level-4 { background: var(--accent); }

.streak-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.streak-legend .levels {
    display: flex;
    gap: 3px;
}

/* Learning curve chart */
.chart-container {
    height: 200px;
    position: relative;
}

.chart-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 0;
}

.chart-bar {
    flex: 1;
    background: var(--gradient);
    border-radius: 4px 4px 0 0;
    min-height: 10px;
    position: relative;
}

.chart-bar::after {
    content: attr(data-value);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
}

/* Skill breakdown */
.skill-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.breakdown-item .icon { font-size: 1.25rem; }

.breakdown-item .info { flex: 1; }

.breakdown-item .name {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.breakdown-item .bar {
    height: 4px;
    background: var(--surface-3);
    border-radius: 100px;
}

.breakdown-item .fill {
    height: 100%;
    border-radius: 100px;
}

.breakdown-item .value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 45px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CERTIFICATES
   ═══════════════════════════════════════════════════════════════════════════ */

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.certificate-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s;
}

.certificate-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.certificate-preview {
    height: 160px;
    background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.certificate-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 240, 255, 0.1), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.1), transparent 50%);
}

.certificate-badge {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
}

.certificate-content {
    padding: 1.5rem;
}

.certificate-content h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.certificate-content .date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.certificate-actions {
    display: flex;
    gap: 0.5rem;
}

.certificate-pending {
    opacity: 0.5;
}

.certificate-pending .certificate-preview {
    filter: grayscale(1);
}

.certificate-pending .progress-info {
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    border-color: var(--red);
    color: var(--red);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RECENT SESSIONS TABLE
   ═══════════════════════════════════════════════════════════════════════════ */

.sessions-table {
    width: 100%;
    border-collapse: collapse;
}

.sessions-table th,
.sessions-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.sessions-table th {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.sessions-table td {
    font-size: 0.85rem;
}

.sessions-table .skill-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sessions-table .skill-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.sessions-table .accuracy {
    font-weight: 600;
}

.sessions-table .accuracy.high { color: var(--green); }
.sessions-table .accuracy.medium { color: var(--accent-3); }
.sessions-table .accuracy.low { color: var(--red); }

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: none; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.fade-in { animation: fadeIn 0.5s ease; }
.slide-in { animation: slideIn 0.5s ease; }

.stagger { opacity: 0; animation: fadeIn 0.5s ease forwards; }
.stagger:nth-child(1) { animation-delay: 0.05s; }
.stagger:nth-child(2) { animation-delay: 0.1s; }
.stagger:nth-child(3) { animation-delay: 0.15s; }
.stagger:nth-child(4) { animation-delay: 0.2s; }
.stagger:nth-child(5) { animation-delay: 0.25s; }
.stagger:nth-child(6) { animation-delay: 0.3s; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-menu-toggle { display: flex; }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }
    
    .stats-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
    
    .choices { grid-template-columns: 1fr; }
    
    .practice-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .practice-progress-bar { width: 100%; }
    
    .flashcard { padding: 1.5rem; }
    .flashcard-question { font-size: 1.2rem; }
    
    .summary-stats { grid-template-columns: 1fr; }
    
    .page-header h1 { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TELEGRAM GATE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.gate-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff6b6b;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.5px;
    z-index: 2;
}
.gate-badge.unlocked {
    background: rgba(0, 200, 83, 0.15);
    border-color: rgba(0, 200, 83, 0.3);
    color: #00c853;
}
.gated-card {
    position: relative;
    border: 1px solid rgba(255, 59, 48, 0.2) !important;
}
.gated-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 59, 48, 0.03) 10px,
        rgba(255, 59, 48, 0.03) 20px
    );
    pointer-events: none;
    border-radius: inherit;
}
.gate-unlock-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    color: #fff !important;
    border: none !important;
}
.gate-unlock-btn:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    transform: translateY(-1px);
}

/* Gate Modal */
#gateModal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
#gateModal.active {
    opacity: 1;
    pointer-events: all;
}
.gate-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}
.gate-dialog {
    position: relative;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.3s;
}
#gateModal.active .gate-dialog {
    transform: translateY(0);
}
.gate-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}
.gate-close:hover { color: #fff; }
.gate-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.gate-dialog h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #fff;
}
.gate-desc {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}
.gate-steps {
    text-align: left;
    margin-bottom: 1.5rem;
}
.gate-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: #ccc;
    font-size: 0.9rem;
}
.gate-step code {
    background: rgba(0, 240, 255, 0.1);
    color: #00f0ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.gate-tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0088cc;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
}
.gate-tg-btn:hover {
    background: #006da3;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.4);
}
.gate-code-input {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}
.gate-code-input input {
    flex: 1;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    color: #fff;
    font-size: 1.3rem;
    text-align: center;
    letter-spacing: 8px;
    font-family: 'JetBrains Mono', monospace;
}
.gate-code-input input:focus {
    outline: none;
    border-color: #00f0ff;
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}
.gate-code-input input::placeholder {
    letter-spacing: 8px;
    color: #333;
}
.gate-code-input button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #00f0ff, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.gate-code-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}
.gate-code-input button:disabled {
    opacity: 0.6;
    cursor: wait;
}
.gate-message {
    font-size: 0.85rem;
    min-height: 20px;
    transition: all 0.2s;
}
.gate-message.error { color: #ff6b6b; }
.gate-message.success { color: #00c853; }
