/* common-styles.css */

/* Глобальные переменные и темы */
:root {
    --bg-color: #F6F6FA; /* Светло-серый */
    --text-color: #292824; /* Чёрный */
    --header-bg: #FFFFFF; /* Белый */
    --accent-color: #0055FF; /* Синий */
    --profile-color: #FFFFFF; /* Белый */
    --light-gray-purple: #F0F0F8; /* Светло-серый с фиолетовым оттенком */
    --shadow-color: rgba(41, 40, 36, 0.2); /* Тень на основе чёрного */
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #F0F0F8;
    --header-bg: #1e1e1e;
    --accent-color: #0055FF;
    --profile-color: #1e1e1e;
}

/* Базовые стили для документа */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    font-family: 'Romani', Arial, sans-serif;
}


header {
    background-color: var(--header-bg);
    padding: 15px 20px;
    box-shadow: 0 2px 8px var(--shadow-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    /* border-bottom: 2px solid #292824; */
    /* border-radius: 20px; */
    /* margin: 20px; */
}

/* Логотип и бренд */
.logo {
    font-size: 1.8em;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 8px;
    color: var(--accent-color);
    animation: breathe 3s ease-in-out infinite;
    will-change: transform;
}

.logo .brand {
    background: linear-gradient(45deg, #0044cc, #0055FF, #0077ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: breathe 3s ease-in-out infinite;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
    display: inline-block;
    will-change: transform;
}

/* Мягкое дыхание — плавное увеличение */
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}


/* Навигация */
nav {
    display: flex;
    gap: 15px;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1em;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.2s, border-color 0.3s;
}

nav a:hover, nav a.active {
    /* background-color: var(--light-gray-purple); */
    border-color: var(--accent-color);
    transform: scale(1.03);
}

nav a i {
    margin-right: 5px;
}

/* Правый блок в шапке */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tokens {
    background: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1em;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
}

.tokens:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 12px rgba(41, 40, 36, 0.3);
}

.tokens i.plus {
    font-size: 1.3em;
    margin-left: 12px;
}

.support {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1em;
    display: flex;
    align-items: center;
}

.support i {
    margin-right: 5px;
}

/* Выпадающее меню профиля */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-dropdown .profile-toggle {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1em;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.profile-dropdown .profile-toggle i {
    margin-right: 5px;
}

.profile-dropdown-content {
    display: none;
    position: absolute;
    top: 40px;
    right: 0;
    background-color: var(--profile-color);
    box-shadow: 0 2px 8px var(--shadow-color);
    padding: 10px;
    border-radius: 8px;
    z-index: 1000;
    min-width: 150px;
    border: 1px solid #292824;
    animation: fadeIn 0.4s;
}

.profile-dropdown-content a {
    margin: 0;
    padding: 6px 0;
    color: var(--text-color);
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}

.profile-dropdown-content a:hover {
    background-color: var(--light-gray-purple);
    border-radius: 4px;
}

/* Переключатель темы */
.theme-switch {
    cursor: pointer;
    font-size: 1.2em;
    color: var(--accent-color);
    margin-left: 10px;
    transition: transform 0.2s;
}

.theme-switch:hover {
    transform: rotate(15deg);
}

/* Кнопка-гамбургер для мобильных устройств */
.hamburger {
    background: none;
    border: none;
    font-size: 1.5em;
    display: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.hamburger:hover {
    transform: scale(1.1);
}

/* Мобильное оверлейное меню */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--header-bg);
    z-index: 1100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid #292824;
    border-radius: 10px;
}

.mobile-nav-overlay.active {
    display: flex !important;
    animation: fadeIn 0.5s;
}

.mobile-nav-overlay a {
    font-size: 1.5em;
    margin: 15px 0;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s;
}

.mobile-nav-overlay a:hover {
    transform: scale(1.05);
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Основной контент сайта */
.main-content {
    padding: 120px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
    transition: padding 0.3s;
}

/* Футер сайта */
footer {
    text-align: center;
    padding: 5px 0;
    background: var(--header-bg);
    width: 100%;
    font-size: 0.9em;
    color: var(--text-color);
    position: fixed;
    bottom: 0;
    left: 0;
    /* border-top: 2px solid #292824; */
    border-radius: 10px 10px 0 0;
}

/* Лайтбокс */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}

.lightbox .close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2.5em;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox .close:hover {
    color: #0055FF;
}

.lightbox .prev, .lightbox .next {
    position: absolute;
    top: 50%;
    font-size: 3em;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transform: translateY(-50%);
    padding: 10px;
    transition: transform 0.3s;
}

.lightbox .prev {
    left: 20px;
}

.lightbox .next {
    right: 20px;
}

.lightbox .prev:hover, .lightbox .next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Мобильный блок токенов */
.mobile-tokens {
    display: none;
    position: fixed;
    top: 12px;
    right: 5px;
    background: var(--accent-color);
    color: #fff;
    text-align: center;
    /padding: 12px 0;
    cursor: pointer;
    font-size: 1em;
    z-index: 1000;
    width: 120px;
    margin-right: 60px;
    border-radius: 10px;
    /* border: 1px solid #292824; */
    box-shadow: 0 4px 8px var(--shadow-color);
}
i.fas.fa-coins {
    margin-right: 10px;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 900px) {
    #searchInput {
        width: 60%;
        text-align: center;
    }
    header {
        padding: 10px 5px;
        flex-wrap: wrap;
    }
    .hamburger {
        display: block !important;
        color: var(--text-color);
    }
    nav, .header-right {
        display: none;
    }
    .mobile-tokens {
        display: block;
        padding: 5px 0;
    }
    .main-content {
        padding: 80px 30px 60px;
        margin-top: 10px;
    }
    .mobile-nav-close {
        position: absolute;
        top: 3%;
        right: 8%;
        font-size: 4em;
        cursor: pointer;
        color: var(--accent-color);
    }
    .mobile-nav-brand {
        font-size: 2.8em;
        font-weight: bold;
        margin-bottom: 20px;
        color: var(--accent-color);
    }
}
