/* Minimalist BeamMP Tracker - VK Style */

:root {
    /* Colors - VK Inspired */
    --primary: #2979ff; /* Яркий синий, как у VK */
    --primary-light: #5393ff;
    --primary-dark: #0050c5;
    --accent: #00a3ff;       /* Дополнительный синий */
    --success: #4caf50;      /* Зеленый (положительные действия) */
    --danger: #f44336;       /* Красный (отрицательные действия) */
    --warning: #ff9800;      /* Оранжевый (предупреждения) */

    /* Neutrals - Modern Grays */
    --gray-50: #fafafe;
    --gray-100: #f5f5fa;
    --gray-200: #eaeaf2;
    --gray-300: #dcdce5;
    --gray-400: #a9a9b3;
    --gray-500: #787880;
    --gray-600: #565660;
    --gray-700: #3d3d43;
    --gray-800: #28282d;
    --gray-900: #18181b;

    /* Light theme (Custom) */
    --bg: #fafafe;          /* Светлый, почти белый фон */
    --bg-secondary: #fff;   /* Белый для карточек и элементов */
    --text: #18181b;        /* Почти черный для основного текста */
    --text-secondary: #565660; /* Серый для второстепенного текста */
    --text-muted: #787880;   /* Светло-серый для неважной информации */
    --border: #eaeaf2;      /* Светлая граница */
    --shadow: rgba(0, 0, 0, 0.05); /* Очень легкая тень */

    /* Spacing - Comfortable Rhythm */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border radius - Modern Curves */
    --radius-sm: 0.375rem;  /* 6px */
    --radius: 0.5rem;       /* 8px */
    --radius-lg: 0.75rem;   /* 12px */

    /* Transitions - Smooth and Subtle */
    --transition: all 0.15s ease-in-out;
}

/* Dark theme (Custom - Modified for consistency) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #18181b;       /* Почти черный фон */
        --bg-secondary: #28282d; /* Темный фон для карточек */
        --text: #f5f5fa;      /* Светлый текст */
        --text-secondary: #a9a9b3; /* Серый текст */
        --text-muted: #787880;   /* Еще более светлый серый */
        --border: #3d3d43;      /* Темная граница */
        --shadow: rgba(0, 0, 0, 0.2); /* Более заметная тень */
    }
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;          /* Remove default margins */
    padding: 0;         /* Remove default padding */
}

/* Base */
body {
    font-family: sans-serif; /* Modern, clean font */
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    font-size: 16px; /* Increased base font size for readability */
    transition: var(--transition);
}

.container {
    max-width: 1200px; /* Adjusted max-width */
    margin: 0 auto;
    padding: var(--space-4);  /* Consistent padding */
}

/* Typography */
h1 {
    font-size: 2.25rem;    /* Slightly larger */
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-3);
}

h2 {
    font-size: 1.75rem;    /* Slightly larger */
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-4);
}

h3 {
    font-size: 1.3rem;      /* Slightly larger */
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-3);
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-light);
    text-decoration: underline; /* Subtle underline on hover */
}

/* Header */
header {
    padding: var(--space-6) 0;  /* Reduced padding */
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-6);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);      /* Reduced gap */
}

.logo {
    font-size: 1.75rem;    /* Slightly larger logo */
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);    /* Reduced gap */
}

.nav-links {
    display: flex;
    gap: var(--space-3);    /* Reduced gap */
    list-style: none;
}

.nav-links a {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-weight: 400;      /* Lighter font weight */
    transition: var(--transition);
    color: var(--text-secondary); /* Muted link color */
}

.nav-links a:hover {
    background: var(--bg-secondary); /* Lighter background on hover */
    color: var(--text);
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4); /* Slight increase */
    font-size: 1rem;        /* More readable */
    font-weight: 400;      /* Lighter */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    background: var(--bg-secondary);
    border-color: var(--gray-300);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: white;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
    color: white;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: white;
}

.btn-sm {
    padding: var(--space-2) var(--space-3); /* Adjusted */
    font-size: 0.875rem;    /* More readable */
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);    /* Softer corners */
    padding: var(--space-6);
    box-shadow: 0 1px 2px var(--shadow); /* Very subtle shadow */
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 3px 5px var(--shadow); /* Slightly more pronounced hover effect */
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: 0.9rem;      /* More readable label */
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3);
    font-size: 1rem;        /* More readable input */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: var(--space-4);
    border-left: 4px solid;
}

.alert-success {
    background: #ecfdf5;
    border-color: var(--success);
    color: #065f46;
}

.alert-error {
    background: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert-info {
    background: #eff6ff;
    border-color: var(--primary);
    color: #1e40af;
}

/* Grid */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Stats */
.stat-card {
    text-align: center;
    padding: var(--space-6) var(--space-4);  /* Slightly reduced padding */
}

.stat-number {
    font-size: 2.5rem;    /* Reduced size */
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: 0.8rem;      /* More subtle */
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;      /* More readable table */
}

.table th {
    padding: var(--space-3);
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.table tr:hover {
    background: var(--bg-secondary);
}

/* Lists */
.list {
    list-style: none;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.list-item:hover {
    background: var(--bg-secondary);
}

.list-item:last-child {
    border-bottom: none;
}

/* Friends */
.friend-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.friend-item:hover {
    border-color: var(--gray-300);
    box-shadow: 0 1px 3px var(--shadow); /* Subtle shadow on hover */
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.friend-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.friend-status {
    margin-top: var(--space-1);
    font-size: 0.875rem;
}

.friend-actions {
    display: flex;
    gap: var(--space-2);
}

.status-online { color: var(--success); }
.status-offline { color: var(--danger); }
.status-unknown { color: var(--text-muted); }

/* Chart */
.chart-container {
    position: relative;
    height: 300px;
    margin: var(--space-4) 0;
}

.chart-container canvas {
    max-height: 100%;
}

/* Loading */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-4 { padding: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

.hidden { display: none; }
.block { display: block; }

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--gray-900);
    color: var(--gray-100);       /* Light text on dark background */
    padding: var(--space-3) 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 0.875rem;
}

.cookie-banner a {
    color: var(--primary-light);
    text-decoration: underline; /* Clear distinction for links */
}

.cookie-banner.hidden {
    display: none;
}

/* Footer Styles */
footer {
    padding: var(--space-4) 0;   /* Consistent padding */
    border-top: 1px solid var(--border); /* Subtle border */
    margin-top: var(--space-6);
}

footer p {
    color: var(--text-muted);   /* Muted footer text */
}

footer .text-muted {
    color: var(--gray-400);   /* Use gray-400 from variables */
}


/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-3);
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .nav {
        flex-direction: column;
        gap: var(--space-4);
    }

    .friend-item {
        flex-direction: column;
        gap: var(--space-3);
        align-items: flex-start;
    }

    .friend-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .stat-number {
        font-size: 2rem;
    }
}