:root {
    /* Backgrounds */
    --color-bg-primary: #111827; /* Darkest gray, main background */
    --color-bg-secondary: #1F2937; /* Slightly lighter gray, for alternate sections/cards */
    --color-header-bg: #111827; /* Header background, will use opacity */
    --color-dropdown-bg: #111827; /* Dropdown background, matching primary bg */
    
    /* Gradient backgrounds */
    --gradient-bg-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #111827 50%, #1f2937 75%, #0f172a 100%);
    --gradient-bg-secondary: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1f2937 100%);

    /* Text Colors */
    --color-text-light: #FFFFFF; /* Pure white for main text */
    --color-text-medium: #D1D5DB; /* Lighter gray for secondary text (text-gray-300) */
    --color-text-dark: #9CA3AF; /* Darker gray for muted text (text-gray-400) */

    /* Accent Colors (Blue/Purple tech theme) */
    --color-accent-blue-light: #60A5FA; /* From text-blue-400 */
    --color-accent-blue-medium: #3B82F6; /* From focus:ring-blue-500, profile border */
    --color-accent-blue-dark: #2563EB; /* From bg-blue-600 */
    --color-accent-purple: #8B5CF6; /* From to-purple-500 in gradient */

    /* NEW: Tariff Colors */
    --color-tariff-free-trial: #22C55E; /* green-500 from Tailwind */
    --color-tariff-basic: #3B82F6; /* blue-500 from Tailwind */
    --color-tariff-professional: #8B5CF6; /* purple-500 from Tailwind */

    /* Borders & Shadows */
    --color-border-subtle: #374151; /* From border-gray-700 for inputs */
    --color-border-accent: #3B82F6; /* For profile image border */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* Tailwind shadow-sm */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* Tailwind shadow-md */
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Tailwind shadow-lg */
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* Tailwind shadow-xl */
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25); /* Tailwind shadow-2xl */

    /* General */
    --radius-sm: 0.25rem; /* rounded-sm */
    --radius-md: 0.375rem; /* rounded-md */
    --radius-lg: 0.5rem; /* rounded-lg */
    --radius-xl: 0.75rem; /* rounded-xl */
    --radius-full: 9999px; /* rounded-full */
    --transition-fast: all 0.15s ease-in-out;
    --transition-medium: all 0.3s ease-in-out;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Header Root Container */
#header-root {
    position: relative;
    z-index: 50;
}

#header-root header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    width: 100%;
}

/* Main content padding to account for fixed header */
#mainContent {
    padding-top: 80px;
}

@media (max-width: 768px) {
    #mainContent {
        padding-top: 70px;
    }
}

/* Mobile menu styles */
#header-root .md\:hidden {
    display: none !important;
}

@media (max-width: 767px) {
    #header-root .md\:hidden {
        display: flex !important;
    }
    
    #header-root .hidden.md\:flex {
        display: none !important;
    }
}

/* Mobile menu dropdown */
#header-root .md\:hidden.bg-white\/95 {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: slideDown 0.3s ease-out;
}

.dark #header-root .md\:hidden.bg-white\/95 {
    background: rgba(3, 7, 18, 0.95) !important;
}

/* Исправление для светлой темы мобильного меню */
html:not(.dark) #header-root .md\:hidden.bg-white\/95 {
    background: rgba(255, 255, 255, 0.98) !important;
}

/* Mobile menu animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация рисования графика для логотипа */
#header-root .group .animate-graph-draw {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    transition: filter 0.2s;
    filter: drop-shadow(0 0 0 #fff0);
}
#header-root .group:hover .animate-graph-draw {
    animation: graph-draw 0.5s cubic-bezier(0.6,0,0.4,1) forwards;
    filter: drop-shadow(0 0 8px #fff8);
}
@keyframes graph-draw {
    to { stroke-dashoffset: 0; }
}
#header-root .group .animate-graph-arrow {
    opacity: 0;
    transition: opacity 0.2s;
}
#header-root .group:hover .animate-graph-arrow {
    animation: graph-arrow-fadein 0.2s 0.45s linear forwards;
}
@keyframes graph-arrow-fadein {
    to { opacity: 1; }
}


/* Mobile menu buttons - disable transform on auth buttons */
#header-root .md\:hidden button {
    transition: all 0.2s ease;
}

#header-root .md\:hidden button:hover {
    transform: translateY(-1px);
}

/* Disable transform on mobile auth buttons */
#header-root .md\:hidden button[onclick*="profile"],
#header-root .md\:hidden button[onclick*="login"],
#header-root .md\:hidden button[onclick*="signup"],
#header-root .md\:hidden button[onclick*="logout"] {
    transform: none !important;
}

#header-root .md\:hidden button[onclick*="profile"]:hover,
#header-root .md\:hidden button[onclick*="login"]:hover,
#header-root .md\:hidden button[onclick*="signup"]:hover,
#header-root .md\:hidden button[onclick*="logout"]:hover {
    transform: none !important;
}

#header-root .md\:hidden button[onclick*="profile"]:active,
#header-root .md\:hidden button[onclick*="login"]:active,
#header-root .md\:hidden button[onclick*="signup"]:active,
#header-root .md\:hidden button[onclick*="logout"]:active {
    transform: none !important;
}

/* Theme toggle animation */
#header-root button[aria-label="Toggle theme"] {
    position: relative;
    overflow: hidden;
}

#header-root button[aria-label="Toggle theme"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

#header-root button[aria-label="Toggle theme"]:hover::before {
    width: 40px;
    height: 40px;
}

/* Mobile menu links */
#header-root .md\:hidden .block {
    display: block !important;
}

/* Mobile menu buttons */
#header-root .md\:hidden button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Desktop header actions visibility */
@media (min-width: 768px) {
    .hidden.md\:flex {
        display: flex !important;
    }
    
    #header-root [class*="md:hidden"] {
        display: none !important;
    }
}

/* Mobile header actions visibility */
@media (max-width: 767px) {
    .md\:hidden {
        display: flex !important;
    }
    
    .hidden.md\:flex {
        display: none !important;
    }
}

/* Скрываем старые элементы header для совместимости */
.header,
.nav-container,
.brand,
.menu-section,
.nav-link,
.auth-buttons,
.auth-btn,
.profile-btn,
.dropdown-content,
.header-hamburger {
    display: none !important;
}

/* Enhanced desktop navigation */
#header-root nav {
    transition: all 0.3s ease;
}

#header-root nav a {
    position: relative;
    overflow: hidden;
}

#header-root nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

#header-root nav a:hover::before {
    width: 80%;
}

/* Enhanced logo hover */
#header-root .group:hover .bg-brand-600 {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Logo container styles */
#header-root .group {
    transition: all 0.3s ease;
}

#header-root .group:hover {
    transform: translateY(-1px);
}

#header-root .group .bg-brand-600 {
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

#header-root .group:hover .bg-brand-600 {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Mobile menu improvements */
#header-root .md\:hidden .flex-col {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth buttons hover effects - transform disabled */
#header-root .bg-brand-600:hover {
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.3);
    transform: none;
}

#header-root .bg-red-600:hover {
    box-shadow: 0 10px 20px -5px rgba(239, 68, 68, 0.3);
    transform: none;
}

/* Disable active state for auth buttons */
#header-root .bg-brand-600:active,
#header-root .bg-red-600:active {
    transform: none !important;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.3) !important;
}

/* Glass effect enhancement */
#header-root .glass {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Дополнительные стили для светлой темы шапки */
html:not(.dark) #header-root .glass {
    background: rgba(255, 255, 255, 0.9) !important;
}

html:not(.dark) #header-root .bg-slate-100\/50 {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

html:not(.dark) #header-root .bg-white\/95 {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

/* Glass эффект для шапки в состоянии покоя */
html:not(.dark) #header-root header.glass {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

.dark #header-root header.glass {
    background: rgba(17, 24, 39, 0.8) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

/* Ripple effect styles - DISABLED for auth buttons */
#header-root button {
    position: relative;
    overflow: hidden;
}

#header-root button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

/* Disable ripple effect on auth buttons */
#header-root button[onclick*="profile"],
#header-root button[onclick*="login"],
#header-root button[onclick*="signup"],
#header-root button[onclick*="logout"] {
    overflow: visible;
}

 #header-root button[data-profile-button] {
     overflow: visible !important;
 }

 #header-root button[data-profile-button]::after {
     display: none !important;
 }

#header-root button[onclick*="profile"]::after,
#header-root button[onclick*="login"]::after,
#header-root button[onclick*="signup"]::after,
#header-root button[onclick*="logout"]::after {
    display: none;
}

/* Disable active state animations for all buttons except theme toggle */
#header-root button:not([aria-label="Toggle theme"]):active {
    transform: none !important;
}

#header-root button:not([aria-label="Toggle theme"]):active::after {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

#header-root button:active::after {
    width: 300px;
    height: 300px;
}

#header-root .header-nav-item {
    position: relative;
}

#header-root .header-nav-item::before {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    border-radius: 9999px;
    background: #4f46e5;
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    pointer-events: none;
}

.dark #header-root .header-nav-item::before {
    background: #818cf8;
}

#header-root .header-nav-item:hover::before {
    transform: scaleX(1);
    opacity: 1;
}

#header-root .header-nav-item.bg-brand-600::before {
    opacity: 0;
}

/* Enhanced mobile menu styles */
#header-root .md\:hidden .flex-col {
    min-height: auto;
    justify-content: flex-start;
}

#header-root .md\:hidden .flex-col > * {
    animation: slideInUp 0.3s ease-out forwards;
    opacity: 0;
}

#header-root .md\:hidden .flex-col > *:nth-child(1) { animation-delay: 0.1s; }
#header-root .md\:hidden .flex-col > *:nth-child(2) { animation-delay: 0.15s; }
#header-root .md\:hidden .flex-col > *:nth-child(3) { animation-delay: 0.2s; }
#header-root .md\:hidden .flex-col > *:nth-child(4) { animation-delay: 0.25s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced scroll effect */
#header-root header {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Better focus states - disable for auth buttons */
#header-root button:focus-visible,
#header-root a:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 4px;
}

#header-root button[onclick*="profile"]:focus-visible,
#header-root button[onclick*="login"]:focus-visible,
#header-root button[onclick*="signup"]:focus-visible,
#header-root button[onclick*="logout"]:focus-visible {
    outline: none;
}

.dark #header-root button:focus-visible,
.dark #header-root a:focus-visible {
    outline-color: #818cf8;
}

/* Loading states */
#header-root .loading {
    position: relative;
    pointer-events: none;
}

#header-root .loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading-shine 1.5s infinite;
}

@keyframes loading-shine {
    to {
        left: 100%;
    }
}

/* Mobile menu backdrop */
#header-root .md\:hidden.bg-white\/95::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
    animation: fadeIn 0.3s ease-out;
}

 /* Prevent any md:hidden ::before overlay from affecting the balance pill */
 #header-root [data-balance-pill]::before {
     content: none !important;
     display: none !important;
 }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Единое правило для фона body - УДАЛЕНО КОНФЛИКТУЮЩИЕ ПРАВИЛА */
html body {
    font-family: 'Inter', sans-serif;
    color: var(--color-text-light);
    background: transparent !important;
    min-height: 100vh;
    position: relative;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--color-text-light);
    background: transparent !important;
    min-height: 100vh;
    position: relative;
}

/* Единый градиентный фон для html элемента - ФИКСИРОВАННЫЙ */
html {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #111827 50%, #1f2937 75%, #0f172a 100%) !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    min-height: 100vh;
}

/* Градиент для светлой темы - ФИКСИРОВАННЫЙ */
html:not(.dark) {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%, #f8fafc 100%) !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
}

/* УДАЛЕНО: дублирующие градиентные правила которые создавали разделение фона */

/* Добавляем анимированные фоновые элементы как в login.php */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 10%;
    left: 5%;
    width: 12rem;
    height: 12rem;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 50%;
    filter: blur(3rem);
    animation: pulse 4s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

/* Дополнительные анимированные элементы */
.animated-bg-1 {
    position: fixed;
    bottom: 10%;
    right: 5%;
    width: 16rem;
    height: 16rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(34, 197, 94, 0.2));
    border-radius: 50%;
    filter: blur(3rem);
    animation: pulse 4s ease-in-out infinite 1s;
    z-index: -1;
    pointer-events: none;
}

.animated-bg-2 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14rem;
    height: 14rem;
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.1), rgba(249, 115, 22, 0.1));
    border-radius: 50%;
    filter: blur(3rem);
    animation: pulse 4s ease-in-out infinite 0.5s;
    z-index: -1;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Адаптивность для анимированных элементов */
@media (max-width: 768px) {
    body::after {
        width: 8rem;
        height: 8rem;
        top: 5%;
        left: 2%;
    }
    
    .animated-bg-1 {
        width: 10rem;
        height: 10rem;
        bottom: 5%;
        right: 2%;
    }
    
    .animated-bg-2 {
        width: 8rem;
        height: 8rem;
    }
}

body.loaded {
    opacity: 1;
    visibility: visible;
}

.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: auto; /* Align with the right edge of the profile-btn by default */
    right: 0; /* Align with the right edge of the profile-btn by default */
    background: var(--color-dropdown-bg); /* Dark background */
    border: 1px solid var(--color-border-subtle); /* Subtle border */
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: unset; /* Remove min-width to allow shrinking */
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 9999; /* Устанавливаем высокий z-index, чтобы он был под шапкой, но над контентом */
    padding: 0;
}

.dropdown-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Ensure it animates correctly when active */
}

.settings-dropdown .dropdown-content {
    left: auto;
    right: 100%;
    top: 0;
    margin-right: 0;
    background: var(--color-dropdown-bg);
    transition: var(--transition-medium);
}

.profile-btn {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the icon horizontally */
    gap: 0; /* No gap needed if only icon is present */
    padding: 8px; /* Adjusted padding to make it a square button */
    width: 48px; /* Set a fixed width for the circular button */
    height: 48px; /* Set a fixed height for the circular button */
    border-radius: var(--radius-full); /* Make it perfectly round */
    background: var(--color-bg-secondary); /* Slightly lighter background for profile button */
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    color: var(--color-text-light); /* Light text */
}

.profile-btn:hover {
    background: #2D3A4B; /* Even darker on hover */
}

.user-details {
    display: none; /* Hide the user details div by default as it's now in dropdown */
}

.user-details-dropdown {
    text-align: left;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-light);
}

.user-email {
    font-size: 0.8rem;
    color: var(--color-text-dark); /* text-gray-400 */
}

.dropdown-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
    stroke: var(--color-text-light); /* Light icon color */
}

/* Hamburger Menu */
.header-hamburger {
    /* display: flex !important; */ /* Гарантируем отображение на мобильных */
    order: 1;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 100001; /* Увеличено, чтобы быть выше всех других элементов в хедере */
    width: 48px;
    height: 48px;
    display: flex; /* Используем flex для центрирования содержимого */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative; /* Добавляем relative для абсолютного позиционирования span */
    transition: all 0.3s ease-in-out;
}

.header-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text-light); /* Light lines */
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
    position: absolute; /* Делаем линии абсолютно позиционированными */
    left: 50%; /* Центрируем по горизонтали */
    transform: translateX(-50%); /* Корректируем для точного центрирования */
}

.header-hamburger span:nth-child(1) {
    top: 15px; /* Верхняя линия */
}

.header-hamburger span:nth-child(2) {
    top: 23px; /* Средняя линия */
}

.header-hamburger span:nth-child(3) {
    top: 31px; /* Нижняя линия */
}

/* Hamburger Animation */
.header-hamburger.active span:nth-child(1) {
    top: 23px; /* Перемещаем верхнюю линию в центр */
    transform: translateX(-50%) rotate(45deg);
}
.header-hamburger.active span:nth-child(2) {
    opacity: 0;
}
.header-hamburger.active span:nth-child(3) {
    top: 23px; /* Перемещаем нижнюю линию в центр */
    transform: translateX(-50%) rotate(-45deg);
}

.dropdown-content .nav-link {
    color: var(--color-text-medium) !important;
    padding: 10px 16px;
}

.dropdown-content .nav-link:hover {
    background: var(--color-bg-secondary); /* Slightly lighter background on hover */
    color: var(--color-text-light) !important;
}

.logout-btn {
    text-align: left;
    background: none;
    border: none;
    width: 100%;
    padding: 10px 16px;
    color: var(--color-text-medium) !important;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.logout-btn:hover {
    background: var(--color-bg-secondary) !important;
    color: var(--color-text-light) !important;
}

/* Media Queries for Responsiveness (kept similar to original) */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
        height: 64px;
        justify-content: space-between;
    }

    .brand {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--color-text-light) !important;
        text-decoration: none;
        position: absolute;
        left: 50%;
        transform: translateX(-50%); /* Keep simple centering for mobile */
        order: 2;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    .brand-logo {
        height: 32px;
    }

    .header-hamburger {
        /* display: flex !important; */ /* Гарантируем отображение на мобильных */
        order: 1;
    }

    .right-menu {
        /* display: none !important; Удалено */
        order: 3;
        margin-left: auto; /* Добавлено, чтобы прижать вправо */
        padding-left: 31px; /* Увеличиваем отступ слева для дополнительного смещения */
    }

    .profile-btn {
        background: none;
        padding: 8px;
        gap: 0;
        width: 48px;
        height: 48px;
        border-radius: var(--radius-full);
    }

    .user-details {
        display: none !important;
    }

    .user-name {
        font-size: 0.8rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .user-email {
        display: none;
    }

    .dropdown-icon {
        display: block !important;
        width: 24px;
        height: 24px;
    }

    .left-menu .auth-buttons {
        display: flex; /* Показываем на мобильных в открытом меню */
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--color-border-subtle);
    }

    .left-menu .auth-buttons .auth-btn {
        width: 100%;
        text-align: center;
        min-width: unset; /* Ensure it takes full width without min-width */
        padding: 12px 20px;
        font-size: 1rem;
        height: auto;
        border-width: 1px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .left-menu .nav-link {
        width: 100%;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .left-menu .nav-link:last-child {
        border-bottom: none;
    }

    .dropdown-content {
        right: 0;
        left: auto;
        top: calc(100% + 10px);
        transform: translateY(-10px);
        z-index: 9999;
        min-width: unset; /* Remove min-width to allow shrinking */
        display: none; /* Add this to ensure dropdown is hidden by default on mobile */
    }
    
    .dropdown-content.active {
        display: block; /* Show dropdown when active */
        transform: translateY(0);
    }

    .settings-dropdown .dropdown-content {
        left: 0 !important;
        right: auto !important;
        top: 100% !important;
        margin-top: 5px;
        display: none;
        position: relative;
        background: transparent;
        box-shadow: none;
    }

    .settings-dropdown.active .dropdown-content {
        display: block;
        padding-left: 15px;
    }

    .dashboard-toggle-btn {
        display: none !important; /* Убираем лишнюю иконку на мобильных */
    }

    .rates-section {
        display: none !important; /* Ensure rates section is hidden on mobile */
    }

    /* Corrected mobile-bottom-nav styles */
    .mobile-bottom-nav {
        display: none; /* Скрываем мобильную навигацию по умолчанию, управляем через JS */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 72px; /* Increased height for better tap area */
        background-color: var(--color-bg-secondary); /* Цвет фона */
        box-shadow: 0 -4px 12px rgba(0,0,0,0.25); /* Stronger shadow */
        z-index: 10000;
        justify-content: space-around;
        align-items: center;
        padding: 0 10px;
        border-top: 1px solid var(--color-border-subtle);
        border-top-left-radius: 12px; /* Rounded top corners */
        border-top-right-radius: 12px; /* Rounded top corners */
        max-width: 100vw; /* Ensure mobile nav does not exceed viewport width */
    }

    .mobile-bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--color-text-dark); /* Цвет иконок и текста по умолчанию */
        font-size: 0.8rem; /* Slightly larger font */
        font-weight: 500;
        transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, border-radius 0.2s ease-in-out;
        flex: 1;
        height: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 8px 0; /* Add vertical padding */
        position: relative;
        position: relative;
        overflow: hidden;
        z-index: 1; /* Чтобы псевдоэлемент был под текстом */
    }

    .mobile-bottom-nav-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%; /* Начальное положение за пределами кнопки */
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); /* Белый градиент */
        transition: left 0.5s ease; /* Анимация движения */
        z-index: -1; /* Чтобы псевдоэлемент был под текстом кнопки */
    }

    .mobile-bottom-nav-item:hover {
        color: var(--color-accent-blue-light);
    }

    .mobile-bottom-nav-item:hover::before {
        left: 100%; /* Конечное положение, чтобы градиент "проскользнул" */
    }

    .mobile-bottom-nav-item i {
        font-size: 1.5rem; /* Larger icon size */
        margin-bottom: 6px; /* Adjusted margin */
        color: var(--color-text-dark); /* Default icon color */
        transition: color 0.2s ease-in-out;
    }

    .mobile-bottom-nav-item.active {
        color: var(--color-accent-blue-light); /* Active text color */
        background-color: rgba(59, 130, 246, 0.2); /* Subtle blue background for active item */
        border-radius: 12px; /* Rounded corners for active item */
        margin: 0 4px; /* Slight margin to give space between items */
    }

    .mobile-bottom-nav-item.active i {
        color: var(--color-accent-blue-light); /* Active icon color */
    }
}

@media (max-width: 480px) {

    .profile-btn {
        width: 40px; /* Smaller button for very small screens */
        height: 40px; /* Smaller button for very small screens */
        padding: 6px; /* Adjusted padding */
    }

    .dropdown-icon {
        width: 20px; /* Smaller icon for very small screens */
        height: 20px; /* Smaller icon for very small screens */
    }

    .dropdown-content {
        min-width: 200px; /* Adjusted min-width for smaller screens */
    }
}

/* Footer Styles */
.site-footer {
    background-color: var(--color-bg-primary); /* Dark footer background */
    color: var(--color-text-dark); /* Muted text for footer */
    padding: 2rem 1rem; /* Increased padding slightly */
    text-align: center;
    font-size: 0.85rem; /* Slightly smaller font */
    width: 100%;
}

/* --- General Content Styles (Moved from header.php <style> block) --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 6rem 0; /* Standard section padding */
    border-bottom: 1px solid var(--color-border-subtle); /* Subtle separator */
}
.section:last-child {
    border-bottom: none;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif; /* Keep Montserrat for headings */
    overflow-wrap: break-word;
    word-break: break-word;
    color: var(--color-text-light); /* Light color for all headings */
}
h2 {
    text-align: center;
    font-size: 2.5rem; /* Slightly larger h2 */
    margin-bottom: 2.5rem; /* More space below h2 */
    font-weight: 700; /* Bold */
}
h3 {
    font-size: 1.5rem; /* Larger h3 */
    margin-bottom: 1rem;
    font-weight: 600; /* Semibold */
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 0 4rem 0; /* More padding for hero */
    background-color: var(--color-bg-primary); /* Dark background */
}

.hero img {
    display: block;
    max-width: 40%;
    height: auto;
    margin: 0 auto 2rem auto;
    border-radius: var(--radius-full); /* Rounded full */
    border: 4px solid var(--color-accent-blue-medium); /* Blue border */
    box-shadow: var(--shadow-lg); /* Larger shadow */
}

.hero h1 {
    font-size: 3.5rem; /* Larger h1 */
    margin-bottom: 1rem;
    color: var(--color-text-light);
}
/* Specific style for hero title gradient - needs to be applied directly in header.php */

/* Gradient Text for Hero H1 */
.text-gradient-hero {
    background-image: linear-gradient(to right, var(--color-accent-blue-light), var(--color-accent-purple)); /* blue-400 to purple-500 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback for browsers that don't support text-fill-color */
}

/* Subtitle in Hero Section */
.hero .subtitle {
    font-size: 1.8rem; /* Larger subtitle */
    color: var(--color-text-medium); /* text-gray-300 */
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--color-text-dark); /* text-gray-400 */
    max-width: 700px;
    margin: 0 auto 2rem auto;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem; /* Adjusted padding */
    background-color: var(--color-accent-blue-dark); /* bg-blue-600 */
    color: var(--color-text-light); /* text-white */
    border-radius: var(--radius-md); /* rounded-md */
    text-decoration: none;
    transition: var(--transition-fast);
    gap: 0.8rem;
    margin-top: 2rem;
    font-size: 1.05rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-sm); /* Subtle shadow */
}

.cta-btn:hover {
    background-color: #1D56BF; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift */
    box-shadow: var(--shadow-md); /* More pronounced shadow */
}

.cta-btn-primary {
    background-color: var(--color-accent-blue-dark);
    color: var(--color-text-light) !important;
    border-color: var(--color-accent-blue-dark); /* Match background */
}

.cta-btn-primary:hover {
    background-color: #1D56BF; /* Darker blue on hover */
    border-color: #1D56BF; /* Match darker blue */
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7); /* Darker overlay */
    display: none !important; /* Явно отключен */
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--color-bg-secondary); /* Lighter dark background for modal */
    padding: 3rem;
    border-radius: var(--radius-lg); /* rounded-lg */
    box-shadow: var(--shadow-xl); /* Stronger shadow */
    text-align: center;
    max-width: 450px; /* Slightly wider */
    width: 90%;
    position: relative;
    color: var(--color-text-light); /* Light text */
    border: 1px solid var(--color-border-subtle); /* Subtle border */
}
.modal-content h3 {
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--color-text-light);
}
.modal-content a, .modal-content button {
    display: block;
    padding: 0.8rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.modal-content a.modal-btn-primary {
    background-color: var(--color-accent-blue-dark); /* Primary blue for main modal button */
    color: var(--color-text-light) !important;
    border-color: var(--color-accent-blue-dark); /* Blue border for consistency */
}
.modal-content a.modal-btn-primary:hover {
    background-color: #1D56BF !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.modal-content a.modal-btn-secondary {
    background-color: transparent !important; /* Transparent background */
    color: var(--color-accent-blue-light) !important; /* Light blue text */
    border-color: var(--color-accent-blue-light); /* Light blue border */
}
.modal-content a.modal-btn-secondary:hover {
    background-color: rgba(96, 165, 250, 0.1) !important; /* Subtle blue background on hover */
    border-color: var(--color-accent-blue-light); /* Keep blue border */
}

.close-modal-btn {
    position: absolute;
    top: 15px !important; /* Adjusted position */
    right: 15px !important;
    width: 35px !important;
    height: 35px !important;
    display: grid !important;
    place-items: center !important;
    font-size: 1.8rem !important; /* Slightly smaller */
    line-height: 1 !important;
    color: var(--color-text-dark) !important; /* Darker gray for close button */
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: var(--transition-fast);
    border-radius: var(--radius-full) !important; /* Make it round */
    z-index: 10 !important;
}
.close-modal-btn:hover {
    color: var(--color-accent-blue-light) !important; /* Blue on hover */
    background-color: rgba(96, 165, 250, 0.1) !important; /* Subtle background on hover */
}

/* Arbitrage Flow Section */
.arbitrage-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    align-items: stretch;
    margin: 3rem 0;
    position: relative;
}
.flow-step {
    padding: 2.5rem 2rem;
    background: var(--color-bg-secondary); /* Dark background for steps */
    border-radius: var(--radius-lg); /* rounded-lg */
    box-shadow: var(--shadow-lg); /* Larger shadow */
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: var(--transition-medium);
    border: 1px solid var(--color-border-subtle); /* Subtle border */
}
.flow-step:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl); /* More pronounced shadow on hover */
}
.flow-step i {
    color: var(--color-accent-blue-light); /* Use accent blue for icons */
    font-size: 3.5em; /* Larger icon */
    margin-bottom: 1.5rem;
}
.flow-step h3 {
    font-size: 1.3rem; /* Slightly larger h3 */
    color: var(--color-text-light);
}
.flow-step p {
    font-size: 0.98rem; /* Slightly larger paragraph text */
    color: var(--color-text-medium); /* text-gray-300 */
    flex-grow: 1;
}
.flow-step::after {
    content: '→';
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.8rem; /* Larger arrow */
    color: var(--color-accent-blue-light); /* Blue arrow */
    opacity: 0.7; /* Slightly less opaque */
}
.arbitrage-flow .flow-step:last-child::after {
    content: none;
}

/* Process Grid Section (Bot Technology) */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}
.process-card {
    padding: 2.5rem 2rem;
    background: var(--color-bg-secondary); /* Dark background for cards */
    border-radius: var(--radius-lg); /* rounded-lg */
    box-shadow: var(--shadow-lg); /* Larger shadow */
    transition: var(--transition-medium);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border-subtle); /* Subtle border */
}
.process-card:hover {
    transform: translateY(-8px); /* Less aggressive lift */
    box-shadow: var(--shadow-xl); /* More pronounced shadow */
}
.process-card i {
    color: var(--color-accent-blue-light); /* Accent blue for icons */
    font-size: 2.5em; /* Larger icon */
    margin-bottom: 1.5rem;
}
.process-card h3 {
    font-size: 1.35rem; /* Slightly larger h3 */
    color: var(--color-text-light);
}
.process-card p {
    font-size: 1rem;
    color: var(--color-text-medium); /* text-gray-300 */
    flex-grow: 1;
}

/* Features List Section */
.features-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}
.features-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.8rem;
    font-size: 1.05rem; /* Slightly smaller font for list items */
    line-height: 1.7;
    color: var(--color-text-medium); /* text-gray-300 */
}
.features-list li i {
    color: var(--color-accent-blue-light); /* Accent blue for icons */
    font-size: 1.8rem; /* Larger icon */
    margin-right: 1.2rem;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
    margin-top: 2px;
}
.features-list li strong {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    color: var(--color-text-light); /* Light text for strong */
}

/* FAQ Section */
.faq-details {
    background-color: var(--color-bg-secondary); /* Dark background for FAQ cards */
    border-radius: var(--radius-lg); /* rounded-lg */
    box-shadow: var(--shadow-lg); /* Larger shadow */
    margin-top: 2rem;
    overflow: hidden;
    border: 1px solid var(--color-border-subtle); /* Subtle border */
}

.faq-details:hover {
    box-shadow: var(--shadow-xl); /* More pronounced shadow on hover */
}

.faq-summary {
    padding: 1.5rem 2rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--color-text-light); /* Light text for summary */
    list-style: none;
    transition: background-color var(--transition-fast);
}

.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::marker { display: none; }

.faq-summary:hover {
    background-color: #2D3A4B; /* Slightly darker background on hover */
}

.faq-summary i {
    transition: transform 0.3s ease, color 0.3s ease;
    font-size: 1.4em; /* Slightly larger icon */
    color: var(--color-text-dark); /* Muted icon color */
}

.faq-details[open] .faq-summary i {
    transform: rotate(180deg);
    color: var(--color-accent-blue-light); /* Accent blue when open */
}

.faq-content {
    padding: 0 2rem 1.5rem 2rem;
    border-top: 1px solid var(--color-border-subtle); /* Subtle border */
    color: var(--color-text-medium); /* text-gray-300 */
}

.faq-content p {
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}
.faq-content p:first-child { margin-top: 1.5rem; }
.faq-content p:last-child { margin-bottom: 0; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .arbitrage-flow {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .process-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0 2.5rem 0;
    }
    .hero img {
        max-width: 60%;
        margin: 0 auto 1.5rem auto;
    }
    .hero .subtitle {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    .hero p {
        font-size: 1rem;
        margin: 0 auto 1.5rem auto;
    }
    .cta-btn {
        margin-top: 1.5rem;
    }

    h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    h3 {
        font-size: 1.25rem;
    }

    .arbitrage-flow {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .flow-step::after {
        content: '↓';
        right: 50%;
        bottom: -25px;
        top: auto;
        transform: translateX(50%);
        font-size: 2.2rem;
    }
    .arbitrage-flow .flow-step:not(:last-child)::after {
        display: block;
    }
    .features-list li i {
        margin-top: 4px;
    }
    .close-modal-btn {
        top: 10px !important;
        right: 10px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 2rem !important;
    }
}
@media (max-width: 480px) {
    .hero {
        padding: 3rem 0 1.5rem 0;
    }
    .hero img {
        max-width: 80%;
        margin: 0 auto 1rem auto;
    }
    .hero .subtitle {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    .hero p {
        font-size: 0.95rem;
        margin: 0 auto 1rem auto;
    }
    .cta-btn {
        margin-top: 1rem;
        padding: 0.9rem 1.8rem;
        font-size: 1rem;
    }

    h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .flow-step {
        padding: 2rem 1.5rem;
    }
    .process-card {
        padding: 2rem 1.5rem;
    }
    .modal-content {
        padding: 2rem;
    }
    .modal-content h3 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    .close-modal-btn {
        top: 8px !important;
        right: 8px !important;
        width: 35px !important;
        height: 35px !important;
        font-size: 1.7rem !important;
    }
}

/* --- END General Content Styles --- */

/* --- Login/Signup Page Styles (Moved from login.php <style> block) --- */
.login-page-wrapper {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg-primary);
    min-height: 100vh; /* Adjusted to fill full viewport height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* padding-top: 72px; */ /* Removed, will use margin-top on auth-wrapper instead */
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px; /* Добавлен padding-bottom для отступа снизу */
    /* overflow-y: auto; */ /* Removed to avoid potential double scrollbars */
    color: var(--color-text-medium);
    width: 100%;
}

.auth-wrapper {
    width: 100%;
    max-width: 500px; /* Увеличена максимальная ширина */
    /* flex-shrink: 0; */ /* Удалено, чтобы позволить элементу растягиваться */
    /* margin-top: 72px; */ /* Added to compensate for fixed header */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% - 50px));
}

.auth-container {
    background: rgba(31, 41, 55, 0.8); /* Полупрозрачный фон для формы */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--radius-lg); /* rounded-lg */
    box-shadow: var(--shadow-xl); /* More pronounced shadow */
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 95vh; /* Allow some scroll on very small screens */
    overflow-y: auto;
    border: 1px solid var(--color-border-subtle); /* Subtle border */
}

.auth-container h1 {
    color: var(--color-text-light); /* Light text for heading */
    font-size: 24px; /* Larger heading */
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700; /* Bold */
}

.auth-container form {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Increased gap */
}

.auth-container .input-container {
    position: relative;
    width: 100%;
}

.auth-container .input-icon-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.auth-container input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border-subtle); /* Subtle dark border */
    border-radius: var(--radius-md);
    font-size: 15px;
    background: var(--color-bg-primary); /* Dark background for input */
    color: var(--color-text-light); /* Light text for input */
    transition: var(--transition-fast);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.auth-container .input-icon-wrapper input {
    flex-grow: 1;
    padding-right: 40px;
}

.auth-container input:focus {
    outline: none;
    border-color: var(--color-accent-blue-medium); /* Accent blue on focus */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); /* Subtle blue shadow */
}

.auth-container input::placeholder {
    color: var(--color-text-dark); /* Muted placeholder */
    font-size: 14px;
}

.auth-container .login-button {
    background: var(--color-accent-blue-dark); /* Accent blue button */
    color: var(--color-text-light); /* Light text */
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500; /* Semibold */
    cursor: pointer;
    transition: all 0.3s ease; /* Изменено на all 0.3s ease для плавного перехода тени */
    width: 100%;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3); /* Обновлено для соответствия cta-button */
    position: relative; /* Добавлено для псевдоэлемента */
    overflow: hidden; /* Добавлено для псевдоэлемента */
    z-index: 1; /* Добавлено для псевдоэлемента */
}

.auth-container .login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%; /* Начальное положение за пределами кнопки */
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); /* Белый градиент */
    transition: left 0.5s ease; /* Анимация движения */
    z-index: -1; /* Чтобы псевдоэлемент был под текстом кнопки */
}

.auth-container .login-button:hover {
    background: #1D56BF; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift */
    box-shadow: 0 7px 14px rgba(37, 99, 235, 0.4); /* Обновлено для соответствия cta-button */
}

.auth-container .login-button:hover::before {
    left: 100%; /* Конечное положение, чтобы градиент "проскользнул" */
}

.auth-container .links-container {
    text-align: center;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-container .links-container a {
    color: var(--color-accent-blue-light) !important; /* Light accent blue for links */
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.auth-container .links-container a:hover {
    text-decoration: underline;
    color: var(--color-accent-blue-medium) !important; /* Darker blue on hover */
}

.auth-container .input-icon-wrapper .eye-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    width: 22px; /* Slightly larger icon */
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.auth-container .eye-icon svg {
    fill: none;
    stroke: var(--color-text-dark); /* Muted color for icon */
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.auth-container .error {
    border-color: #EF4444 !important; /* Tailwind red-500 */
}

.auth-container .error-message {
    color: #EF4444; /* Tailwind red-500 */
    font-size: 12px;
    margin: 4px 0 0 4px;
    display: none;
}

@media (max-width: 480px) {
    .login-page-wrapper {
        padding: 80px 15px; /* Adjusted padding for smaller mobile */
        justify-content: flex-start;
    }

    .auth-wrapper {
        flex-shrink: 1;
        /* max-width: 95%; -- Удалено для сохранения ширины 500px на мобильных */
    }

    .auth-container {
        padding: 25px 20px;
        border-radius: var(--radius-md);
        max-height: none;
        overflow-y: visible;
    }

    .auth-container h1 {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .auth-container input {
        padding: 11px 14px;
        font-size: 14px;
    }

    .auth-container .input-icon-wrapper input {
        padding-right: 38px;
    }

    .auth-container .login-button {
        padding: 12px;
        font-size: 14px;
    }

    .auth-container .input-icon-wrapper .eye-icon {
        right: 10px;
        width: 20px;
        height: 20px;
    }
}
/* --- END Login/Signup Page Styles --- */

/* --- CSS for hiding Tilda elements --- */
.t-tildafixes,
div[data-hook="tilda-footer"],
.t-records .t-records_animated .t-tildafixes {
    display: none !important;
}
/* --- End CSS for Tilda elements --- */

/* --- Profile Page Styles (Moved from profile.php <style> block) --- */
/* Consolidated .profile-page styles */
.profile-page {
    padding-top: 1rem; /* Adjusted padding from header */
    padding-bottom: 2.5rem; /* Adjusted padding from footer */
    max-width: 100vw;
    width: 100%;
    margin: 0;
}
.profile-inner {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
    gap: 2rem; /* Added gap between sidebar and main content */
    padding: 0 1.5rem; /* Added horizontal padding for the inner container */
}

.profile-section {
    background-color: transparent; /* Устанавливаем прозрачный фон */
    box-shadow: none; /* Убираем тень */
    border: none; /* Убираем границу */
    padding: 30px;
    border-radius: var(--radius-lg);
    color: var(--color-text-light);
    width: 100%;
    max-width: 800px; /* Adjusted max-width */
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

.profile-section h2 {
    color: var(--color-text-light); /* Light text for heading */
    margin-bottom: 25px;
    font-size: 2em;
    font-weight: 700;
}

.profile-info {
    text-align: left;
    margin-bottom: 30px;
}

.profile-info p {
    font-size: 1.1em;
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--color-text-medium); /* Medium text */
}

.profile-info strong {
    color: var(--color-text-light); /* Light text for strong */
    margin-right: 10px;
}

/* The logout-btn already has styles defined in header.css, no need to duplicate .btn styles */

@media (max-width: 768px) {
    .profile-page {
        padding: 0; /* Remove padding for profile page on smaller screens */
        min-height: calc(100vh - 64px - 80px); /* Adjust for mobile header */
        gap: 1.5rem; /* Adjust gap for mobile */
    }

    .profile-section {
        padding: 25px 20px;
    }

    .profile-section h2 {
        font-size: 1.8em;
    }

    .profile-info p {
        font-size: 1em;
    }
}


.sidebar-container {
    position: fixed !important;
    top: 72px !important;
    left: 0 !important;
    height: calc(100vh - 72px) !important;
    z-index: 1000;
    width: 280px; /* Fixed width for the sidebar */
    background-color: var(--color-bg-secondary); /* Changed to secondary background */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    transition: transform 0.3s ease-in-out;
    border: 1px solid var(--color-border-subtle); /* Added border */
}

/* Стили для скрытого состояния меню на десктопе */
body.sidebar-hidden .sidebar-container {
    transform: translateX(-280px); /* Скрываем сайдбар, сдвигая его влево */
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1rem;
}

.sidebar-nav a {
    text-decoration: none;
}

.sidebar-nav button {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: transparent; /* Прозрачный фон по умолчанию */
    color: var(--color-text-medium); /* Цвет текста */
    border: none;
    border-radius: var(--radius-md); /* Закругленные углы */
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1rem;
    display: flex;
    align-items: center;
    outline: none;
    margin-bottom: 0.5rem;
}

.sidebar-nav button:focus {
    outline: 2px solid var(--color-accent-blue-light); /* Используем акцентный цвет */
    outline-offset: 2px;
}

.sidebar-nav button i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
    color: var(--color-text-dark); /* Цвет иконки */
    transition: var(--transition-fast);
}

.sidebar-nav button:hover {
    background-color: var(--color-bg-secondary); /* Фон при наведении */
    color: var(--color-text-light); /* Цвет текста при наведении */
}

.sidebar-nav button:hover i {
    color: var(--color-text-light); /* Цвет иконки при наведении */
}

/* Стили для активной кнопки */
.sidebar-nav button.active {
    background-color: var(--color-accent-blue-dark); /* Акцентный цвет для активной кнопки */
    color: var(--color-text-light); /* Белый текст */
    font-weight: 600;
}

.sidebar-nav button.active i {
    color: var(--color-text-light); /* Белая иконка */
}

/* Стили для блока с курсами */
.rates-section {
    padding: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--color-border-subtle);
    text-align: left;
    font-size: 0.9rem;
    color: var(--color-text-medium);
}

.rates-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text-light);
}

.rate-item {
    margin-bottom: 0.3rem;
}

.rate-item strong {
    color: var(--color-accent-blue-light); /* Цвет для названий валют/криптовалют */
}

.rates-section .refresh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    background-color: var(--color-accent-blue-dark); /* Акцентный цвет */
    color: var(--color-text-light);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    font-weight: 500;
}

.rates-section .refresh-button:hover {
    background-color: #1D56BF; /* Более темный синий */
}

.rates-section .refresh-button:disabled {
    background-color: var(--color-border-subtle);
    cursor: not-allowed;
    opacity: 0.7;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-border-subtle);
    margin-top: auto; /* Прижимает футер к низу сайдбара */
}

.logout-btn {
    width: 100%;
    background-color: var(--color-bg-secondary); /* Фон кнопки выхода */
    border: none;
    color: var(--color-text-light);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background-color: #2D3A4B; /* Чуть темнее при наведении */
    color: var(--color-accent-blue-light);
}

.logout-btn i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    color: var(--color-text-dark);
}

.logout-btn:hover i {
    color: var(--color-accent-blue-light);
}

/* Стили для кнопки переключения меню */
/* Удалены, так как кнопка "Панель управления" была удалена */

/* Стили для пользовательского тултипа, следующего за курсором */
/* Удалены, так как тултип был связан с кнопкой переключения */

/* Основное содержимое */
.main-content {
    flex-grow: 1; /* Allows main content to take up remaining space */
    background-color: transparent; /* Устанавливаем прозрачный фон */
    border-radius: var(--radius-lg);
    box-shadow: none; /* Убираем тень */
    border: none; /* Убираем границу */
    padding-top: 72px; /* Добавлен отступ для хедера на десктопе */
}

/* Корректируем margin-left для main-content - сайдбар удален */
.main-content {
    padding-left: 1.5rem; /* Стандартный отступ */
    transition: margin-left 0.3s ease-in-out;
    margin-left: 0 !important; /* Убираем отступ слева, так как сайдбара больше нет */
}

body.sidebar-hidden .main-content {
    margin-left: 0 !important; /* Убираем отступ слева */
}

.dashboard-section {
    animation: fadeIn 0.5s ease-out forwards;
    width: 100%; /* Ensure dashboard section takes full width */
    padding: 1.5rem; /* Added consistent padding for all dashboard sections */
    background-color: transparent; /* Устанавливаем прозрачный фон */
    box-shadow: none; /* Убираем тень */
    border: none; /* Убираем границу */
}

/* Новая сетка для страницы настроек */
.settings-page-container {
    width: 100%;
    max-width: 1400px;
    margin: -40px auto 0;
    padding: 0 1rem 1rem 1rem;
}
.settings-grid {
    display: grid;
    grid-template-columns: 1fr; /* по умолчанию одна колонка */
    gap: 2rem;
}

/* Вкладки настроек */
.settings-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin: -10px auto 0.5rem;
    max-width: 960px;
    border: none;
    position: relative;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.settings-tab {
    appearance: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-medium);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.625rem 1.25rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    overflow: hidden;
    z-index: 1;
}

.settings-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(96, 165, 250, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 0.375rem;
    z-index: -1;
}

.settings-tab span {
    position: relative;
    z-index: 2;
}

.settings-tab:hover {
    color: var(--color-text-light);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.settings-tab:hover::before {
    opacity: 0.3;
}

.settings-tab.active {
    color: var(--color-text-light);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
    transform: translateY(-2px);
}

.settings-tab.active::before {
    opacity: 1;
}

.settings-tabs-content {
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    position: relative;
    overflow: visible;
}

.settings-tabs-content::before {
    display: none;
}

.settings-tab-panel { 
    display: none; 
    animation: fadeIn 0.4s ease-in-out;
}

.settings-tab-panel.active { 
    display: block; 
}

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

/* Стили для светлой темы (когда нет класса dark) */
html:not(.dark) {
    --gradient-bg-primary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%, #f8fafc 100%);
    --gradient-bg-secondary: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
}

/* УДАЛЕНО: конфликтующие правила для светлой темы которые создавали разделение фона */

/* Универсальные стили для обеспечения прозрачности фона */
main, .main-content, .profile-page, .min-h-screen,
.dashboard-parent-section, .settings-page-container,
.profile-inner {
    background: transparent !important;
}

html.dark main, 
html.dark .main-content, 
html.dark .profile-page, 
html.dark .min-h-screen,
html.dark .dashboard-parent-section,
html.dark .settings-page-container,
html.dark .profile-inner {
    background: transparent !important;
}

html:not(.dark) .auth-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}
html:not(.dark) .settings-tabs-bar {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

html:not(.dark) .settings-tab span {
    color: inherit !important;
    position: relative;
    z-index: 2;
}

html:not(.dark) .settings-tab.active span {
    color: #1F2937 !important; /* Темно-серый цвет для лучшей читаемости */
}

html:not(.dark) .settings-tab:hover span {
    color: #374151 !important; /* Цвет при наведении в светлой теме */
}

html:not(.dark) .settings-tab {
    background: rgba(243, 244, 246, 0.8);
    color: #6B7280 !important;
    border: 1px solid rgba(209, 213, 219, 0.6);
}

html:not(.dark) .settings-tab:hover {
    color: #374151 !important;
    background: rgba(243, 244, 246, 1);
    border-color: rgba(209, 213, 219, 1);
    transform: translateY(-1px);
}

html:not(.dark) .settings-tab::before {
    background: rgba(59, 130, 246, 0.08) !important;
}

html:not(.dark) .settings-tab:hover::before {
    opacity: 0.3 !important;
}

html:not(.dark) .settings-tab.active {
    color: #1F2937 !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.08)) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15) !important;
    transform: translateY(-2px);
}


html:not(.dark) .settings-tabs-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

html:not(.dark) .settings-tabs-content::before {
    display: none !important;
}


/* Снимаем визуальные «гармошки» внутри панелей настроек для более цельного вида */
.settings-tab-panel .section-title.collapsible-header,
.settings-tab-panel .form-title.collapsible-header {
    cursor: default;
}
.settings-tab-panel .collapsible-content { max-height: none !important; opacity: 1 !important; pointer-events: auto; }
.settings-tab-panel .collapsible-header .collapse-icon { display: none; }


.dashboard-section h2 {
    font-size: 1.8rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-subtle);
}

.dashboard-section p {
    color: var(--color-text-medium);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .profile-page {
        flex-direction: column; /* Stack sidebar and main content vertically */
        align-items: center; /* Center items when stacked */
        padding: 1.5rem; /* Adjust padding for smaller screens */
    }
    .profile-inner {
        padding: 0; /* Remove horizontal padding for .profile-inner */
    }
    .profile-section {
        max-width: none; /* Remove max-width restriction for profile sections on mobile */
    }
    .sidebar-container {
        position: fixed !important;
        top: 72px !important;
        left: 0 !important;
        height: calc(100vh - 72px) !important;
        max-width: 280px; /* Устанавливаем максимальную ширину для планшетов */
        z-index: 1000;
        box-shadow: var(--shadow-xl);
        border-radius: var(--radius-lg);
        padding: 2rem 1.5rem;
    }
    body.sidebar-hidden .sidebar-container {
        transform: translateX(-280px);
    }

    /* Удалены стили .sidebar-toggle */

    /* Удалены стили .sidebar-toggle i и .sidebar-toggle span */

    .main-content {
        width: 100%; /* Full width for main content on smaller screens */
        max-width: 100%;
        max-height: none; /* Allow natural height expansion on smaller screens */
        overflow-y: visible; /* Allow content to overflow without scrollbars */
        margin-left: 0 !important; /* Убираем отступ слева на планшетах - сайдбара нет */
        padding-top: 32px; /* Добавлен отступ для хедера на планшете */
    }
    body.sidebar-hidden .main-content {
        margin-left: 0 !important;
    }

    .custom-tooltip {
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .profile-page {
        padding: 0; /* Remove padding for profile page on smaller screens */
        min-height: calc(100vh - 64px - 80px); /* Adjust for mobile header */
        gap: 1.5rem; /* Adjust gap for mobile */
    }
    .profile-inner {
        padding: 0; /* Ensure no padding for profile-inner on smaller screens */
    }

    .profile-section {
        padding: 25px 20px;
        max-width: none; /* Ensure no max-width here either */
    }
    .sidebar-container {
        display: none !important; /* Fully hide desktop sidebar on mobile */
    }
    .sidebar-nav {
        display: none !important; /* Скрываем навигацию сайдбара на мобильных */
    }
    /* Removed .sidebar-toggle and body.sidebar-hidden .sidebar-toggle styles as they are no longer relevant */

    .sidebar-menu {
        flex-direction: column;
        align-items: stretch;
    }
    .sidebar-item {
        text-align: left;
    }
    .sidebar-item i {
        margin-right: 1rem;
    }
    .main-content {
        padding: 1rem;
        padding-top: 32px; /* Добавлен отступ для хедера на мобильных */
        padding-bottom: 1rem; /* Убран отступ для нижней навигации - она удалена */
    }
    .dashboard-section h2 {
        font-size: 1.5rem;
    }
    .dashboard-toggle-btn {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .profile-page {
        padding: 0; /* Remove padding for very small screens */
        margin: 0; /* Remove margin for very small screens */
        gap: 1rem; /* Отступ между сайдбаром и контентом на очень маленьких экранах */
    }
    .profile-inner {
        padding: 0; /* Remove padding for very small screens */
    }
    .sidebar-container {
        display: none !important; /* Полностью скрываем сайдбар на очень маленьких экранах */
    }
    .sidebar-nav {
        display: none !important; /* Скрываем навигацию сайдбара на очень маленьких экранах */
    }
    /* Удалены стили .sidebar-toggle */
    /* Удалены стили body.sidebar-hidden .sidebar-toggle */

    .sidebar-menu {
        flex-direction: column;
        align-items: stretch;
    }
    .sidebar-item {
        text-align: left;
    }
    .sidebar-item i {
        margin-right: 1rem;
    }
    .main-content {
        padding: 0.8rem;
        padding-top: 32px; /* Добавлен отступ для хедера на очень маленьких экранах */
        padding-bottom: 0.8rem; /* Убран отступ для нижней навигации - она удалена */
        margin-left: 0 !important; /* Убираем отступ слева на очень маленьких экранах */
    }
    .dashboard-section h2 {
        font-size: 1.3rem;
    }
    .dashboard-toggle-btn {
        display: none !important;
    }
}

/* --- END Profile Page Styles --- */
/* Subscription Info Section */
.subscription-info {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer; /* Указываем, что элемент кликабельный */
    padding: 8px 12px; /* Добавляем отступы, чтобы выглядело как кнопка */
    border-radius: 8px; /* Скругляем углы */
    background-color: var(--color-bg-alt); /* Цвет фона для кнопки */
    transition: background-color 0.3s ease;
}

.subscription-info:hover {
    background-color: var(--color-bg-hover); /* Изменение фона при наведении */
}

.subscription-status {
    font-weight: 500;
    color: var(--color-text-light);
    white-space: nowrap;
    display: flex;
    align-items: center;
    font-size: 0.85rem; /* Размер шрифта для кнопки */
}

.subscription-status.no-subscription {
    color: var(--color-text-dark);
}

.subscription-status.free-trial {
    color: var(--color-tariff-free-trial);
    padding: 4px 8px;
    border: 1px solid var(--color-tariff-free-trial);
    border-radius: var(--radius-md);
    background-color: rgba(34, 197, 94, 0.1); /* Прозрачный зеленый фон */
}

.subscription-status.free-trial-expired {
    color: #EF4444; /* Red for expired trial */
    padding: 4px 8px;
    border: 1px solid #EF4444;
    border-radius: var(--radius-md);
    background-color: rgba(239, 68, 68, 0.1); /* Прозрачный красный фон */
}

.subscription-status.basic-subscription {
    color: var(--color-tariff-basic);
    padding: 4px 8px; /* Добавляем отступы */
    border: 1px solid var(--color-tariff-basic); /* Добавляем рамку */
    border-radius: var(--radius-md); /* Скругляем углы */
    background-color: rgba(59, 130, 246, 0.1); /* Прозрачный синий фон */
}

.subscription-status.professional-subscription {
    color: var(--color-tariff-professional);
    padding: 4px 8px; /* Добавляем отступы */
    border: 1px solid var(--color-tariff-professional); /* Добавляем рамку */
    border-radius: var(--radius-md); /* Скругляем углы */
    background-color: rgba(139, 92, 246, 0.1); /* Прозрачный фиолетовый фон */
}

.subscription-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: 15px;
    z-index: 1000;
    min-width: 250px;
    box-shadow: var(--shadow-lg);
    color: var(--color-text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    display: none; /* Скрываем по умолчанию */
    margin-top: 10px;
}

.subscription-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent var(--color-bg-secondary) transparent;
}

.subscription-tooltip p {
    margin-bottom: 8px;
}

.subscription-tooltip p:last-child {
    margin-bottom: 0;
}

.subscription-tooltip strong {
    color: var(--color-primary);
}

.subscription-tooltip .tooltip-link {
    color: var(--color-link);
    text-decoration: underline;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .subscription-info {
        padding: 6px 10px;
        margin-right: 10px;
    }

    .subscription-status {
        font-size: 0.85rem;
    }

    .subscription-status.free-trial,
    .subscription-status.free-trial-expired {
        padding: 4px 8px;
    }

    .subscription-status.basic-subscription,
    .subscription-status.professional-subscription {
        padding: 4px 8px;
    }

    .subscription-tooltip {
        min-width: 200px;
        padding: 10px;
        font-size: 0.8rem;
        margin-top: 5px; /* Уменьшаем отступ для мобильных */
    }

    .subscription-tooltip::before {
        border-width: 6px;
    }
}

.language-selector {
    position: relative;
    margin-left: 15px;
    cursor: pointer;
}

html, body {
    height: 100%;
    min-height: 100vh;
    box-sizing: border-box; /* Добавлено */
}
*, *::before, *::after { /* Добавлено для глобального применения */
    box-sizing: inherit;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: transparent !important;
    /* padding-top: 72px;  Удалено */
    overflow-x: hidden; /* исключаем горизонтальный скролл, чтобы блоки не "уплывали" под хедер */
}

html body {
    background: transparent !important;
}
.site-footer {
    margin-top: auto;
}

.header-hamburger {
    display: none !important;
}

@media (max-width: 768px) {
    .header-hamburger {
        display: flex !important;
    }
    .nav-container {
        flex-wrap: nowrap;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }
    .brand {
        left: 50%;
        transform: translateX(-50%);
        position: absolute;
        order: 2;
    }
    .right-menu {
        order: 3;
        margin-left: auto;
    }
}

@media (min-width: 769px) {
    .header-hamburger {
        display: none !important; /* Скрываем гамбургер на десктопе */
    }
    .left-menu {
        display: flex !important; /* Показываем меню на десктопе */
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 24px;
        background: none;
        box-shadow: none;
        height: auto;
        width: auto;
        max-width: none;
        padding: 0;
        opacity: 1;
        pointer-events: auto;
    }
    .nav-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }
    .brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        order: 2;
    }
    .right-menu {
        order: 3;
        margin-left: auto;
    }

    /* Убедимся, что dashboard-toggle-btn скрыт на десктопе, если он не нужен */
    .dashboard-toggle-btn {
        display: none !important;
    }
}

@media (max-width: 768px) {
  body .site-footer {
    display: none !important;
  }
  .main-content {
    padding-bottom: 72px !important; /* Корректируем padding-bottom для нижней панели */
  }
}

/* Стили для информации о подписке в выпадающем меню профиля (мобильная версия) */
.profile-dropdown-subscription {
    width: auto; /* Автоматическая ширина, чтобы подстроиться под содержимое */
    margin: 0; /* Удаляем внешние отступы */
    background-color: transparent; /* Делаем фон прозрачным */
    border-radius: 0; /* Убираем скругление углов */
    padding: 0; /* Убираем padding на контейнере */
    box-shadow: none; /* Убираем тень */
    border: none; /* Убираем рамку */
    box-sizing: border-box; /* Учитываем padding и border в общей ширине */
    text-align: left; /* Выравнивание текста по левому краю */
    position: relative; /* Чтобы тултип позиционировался относительно этого элемента */
    cursor: pointer;
    display: block; /* Делаем блочным элементом, чтобы занимал всю ширину */
    color: var(--color-text-light); /* Цвет текста */
    font-size: 0.95rem; /* Размер шрифта, как у nav-link */
    font-weight: 500; /* Вес шрифта, как у nav-link */
    text-decoration: none; /* Убираем подчеркивание */
    border-bottom: 1px solid var(--color-border-subtle); /* Разделитель, как у nav-link */
}

.profile-dropdown-subscription:last-of-type {
    border-bottom: none; /* Убираем разделитель для последнего элемента */
}

.profile-dropdown-subscription:hover {
    background: var(--color-bg-secondary); /* Фон при наведении */
    color: var(--color-text-light); /* Цвет текста при наведении */
}

.profile-dropdown-subscription .subscription-status {
    font-size: 0.95rem; /* Размер шрифта, как у nav-link */
    text-transform: uppercase; /* Возвращаем к верхнему регистру, если нужно */
    justify-content: flex-start; /* Выравниваем текст по левому краю */
    width: 100%;
    padding: 10px 16px; /* Отступы как у nav-link */
    border: none; /* Убираем рамку */
    background-color: transparent; /* Прозрачный фон */
    border-radius: 0;
}

/* Переопределяем стили тултипа для мобильного меню */
.profile-dropdown-subscription .subscription-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    width: 100%;
    max-width: 250px;
    padding: 10px;
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border-subtle);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: none;
}

.profile-dropdown-subscription .subscription-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 15px; /* Изменено с left на right */
    left: auto; /* Добавлено, чтобы отменить left */
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent var(--color-border-subtle) transparent;
}

.main-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    z-index: 99996; /* Под основным меню, но над контентом */
    display: none !important; /* Явно отключен */
    transition: opacity 0.3s ease;
    opacity: 0;
}

.main-menu-overlay.active {
    display: none !important; /* Явно отключен даже когда active */
    opacity: 0;
}

/* Явное скрытие мобильного меню для предотвращения блокировки контента */
@media (max-width: 768px) {
    .left-menu {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translateX(-100%) !important;
        visibility: hidden !important;
    }
    
    .left-menu.open {
        display: flex !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateX(0) !important;
        visibility: visible !important;
    }
}

/* Стили для выделения активных пунктов меню в мобильной версии */
@media (max-width: 768px) {
    /* Выделение активных ссылок в мобильном меню */
    .md\:hidden a[href]:has(+ *),
    .md\:hidden a[href] {
        transition: all 0.2s ease;
    }
    
    /* Синий фон для активных пунктов главного меню */
    .md\:hidden a.bg-brand-600 {
        background-color: #6366f1 !important;
        color: white !important;
        font-weight: 500;
        border-radius: 0.5rem;
        padding: 0.5rem 1rem;
    }
    
    /* Синий фон для активных пунктов в подменю Настройки */
    .md\:hidden .bg-brand-50 a.bg-brand-600 {
        background-color: #6366f1 !important;
        color: white !important;
        font-weight: 500;
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1.5rem;
        padding-right: 1rem;
    }
}

/* Мгновенная смена цвета иконок при переключении темы */
#header-root .icon-transition {
    transition: none !important;
}

/* Принудительные цвета для иконок в шапке */
#header-root .text-brand-600,
#header-root .text-brand-400,
#header-root .text-accent-600,
#header-root .text-accent-500,
#header-root .text-slate-500,
#header-root .text-slate-400,
#header-root .text-slate-700,
#header-root .text-slate-200 {
    transition: color 0s !important;
}

/* SVG иконки внутри Lucide компонентов в шапке */
#header-root svg {
    transition: fill 0s, stroke 0s !important;
}

/* Убираем transition для всех элементов с цветами темы в шапке */
#header-root [class*="text-"] {
    transition: color 0s !important;
}

/* Специально для иконок в навигации и кнопках */
#header-root nav svg,
#header-root button svg,
#header-root .group svg {
    transition: fill 0s, stroke 0s !important;
}

/* Мгновенная смена для иконок в мобильном меню */
#header-root .md\:hidden svg {
    transition: fill 0s, stroke 0s !important;
}

/* Для иконок в dropdown */
#header-root .dropdown svg {
    transition: fill 0s, stroke 0s !important;
}

/* РАДИКАЛЬНЫЕ ПРАВИЛА ДЛЯ МГНОВЕННОЙ СМЕНЫ ЦВЕТА */
html.transitioning * {
    transition: none !important;
    animation: none !important;
}

/* Глобальное отключение transition при смене темы */
html.dark-transition,
html.light-transition {
    transition: none !important;
}

html.dark-transition *,
html.light-transition * {
    transition: none !important;
    color: inherit !important;
    fill: inherit !important;
    stroke: inherit !important;
}

/* Принудительное обновление всех SVG при смене темы */
html.dark svg,
html.light svg {
    transition: none !important;
}

/* Убираем все transition для элементов с цветами */
html[class*="dark"] [class*="text-"],
html:not(.dark) [class*="text-"] {
    transition: color 0s !important;
}

/* Агрессивные правила для иконок Lucide */
.lucide svg,
svg.lucide {
    transition: fill 0s, stroke 0s !important;
}

/* Для всех SVG в документе при смене темы */
html * svg {
    transition: fill 0s, stroke 0s !important;
}
