@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* =========================================
   1. ПЕРЕМЕННЫЕ И ТЕМЫ
   ========================================= */
:root {
    /* --- СВЕТЛАЯ ТЕМА --- */
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-input: #f1f5f9;      /* Светлый фон полей */

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-on-accent: #ffffff;

    --border: #e2e8f0;        /* Светлая граница */
    --border-hover: #cbd5e1;

    --primary: #4f46e5;       /* Indigo 600 */
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.3);
    --primary-light-bg: rgba(79, 70, 229, 0.1); /* Фон для тэгов */
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius: 12px;
    --header-height: 70px;
    --sidebar-width: 270px;
}

[data-theme="dark"] {
    /* --- ТЕМНАЯ ТЕМА --- */
    --bg-body: #0b0f19;       /* Deep Space */
    --bg-card: rgba(30, 41, 59, 0.6); /* Glass effect base */
    --bg-sidebar: #0f172a;
    --bg-input: #1e293b;      /* Темно-синий фон полей */

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;

    /* ВАЖНО: Граница светлее фона, чтобы поле было видно */
    --border: #334155;
    --border-hover: #475569;

    --primary: #6366f1;       /* Indigo 500 */
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --primary-light-bg: rgba(99, 102, 241, 0.15);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. БАЗОВЫЕ СТИЛИ
   ========================================= */
* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden; /* Можно оставить */
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }

/* Скроллбар */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Классы утилит */
.img-cover { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }

/* =========================================
   3. КОМПОНЕНТЫ UI (Кнопки, Карточки, Алерт)
   ========================================= */

/* Карточки */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.card h3 { margin-top: 0; font-size: 18px; font-weight: 700; margin-bottom: 15px; }

/* Кнопки */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 14px;
    cursor: pointer; border: none; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); gap: 6px;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
    color: #ffffff !important;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--text-muted); background: var(--bg-input); }

.btn-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid transparent; }
.btn-success:hover { background: rgba(16, 185, 129, 0.2); border-color: var(--success); }

.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid transparent; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); border-color: var(--danger); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

/* Бейджи и Алерты */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; display: inline-block; }
.status-active { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-pending { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); border: 1px solid var(--border); }
.status-moderation { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.status-rejected { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

.alert { padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; font-size: 14px; border: 1px solid transparent; }
.alert-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; border-color: rgba(245, 158, 11, 0.2); }
.alert-success { background: rgba(16, 185, 129, 0.1); color: #059669; border-color: rgba(16, 185, 129, 0.2); }

/* Таблицы */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { text-align: left; padding: 12px 16px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-main); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover { background: var(--bg-input); }

/* =========================================
   4. ФОРМЫ И INPUTS (ГЛАВНЫЙ ФИКС)
   ========================================= */
label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* Базовый стиль полей */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], select, textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-input); /* Цвет зависит от темы */
    border: 1px solid var(--border);   /* Цвет зависит от темы */
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    transition: 0.2s;
    font-family: inherit;
    box-sizing: border-box;

    /* ФИКС БЕЛЫХ УГЛОВ */
    background-clip: padding-box;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
}

/* Плейсхолдер */
::placeholder { color: var(--text-muted); opacity: 0.7; }

/* Фокус */
input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background-color: var(--bg-card);
    outline: none;
}

/* Отключенные поля */
input:disabled, select:disabled, textarea:disabled {
    background-color: var(--bg-body); /* Темнее в темной теме */
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
    border-color: var(--border);
}

/* Хак для автозаполнения Chrome (Autofill) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--text-main);

    /* Сохраняем скругление при автозаполнении */
    border-radius: 8px !important;
    background-clip: padding-box !important;
    border: 1px solid var(--border) !important;
}

/* =========================================
   5. ГЕОГРАФИЯ И ТЭГИ
   ========================================= */

/* Контейнер подсказок */
.autocomplete-wrapper { position: relative; width: 100%; }

/* Выпадающий список (Без границ, с тенью) */
.autocomplete-items {
    position: absolute;
    border: none;
    z-index: 99;
    top: 100%; left: 0; right: 0;
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-height: 250px;
    overflow-y: auto;
    margin-top: 4px;
}

.autocomplete-items div {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    font-size: 14px;
    color: var(--text-main);
    transition: background 0.2s;
}

.autocomplete-items div:hover {
    background-color: var(--bg-input);
    color: var(--primary);
    border-radius: 4px;
}

/* Тэги (Города) */
.loc-tag, .city-tag {
    display: inline-flex; align-items: center;
    background: var(--primary-light-bg);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px; font-weight: 500;
    margin-right: 5px; margin-bottom: 5px;
    border: 1px solid var(--primary-glow);
}
.loc-tag b { margin-right: 5px; color: var(--text-main); font-weight: 600; }
.loc-tag span.remove-loc:hover { opacity: 1; color: var(--danger); cursor: pointer; }

/* Галерея аватаров */
.avatars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; margin-top: 10px; }
.avatar-option { width: 100%; aspect-ratio: 1/1; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: 0.2s; object-fit: cover; }
.avatar-option:hover { transform: scale(1.1); border-color: var(--primary); }
.avatar-option.selected { border-color: var(--success); box-shadow: 0 0 0 2px var(--success); transform: scale(1.05); }

/* =========================================
   6. ЛЕЙАУТ (SIDEBAR + MAIN)
   ========================================= */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0;
    z-index: 50; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex; align-items: center; padding: 0 24px;
    border-bottom: 1px solid var(--border);
}
.nav-links { flex: 1; padding: 20px 12px; overflow-y: auto; }

.nav-group-title {
    font-size: 11px; text-transform: uppercase; color: var(--text-muted);
    font-weight: 800; letter-spacing: 1px; margin: 15px 20px 5px;
}
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; color: var(--text-muted); font-weight: 600;
    border-radius: 8px; margin-bottom: 2px; transition: all 0.2s;
}
.nav-link:hover { background-color: var(--bg-input); color: var(--text-main); }
.nav-link.active { background: var(--primary); color: #ffffff; box-shadow: 0 4px 12px var(--primary-glow); }
.nav-link span { font-size: 16px; }
.nav-divider { height: 1px; background: var(--border); margin: 15px 20px; opacity: 0.5; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px 40px;
    width: 100%; max-width: 100%; min-height: 100vh;
    background-color: var(--bg-body);
}

/* =========================================
   7. СТРАНИЦЫ (DASHBOARD, AUTH, LANDING)
   ========================================= */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-box { background: var(--bg-card); padding: 20px; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-main); }

.hero { text-align: center; padding: 100px 20px; background: radial-gradient(circle at 50% -20%, var(--primary-glow), transparent 70%); }
.hero h1 { font-size: 3.5rem; font-weight: 900; margin-bottom: 20px; letter-spacing: -1px; }
.hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; }

/* Соцсети (Auth) */
.social-grid { display: flex; justify-content: center; gap: 12px; margin-bottom: 24px; }
.btn-social-wrap { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-body); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.05); text-decoration: none; position: relative; }
.btn-social-wrap:hover { border-color: var(--primary); transform: translateY(-2px); background: var(--bg-card); }
.btn-social-wrap img, .btn-social-wrap svg { width: 24px; height: 24px; display: block; }

/* =========================================
   8. БРЕНДИНГ И ПРОФИЛЬ
   ========================================= */
.logo { display: flex; align-items: center; gap: 0; text-decoration: none; user-select: none; }
.logo-img { height: 44px; width: auto; display: block; margin-right: -4px; z-index: 2; transition: 0.3s; }
.logo:hover .logo-img { transform: scale(1.05); }
.logo-text { font-family: 'Inter', system-ui, sans-serif; font-weight: 900; font-size: 24px; letter-spacing: -1px; text-transform: uppercase; line-height: 1; padding-left: 4px; transition: 0.3s; }

:root .logo-text { color: var(--primary); }
:root .logo-img { background-color: var(--primary); -webkit-mask-image: url('../img/logo.png'); mask-image: url('../img/logo.png'); -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }

[data-theme="dark"] .logo-text { color: #ffffff; text-shadow: 0 0 5px rgba(99, 102, 241, 0.3); }
[data-theme="dark"] .logo-img { background-color: #ffffff; filter: drop-shadow(0 0 2px rgba(99, 102, 241, 0.3)); }
[data-theme="dark"] .logo:hover .logo-text { text-shadow: 0 0 5px #fff, 0 0 15px var(--primary), 0 0 30px var(--primary); }
[data-theme="dark"] .logo:hover .logo-img { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 10px var(--primary)) drop-shadow(0 0 25px var(--primary)); }

/* Шапка профиля */
.profile-header-card { position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.profile-cover { height: 200px; width: 100%; background: linear-gradient(135deg, #6366f1, #a855f7); background-size: cover; background-position: center; position: relative; }
.cover-upload-btn { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.5); color: #fff; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; transition: 0.2s; backdrop-filter: blur(4px); display: flex; align-items: center; gap: 5px; opacity: 0; }
.profile-cover:hover .cover-upload-btn { opacity: 1; }
.profile-info-section { padding: 0 30px 20px; display: flex; align-items: flex-end; position: relative; margin-top: -50px; gap: 20px; flex-wrap: wrap; }
.profile-avatar-wrap { position: relative; width: 140px; height: 140px; border-radius: 50%; border: 4px solid var(--bg-card); background: var(--bg-card); overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.profile-details { flex: 1; margin-bottom: 10px; margin-top: 50px; }
.profile-name { font-size: 24px; font-weight: 800; color: var(--text-main); margin: 0; display: flex; align-items: center; gap: 8px; }
.profile-bio { color: var(--text-muted); font-size: 14px; margin-top: 5px; max-width: 600px; }
.profile-stats-row { display: flex; gap: 30px; margin-top: 15px; }
.profile-nav { display: flex; border-top: 1px solid var(--border); padding: 0 20px; overflow-x: auto; }
.p-nav-item { padding: 15px 20px; color: var(--text-muted); font-weight: 600; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; transition: 0.2s; }
.p-nav-item:hover { color: var(--primary); }
.p-nav-item.active { color: var(--primary); border-bottom-color: var(--primary); }

/* =========================================
   9. ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ & АДАПТИВ
   ========================================= */
.theme-toggle-btn { background: transparent; border: 1px solid var(--border); color: var(--text-main); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; padding: 0; }
.theme-toggle-btn:hover { border-color: var(--primary); background: var(--bg-input); box-shadow: 0 0 10px var(--primary-glow); }
.theme-icon { position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1); }
:root[data-theme="light"] .icon-sun { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); fill: var(--text-main); }
:root[data-theme="light"] .icon-moon { opacity: 0; transform: translate(-50%, -50%) rotate(90deg) scale(0.5); fill: var(--text-main); }
:root[data-theme="dark"] .icon-sun { opacity: 0; transform: translate(-50%, -50%) rotate(-90deg) scale(0.5); }
:root[data-theme="dark"] .icon-moon { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1); fill: #ffffff; }

.mobile-toggle { display: none; background: none; border: none; font-size: 24px; color: var(--text-main); cursor: pointer; }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 40; backdrop-filter: blur(4px); }

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: block; }
    .mobile-header { display: flex !important; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
    .geo-inputs { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .profile-info-section { flex-direction: column; align-items: center; text-align: center; margin-top: -60px; }
    .profile-details { margin-top: 10px; }
    .profile-stats-row { justify-content: center; }
    .profile-nav { justify-content: center; }
}

/* =========================================
   ФУТЕР (FOOTER)
   ========================================= */
.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 60px 20px 0; /* Отступ снизу 0, так как есть блок копирайта */
    margin-top: auto;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* 4 колонки */
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 10px;
}

.footer-title {
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px; /* Эффект сдвига при наведении */
}

/* Копирайт (Нижняя полоска) */
.footer-copyright {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    background: var(--bg-body); /* Чуть темнее/светлее основного фона карточки */
}

.copyright-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

/* АДАПТИВНОСТЬ ФУТЕРА */
@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: 1fr 1fr; /* 2 колонки на планшетах */
    }
}

@media (max-width: 600px) {
    .footer-container {
        grid-template-columns: 1fr; /* 1 колонка на телефонах */
        text-align: center;
    }

    .footer-logo, .footer-col .logo {
        justify-content: center !important;
    }

    .copyright-inner {
        flex-direction: column;
        text-align: center;
    }
}