﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --bg-dark: #0f172a;
    --bg-card-dark: #1e293b;
    --bg-sidebar-dark: #0f172a;
    --border-dark: #334155;
    --text-primary-dark: #f8fafc;
    --text-secondary-dark: #94a3b8;
    --bg-light: #f5f7fc;
    --bg-card-light: #ffffff;
    --border-light: #e2e8f0;
    --text-primary-light: #1a202c;
    --text-secondary-light: #475569;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary-dark);
    transition: background 0.3s, color 0.3s;
}

    body.light-theme {
        background: var(--bg-light);
        color: var(--text-primary-light);
    }

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary);
    }

body.light-theme ::-webkit-scrollbar-thumb {
    background: var(--border-light);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--bg-sidebar-dark);
    border-right: 1px solid var(--border-dark);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    padding-bottom: 80px;
}

body.light-theme .sidebar {
    background: var(--bg-card-light);
    border-right-color: var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-dark);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

    .logo-text span {
        font-weight: 600;
        background: none;
        color: var(--text-secondary-dark);
    }

body.light-theme .logo-text span {
    color: var(--text-secondary-light);
}

.user-info-sidebar {
    padding: 16px 20px;
    margin: 20px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(16, 185, 129, 0.15);
}

body.light-theme .user-info-sidebar {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.user-name-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
}

.user-status {
    font-size: 11px;
    color: var(--text-secondary-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

    .user-status::before {
        content: "";
        width: 8px;
        height: 8px;
        background: #10b981;
        border-radius: 50%;
        display: inline-block;
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.9);
    }
}

.logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
}

    .logout-btn:hover {
        background: rgba(239, 68, 68, 0.2);
    }

.nav-menu {
    list-style: none;
    padding: 8px 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    margin: 6px 0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary-dark);
    font-weight: 500;
}

    .nav-item span:last-child {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }

.nav-icon {
    width: 32px;
    height: 32px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

body.light-theme .nav-icon {
    background: #e2e8f0;
    color: #0fba7a;
}

.nav-item:hover {
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

body.light-theme .nav-item.active {
    background: rgba(16, 185, 129, 0.08);
    border-color: #10b981;
}

.nav-item.active .nav-icon {
    background: var(--primary);
    color: white;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 32px 40px;
}

.tab-content {
    display: none;
    animation: fadeInUp 0.4s ease;
}

    .tab-content.active {
        display: block;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        position: fixed;
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .charts-row {
        grid-template-columns: 1fr !important;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card-dark);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-dark);
}

body.light-theme .stat-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

body.light-theme .stat-icon {
    background: #e2e8f0;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.stat-info p {
    color: var(--text-secondary-dark);
    font-size: 14px;
}

body.light-theme .stat-info p {
    color: var(--text-secondary-light);
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.chart-container {
    background: var(--bg-card-dark);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid var(--border-dark);
}

body.light-theme .chart-container {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.chart-container h3 {
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: var(--bg-card-dark);
    border-radius: 24px;
    border: 1px solid var(--border-dark);
}

body.light-theme .filter-bar {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .filter-group label {
        font-size: 11px;
        color: var(--text-secondary-dark);
        font-weight: 600;
    }

body.light-theme .filter-group label {
    color: var(--text-secondary-light);
}

.filter-select {
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dark);
    border-radius: 14px;
    color: var(--text-primary-dark);
    cursor: pointer;
    font-size: 14px;
}

body.light-theme .filter-select {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1a202c;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

    .btn-primary:hover {
        transform: translateY(-2px);
    }

.btn-secondary {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

body.light-theme .btn-secondary {
    background: #e2e8f0;
    color: #0fba7a;
    border-color: #cbd5e1;
}

.btn-icon-round {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--bg-card-dark);
    border: 1px solid var(--border-dark);
    color: var(--text-secondary-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.light-theme .btn-icon-round {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}

.btn-icon-round:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

.form-card, .tips-card, .stats-preview, .ready-card, .checklist-card {
    background: var(--bg-card-dark);
    border-radius: 28px;
    padding: 28px;
    border: 1px solid var(--border-dark);
}

body.light-theme .form-card, body.light-theme .tips-card, body.light-theme .stats-preview, body.light-theme .ready-card, body.light-theme .checklist-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.form-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-dark);
}

.form-icon {
    width: 44px;
    height: 44px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
}

body.light-theme .form-icon {
    background: #e2e8f0;
}

.form-card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.slider-group {
    margin-bottom: 24px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

    .slider-label label {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-secondary-dark);
    }

body.light-theme .slider-label label {
    color: var(--text-secondary-light);
}

.slider-value {
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

body.light-theme .slider-value {
    background: #dcfce7;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border-dark);
    border-radius: 3px;
}

    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        width: 18px;
        height: 18px;
        background: var(--primary);
        border-radius: 50%;
        cursor: pointer;
        border: 2px solid #fff;
    }

.slider-track {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-secondary-dark);
}

.input-group {
    margin-bottom: 20px;
}

    .input-group label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 8px;
        color: var(--text-secondary-dark);
    }

body.light-theme .input-group label {
    color: var(--text-secondary-light);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-dark);
    border-radius: 14px;
    color: inherit;
    font-size: 14px;
}

body.light-theme .form-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1a202c;
}

.input-row, .stats-input-row {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.input-row {
    grid-template-columns: 1fr 1fr;
}

.stats-input-row {
    grid-template-columns: repeat(3, 1fr);
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 14px;
    cursor: pointer;
}

body.light-theme .checkbox-card {
    background: #f1f5f9;
}

.checkbox-icon {
    width: 32px;
    height: 32px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.checkbox-text {
    font-weight: 600;
    font-size: 15px;
}

.preview-stat {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    margin-bottom: 12px;
}

body.light-theme .preview-stat {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.preview-stat .stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.rating-stars {
    font-size: 24px;
    letter-spacing: 6px;
    color: var(--warning);
}

.calendar-container {
    margin-top: 28px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-legend {
    display: flex;
    gap: 20px;
    font-size: 11px;
}

.legend-excellent, .legend-good, .legend-bad, .legend-none {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 4px;
}

.legend-excellent {
    background: #10b981;
}

.legend-good {
    background: #f59e0b;
}

.legend-bad {
    background: #ef4444;
}

.legend-none {
    background: var(--text-secondary-dark);
}

.calendar-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.calendar-stat-card {
    background: var(--bg-card-dark);
    border-radius: 20px;
    padding: 18px 24px;
    text-align: center;
    flex: 1;
    min-width: 100px;
    border: 1px solid var(--border-dark);
}

body.light-theme .calendar-stat-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.calendar-stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.progress-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 28px;
}

.calendar-day {
    aspect-ratio: 1;
    background: var(--bg-card-dark);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-dark);
}

body.light-theme .calendar-day {
    background: #ffffff;
    border-color: #e2e8f0;
}

.calendar-day.excellent {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
}

body.light-theme .calendar-day.excellent {
    background: #dcfce7;
}

.calendar-day.good {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
}

body.light-theme .calendar-day.good {
    background: #fef9c3;
}

.calendar-day.bad {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

body.light-theme .calendar-day.bad {
    background: #fee2e2;
}

.calendar-day .day-number {
    font-size: 14px;
    font-weight: 700;
}

.achievements-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.achievements-progress {
    width: 200px;
    height: 8px;
    background: var(--border-dark);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.3s ease;
}

.achievements-counter {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary-dark);
}

.achievements-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 30px;
}

.category-btn {
    padding: 8px 18px;
    background: var(--bg-card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 40px;
    color: var(--text-secondary-dark);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

    .category-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-2px);
    }

    .category-btn.active {
        background: var(--primary);
        color: white;
        border-color: transparent;
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-card-dark);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--border-dark);
}

body.light-theme .achievement-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.achievement-card.unlocked {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
}

body.light-theme .achievement-card.unlocked {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(16, 185, 129, 0.01));
}

.achievement-card.locked {
    opacity: 0.6;
}

.achievement-icon {
    width: 48px;
    height: 48px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .achievement-icon i {
        font-size: 24px;
        color: var(--primary);
    }

body.light-theme .achievement-icon {
    background: #e2e8f0;
}

.achievement-info {
    flex: 1;
}

    .achievement-info h4 {
        font-size: 15px;
        font-weight: 600;
        margin-bottom: 4px;
        color: var(--text-primary-dark);
    }

body.light-theme .achievement-info h4 {
    color: var(--text-primary-light);
}

.achievement-info p {
    font-size: 12px;
    color: var(--text-secondary-dark);
    line-height: 1.3;
}

body.light-theme .achievement-info p {
    color: var(--text-secondary-light);
}

.achievement-points {
    font-size: 14px;
    font-weight: 700;
    color: var(--warning);
    white-space: nowrap;
}

.ai-coach-card {
    background: var(--bg-card-dark);
    border-radius: 28px;
    padding: 28px;
    border: 1px solid var(--border-dark);
}

body.light-theme .ai-coach-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}

.ai-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.rating-value {
    font-size: 42px;
    font-weight: 800;
}

.player-tier {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
}

body.light-theme .stats-summary {
    background: #f1f5f9;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin: 4px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

    .badge.warning {
        background: rgba(239, 68, 68, 0.15);
        color: #ef4444;
    }

.prediction-card {
    background: rgba(16, 185, 129, 0.08);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.win-chance {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.recommendation-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--bg-card-dark);
    border-radius: 24px;
    padding: 20px 28px;
    border-left: 5px solid var(--primary);
    margin-bottom: 12px;
}

body.light-theme .recommendation-card {
    background: #ffffff;
    border-left-color: #0fba7a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.recommendation-icon {
    width: 52px;
    height: 52px;
    background: rgba(16, 185, 129, 0.12);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

body.light-theme .recommendation-icon {
    background: #dcfce7;
}

.recommendation-text {
    color: var(--text-primary-dark);
    flex: 1;
}

body.light-theme .recommendation-text {
    color: var(--text-primary-light);
}

.clusters-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.cluster-card {
    background: var(--bg-card-dark);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid var(--border-dark);
}

body.light-theme .cluster-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.cluster-card.best {
    border-top: 4px solid #10b981;
}

.cluster-card.worst {
    border-top: 4px solid #ef4444;
}

.data-table-wrapper {
    overflow-x: auto;
    border-radius: 20px;
    background: var(--bg-card-dark);
    border: 1px solid var(--border-dark);
}

body.light-theme .data-table-wrapper {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 900px;
}

    .data-table th, .data-table td {
        padding: 12px 10px;
        text-align: center;
        border-bottom: 1px solid var(--border-dark);
        white-space: nowrap;
    }

body.light-theme .data-table th, body.light-theme .data-table td {
    border-bottom-color: var(--border-light);
}

.data-table th {
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary);
    font-weight: 600;
    position: sticky;
    top: 0;
}

body.light-theme .data-table th {
    background: #f1f5f9;
}

.data-table td {
    color: var(--text-primary-dark);
}

body.light-theme .data-table td {
    color: var(--text-primary-light);
}

.data-table tr:hover {
    background: rgba(16, 185, 129, 0.05);
}

.win-text {
    color: #10b981;
    font-weight: bold;
}

.loss-text {
    color: #ef4444;
    font-weight: bold;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px;
}

    .pagination button {
        background: var(--bg-card-dark);
        border: 1px solid var(--border-dark);
        color: var(--text-primary-dark);
        padding: 8px 16px;
        border-radius: 20px;
        cursor: pointer;
        transition: all 0.2s;
    }

body.light-theme .pagination button {
    background: var(--bg-card-light);
    color: var(--text-primary-light);
    border-color: var(--border-light);
}

.pagination button:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    font-size: 14px;
    color: var(--text-secondary-dark);
}

.profile-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.profile-modal-content {
    background: var(--bg-card-dark);
    border-radius: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-dark);
}

body.light-theme .profile-modal-content {
    background: #ffffff;
    border-color: var(--border-light);
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-dark);
}

body.light-theme .profile-modal-header {
    border-bottom-color: var(--border-light);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #ef4444;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

    .modal-close:hover {
        background: rgba(239, 68, 68, 0.1);
        transform: rotate(90deg);
    }

.profile-modal-body {
    padding: 20px 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.avatar-section {
    text-align: center;
    margin-bottom: 24px;
}

.avatar {
    width: 88px;
    height: 88px;
    background: var(--primary);
    border-radius: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 40px;
    color: white;
}

.profile-field {
    margin-bottom: 20px;
}

    .profile-field label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 8px;
        color: var(--text-secondary-dark);
    }

body.light-theme .profile-field label {
    color: var(--text-secondary-light);
}

.field-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-radius: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

body.light-theme .field-value {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.field-value span {
    flex: 1;
    word-break: break-word;
}

.edit-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

    .edit-btn:hover {
        background: rgba(16, 185, 129, 0.1);
    }

.theme-section {
    margin: 24px 0;
}

    .theme-section label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 12px;
        color: var(--text-secondary-dark);
    }

body.light-theme .theme-section label {
    color: var(--text-secondary-light);
}

.theme-buttons {
    display: flex;
    gap: 12px;
}

.theme-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-card-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

body.light-theme .theme-btn {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1a202c;
}

.theme-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.stats-section {
    margin-top: 20px;
}

    .stats-section h4 {
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 16px;
        color: var(--primary);
    }

.stats-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-dark);
    font-size: 13px;
}

body.light-theme .stat-item {
    border-bottom-color: var(--border-light);
}

.profile-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-dark);
    display: flex;
    justify-content: flex-end;
}

body.light-theme .profile-modal-footer {
    border-top-color: var(--border-light);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top: 3px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

body.light-theme .insight-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(139, 92, 246, 0.02));
}

body.light-theme .filter-select option {
    background: #ffffff;
    color: #1a202c;
}

body.light-theme .calendar-day-header {
    color: #64748b;
}

body.light-theme .ready-placeholder {
    background: #f1f5f9;
}

/* ========== FACEIT MODAL ========== */
#faceit-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

    #faceit-modal .modal-content {
        background: var(--bg-card-dark);
        border-radius: 32px;
        width: 90%;
        max-width: 420px;
        padding: 28px;
        border: 1px solid var(--border-dark);
        position: relative;
    }

body.light-theme #faceit-modal .modal-content {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

#faceit-modal h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: var(--primary);
}

#faceit-modal .close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary-dark);
    transition: color 0.2s;
}

    #faceit-modal .close:hover {
        color: var(--danger);
    }

#faceit-modal .form-input {
    margin-bottom: 16px;
}

#faceit-modal .btn-primary {
    width: 100%;
    margin-top: 8px;
}

/* ========== CHECKLIST ITEMS (для FACEIT модалки и других чекбоксов) ========== */
.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary-dark);
}

body.light-theme .checkbox-item {
    color: var(--text-primary-light);
}

.checkbox-item input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-dark);
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.2s;
}

body.light-theme .checkbox-custom {
    border-color: var(--border-light);
}

.checkbox-item input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

    .checkbox-item input:checked + .checkbox-custom::after {
        content: "✓";
        position: absolute;
        color: white;
        font-size: 14px;
        top: -2px;
        left: 3px;
    }

.checkbox-label {
    user-select: none;
}

/* ========== MAP ANALYSIS ========== */
.map-analysis-card {
    background: var(--bg-card-dark);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-dark);
}

body.light-theme .map-analysis-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.map-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

    .map-stats-table th,
    .map-stats-table td {
        padding: 12px 8px;
        text-align: center;
        border-bottom: 1px solid var(--border-dark);
    }

body.light-theme .map-stats-table th,
body.light-theme .map-stats-table td {
    border-bottom-color: var(--border-light);
}

.map-stats-table th {
    font-weight: 600;
    color: var(--primary);
}

.winrate.high {
    color: #10b981;
    font-weight: bold;
}

.winrate.low {
    color: #ef4444;
}

.map-advice {
    display: flex;
    gap: 16px;
    background: rgba(16,185,129,0.08);
    border-radius: 20px;
    padding: 16px 20px;
    margin-top: 20px;
}

    .map-advice .advice-icon {
        font-size: 28px;
    }

.map-highlights {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.highlight-card {
    flex: 1;
    background: var(--bg-card-dark);
    border-radius: 20px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-dark);
}

body.light-theme .highlight-card {
    background: var(--bg-card-light);
}

.highlight-card h4 {
    margin-bottom: 12px;
    color: var(--primary);
}

.highlight-card .map-name {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0;
}

.btn-small {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 12px;
}

/* ========== TRENDS ========== */
.trends-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.trend-stat {
    flex: 1;
    background: var(--bg-card-dark);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}

body.light-theme .trend-stat {
    background: var(--bg-card-light);
}

.trend-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

    .trend-value.positive {
        color: #10b981;
    }

    .trend-value.negative {
        color: #ef4444;
    }

.trend-label {
    color: var(--text-secondary-dark);
    font-size: 12px;
    margin-top: 8px;
}

.trend-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.trend-chart-box {
    background: var(--bg-card-dark);
    border-radius: 20px;
    padding: 20px;
}

body.light-theme .trend-chart-box {
    background: var(--bg-card-light);
}

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: inline-block;
        margin-left: auto;
        margin-right: 16px;
        cursor: pointer;
        font-size: 24px;
        color: var(--primary);
    }
    .logo {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        background: var(--bg-sidebar-dark);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        border-right: 1px solid var(--border-dark);
    }
    body.light-theme .sidebar {
        background: var(--bg-card-light);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        padding: 12px !important;
        overflow-x: hidden;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    .stat-card {
        padding: 12px !important;
    }
    .stat-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    .stat-info h3 {
        font-size: 20px !important;
    }
    .charts-row {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table {
        min-width: 600px;
    }
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    .clusters-container {
        grid-template-columns: 1fr !important;
    }
    .achievements-grid {
        grid-template-columns: 1fr !important;
    }
    .ai-header {
        flex-direction: column;
        text-align: center;
    }
    .stats-summary {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .trend-charts {
        grid-template-columns: 1fr !important;
    }
    .map-highlights {
        flex-direction: column;
    }
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 999;
    }
    .mobile-overlay.active {
        display: block;
    }
    .close-sidebar-btn {
        display: flex;
        justify-content: flex-end;
        padding: 16px;
        border-bottom: 1px solid var(--border-dark);
        margin-bottom: 16px;
    }
    .close-sidebar-btn button {
        background: none;
        border: none;
        color: var(--text-secondary-dark);
        font-size: 24px;
        cursor: pointer;
    }
}
@media (min-width: 769px) {
    .mobile-overlay, .close-sidebar-btn {
        display: none !important;
    }
}

/* ========== ФИКС МОДАЛЬНОГО ОКНА ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ ========== */
@media (max-width: 768px) {
    #faceit-modal .modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 16px;
        margin: 10px auto;
        border-radius: 20px;
    }
    #faceit-modal .slider-group {
        margin-bottom: 16px;
    }
    #faceit-modal .checklist-items {
        margin: 12px 0;
    }
    #faceit-modal .btn-primary {
        margin-top: 16px;
        padding: 12px;
        font-size: 16px;
    }
}
/* ========== МОБИЛЬНАЯ ВЕРСИЯ МОДАЛЬНОГО ОКНА FACEIT ========== */
@media (max-width: 768px) {
    .modal {
        align-items: flex-start !important;
        padding: 16px !important;
        overflow-y: auto !important;
    }
    .modal-content {
        max-height: 90vh !important;
        overflow-y: auto !important;
        margin: 0 auto !important;
        width: 100% !important;
        border-radius: 24px !important;
        padding: 20px !important;
        position: relative !important;
    }
    .modal .close {
        position: sticky !important;
        top: 0 !important;
        right: 0 !important;
        float: right !important;
        font-size: 28px !important;
        font-weight: bold !important;
        margin-bottom: 16px !important;
        display: block !important;
        text-align: right !important;
        cursor: pointer !important;
        z-index: 10 !important;
    }
    /* Кнопка импорта должна быть видна */
    .modal-content .btn-primary {
        margin-top: 20px !important;
        width: 100% !important;
        display: block !important;
    }
}
/* ========== МОБИЛЬНОЕ МОДАЛЬНОЕ ОКНО (FACEIT) ========== */
@media (max-width: 768px) {
    .modal {
        align-items: flex-start !important;
        padding: 16px !important;
        overflow-y: auto !important;
    }
    .modal-content {
        max-height: 85vh !important;
        overflow-y: auto !important;
        width: 100% !important;
        margin: auto !important;
        border-radius: 28px !important;
        padding: 20px !important;
        position: relative;
    }
    .modal .close {
        position: sticky;
        top: 0;
        float: right;
        font-size: 28px;
        font-weight: bold;
        margin-bottom: 16px;
        cursor: pointer;
        display: block;
        text-align: right;
        background: none;
        border: none;
        color: var(--text-secondary-dark);
        z-index: 10;
    }
    .modal-content .btn-primary {
        width: 100%;
        margin-top: 20px;
        display: block;
    }
    .slider-group {
        margin-bottom: 20px;
    }
    .checklist-items {
        margin: 16px 0;
    }
}
/* Закрытие по клику на фон */
.modal {
    cursor: pointer;
}
.modal-content {
    cursor: default;
}
