:root {
    /* Цветовая гамма */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-lighter: #dbeafe;
    --secondary: #7c3aed;
    --accent: #ec4899;
    --success: #10b981;
    --success-dark: #0da371;
    --warning: #f59e0b;

    /* Светлая тема */
    --page-bg: #ffffff;
    --page-text: #1f2937;
    --page-border: #e5e7eb;

    --white: #ffffff;
    --light-bg: #f9fafb;
    --card-bg: #ffffff;
    --card-hover: #f3f4f6;
    --border-light: #e5e7eb;
    --border: #d1d5db;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;

    --sidebar-bg: #ffffff;
    --sidebar-border: #e5e7eb;
    --sidebar-text: #111827;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 999px;

    --transition-fast: all 0.15s ease;
    --transition: all 0.25s ease;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Тёмная тема */
body.dark-theme {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-lighter: #1e3a8a;

    --page-bg: #0f172a;
    --page-text: #cbd5e1;
    --page-border: #334155;

    --white: #0f172a;
    --light-bg: #1e293b;
    --card-bg: #1e293b;
    --card-hover: #334155;
    --border-light: #334155;
    --border: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;

    --sidebar-bg: #1e293b;
    --sidebar-border: #334155;
    --sidebar-text: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--light-bg);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-y: auto;
    height: 100%;
}

/* ========== ШАПКА ДЛЯ МОБИЛЬНОЙ ВЕРСИИ ========== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
    z-index: 200;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
}

.mobile-header .logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-header .logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
}

.mobile-header .sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--sidebar-text);
    font-family: 'Inter', sans-serif;
}

.mobile-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-stars-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    background: var(--sidebar-hover-bg, rgba(0,0,0,0.05));
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #333);
    transition: opacity 0.2s;
}

.mobile-stars-badge:hover {
    opacity: 0.8;
}

.mobile-stars-badge .mobile-stars-count {
    line-height: 1;
}

/* ========== ЛЕВАЯ ПАНЕЛЬ ========== */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--sidebar-text);
    font-family: 'Inter', sans-serif;
}



.sidebar-header a {

    text-decoration: none !important;
}

/* .sidebar-title-dot{
    color: var(--accent, #7c5cfc);
} */

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--light-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.theme-toggle:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Кнопка меню для мобильной версии */
.menu-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--light-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.menu-toggle:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Навигация в сайдбаре - сверху */
.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    border-bottom: 1px solid var(--sidebar-border);
}

.nav-item {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.nav-item:hover {
    background: var(--primary-lighter);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
}

/* ===== БЛОК ИНФОРМАЦИИ О ТАРИФЕ ===== */
.tariff-info-block {
    padding: 16px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.info-row i {
    width: 16px;
    font-size: 14px;
}

.info-row i.fa-crown {
    color: var(--primary);
}

.info-row i.fa-file-alt {
    color: var(--success);
}

.info-row i.fa-calendar-alt {
    color: var(--warning);
}

.info-row strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 4px;
}

/* ===== БЛОК ДОСТУПНЫХ СТРАНИЦ (АДАПТИРОВАННЫЙ ДИЗАЙН) ===== */
.available-pages-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin: 0;
}

.available-pages-block i {
    color: var(--success);
    font-size: 16px;
    width: 16px;
}

.available-label {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

.available-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--light-bg);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    min-width: 40px;
    text-align: center;
}

/* Блок "Докупить страницы" */
.buy-pages-info {
    padding: 16px 20px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.buy-pages-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.buy-pages-icon {
    width: 36px;
    height: 36px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

.buy-pages-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.buy-pages-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.buy-pages-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
}

.buy-pages-btn {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
}

.buy-pages-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.buy-pages-btn i {
    font-size: 14px;
}

/* Блок с языком */
.language-selector {
    padding: 12px 16px;
    margin-top: auto;
    border-top: 1px solid var(--sidebar-border);
    background: var(--light-bg);
}

.language-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.language-current:hover {
    border-color: var(--primary);
}

.language-flag {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.language-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.language-chevron {
    color: var(--text-tertiary);
    font-size: 11px;
    transition: transform 0.2s ease;
}

.language-current:hover .language-chevron {
    transform: translateX(2px);
}

/* Кнопка выхода */
.nav-item.exit {
    color: var(--accent);
}

.nav-item.exit:hover {
    background: rgba(236, 72, 153, 0.1);
}

/* Мобильная версия меню */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Плавный переход темы */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Класс для скрытия элементов на мобильных устройствах */
.desktop-only {
    display: flex; /* или display: block, в зависимости от контекста */
}

/* ===== ССЫЛКА НА ПРОМОКОД ===== */
.promo-code-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    background: transparent;
    border: 1px dashed var(--border);
}

.promo-code-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-lighter);
}

.promo-code-link i {
    font-size: 14px;
}

/* ===== МОДАЛЬНОЕ ОКНО ПРОМОКОДА ===== */
.promo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.promo-modal.active {
    display: flex;
}

.promo-modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    animation: promo-modal-appear 0.2s ease;
}

@keyframes promo-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.promo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--light-bg);
}

.promo-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.promo-modal-header h3 i {
    color: var(--primary);
}

.promo-modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.promo-modal-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.promo-modal-body {
    padding: 20px;
}

.promo-modal-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    text-align: center;
}

.promo-input-group {
    display: flex;
    gap: 8px;
}

.promo-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
    text-transform: uppercase;
}

.promo-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lighter);
}

.promo-input::placeholder {
    color: var(--text-tertiary);
    text-transform: none;
}

.promo-apply-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.promo-apply-btn:hover {
    background: var(--primary-dark);
}

.promo-apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.promo-message {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    display: none;
}

.promo-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.promo-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

body.dark-theme .promo-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

body.dark-theme .promo-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Мобильная версия (до 768px) */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important; /* Скрываем на мобильных */
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        top: 56px;
        bottom: 0;
        height: calc(100% - 56px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 150;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .mobile-menu-overlay {
        top: 56px;
    }
}

