/* style.css - Основные стили проекта */

/* CSS Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Цветовая схема - золотые тона для премиум вида */
    --primary-color: #d4af37;
    --primary-dark: #b8941f;
    --primary-light: #f4e4a6;
    
    /* Фон и текст */
    --bg-dark: #1a1a1a;
    --bg-darker: #0d0d0d;
    --bg-card: #2d2d2d;
    --text-light: #ffffff;
    --text-muted: #b3b3b3;
    --text-dark: #333333;
    
    /* Статусные цвета */
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Градиенты */
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    --gradient-dark: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    --gradient-gold: linear-gradient(135deg, #d4af37 0%, #f4e4a6 50%, #b8941f 100%);
    
    /* Тени */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.3);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
    
    /* Анимации */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Базовые стили */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gradient-dark);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Типографика */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-light);
}

h1 {
    font-size: 2.5rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* Карточки */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(212, 175, 55, 0.1);
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(212, 175, 55, 0.3);
}

.card-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-dark);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-light);
    border: 2px solid var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-dark);
}

.btn-error {
    background: var(--error-color);
    color: white;
}

/* Формы */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Уведомления */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.toast {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    animation: slideInRight 0.3s ease;
}

.toast.toast-success {
    border-left-color: var(--success-color);
}

.toast.toast-error {
    border-left-color: var(--error-color);
}

.toast.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
}

/* Анимации */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

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

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--transition-normal);
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Загрузчики */
.loader {
    border: 3px solid var(--bg-dark);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Утилиты */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none; }
.visible { display: block; }

/* Навигация */
/* Новый header */
.site-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    z-index: 1000;
}

/* Брендинг */
.brand { margin: 0; padding: 0.6rem 0 0.4rem; text-align: center; }
.brand-link { display: inline-flex; align-items: center; gap: 0.6rem; color: inherit; text-decoration: none; }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--primary-color); box-shadow: var(--shadow-gold); background: var(--bg-dark); }
.brand-title { background: var(--gradient-gold); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 1.4rem; font-weight: 800; line-height: 1; }

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    background: url('../images/logo-mark.svg') center/cover no-repeat, url('../images/logo.png') center/cover no-repeat;
}

/* Убрано увеличение логотипа на главной для единообразия */

.nav-brand h1 { /* legacy support */
    margin: 0;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.25rem;
}

/* Текущая разметка заголовка в header.php */
.site-title {
    margin: 0;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.25rem;
    line-height: 1;
}

/* Меню */
.main-nav { padding: 0 0 0.6rem; }
.nav-list { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.5rem; align-items: center; }
.nav-item { display: contents; }

.nav-link { color: var(--text-light); text-decoration: none; padding: 0.6rem 0.8rem; border-radius: 12px; transition: var(--transition-fast); font-weight: 700; font-size: 0.95rem; background: linear-gradient(135deg, var(--bg-card) 0%, #2d1b0e 100%); border: 2px solid var(--primary-color); position: relative; overflow: hidden; text-align: center; }

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before { left: 100%; }

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2);
    color: var(--primary-color);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-gold, #d4af37), var(--primary-light));
    color: var(--bg-dark);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.35);
}

.admin-link {
    background: var(--error-color) !important;
    color: white !important;
}

/* Контентный отступ под фиксированный навбар */
.navbar-spacer { height: 108px; }

/* Внутренние элементы хедера */
/* Старая верстка больше не используется */

/* Десктоп: вернуть вид прошлой панели (бренд слева, меню справа в одну линию) */
@media (min-width: 1025px) {
    .site-header { padding: 0.5rem 0; }
    .site-header .container { display: flex; align-items: center; justify-content: space-between; }
    .brand { padding: 0; text-align: left; }
    .brand-link { gap: 0.5rem; }
    .brand-logo { width: 28px; height: 28px; }
    .brand-title { font-size: 1.25rem; }
    .main-nav { padding: 0; }
    .nav-list { display: flex; gap: 0.75rem; grid-template-columns: none; }
    .nav-item { display: block; }
    .nav-link { padding: 0.8rem 1.4rem; font-size: 1rem; border-radius: 14px; }
    .navbar-spacer { height: 60px; }
}

/* Вертикальные быстрые кнопки (мобайл) */
.quick-nav { padding: 0 1rem 0.75rem; }
.quick-list { list-style: none; display: flex; flex-direction: column; gap: 0.8rem; max-width: 900px; margin: 0 auto; }
.quick-link { display: block; width: 100%; text-align: center; padding: 1rem 1.2rem; border-radius: 16px; background: linear-gradient(135deg, var(--bg-card) 0%, #2d1b0e 100%); border: 2px solid var(--primary-color); color: var(--text-light); text-decoration: none; font-weight: 800; letter-spacing: 0.3px; transition: var(--transition-fast); }
.quick-link:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2); color: var(--primary-color); }

/* Hero секция */
.hero-section {
    padding: 4rem 0;
    text-align: center;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.user-balance {
    background: var(--bg-card);
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.balance-amount {
    color: var(--primary-color);
}

/* Статистика */
.stats-section {
    padding: 3rem 0;
    background: var(--bg-card);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-dark);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-gold);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Чат боковая панель */
.chat-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: var(--text-dark);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-normal);
}

.chat-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 2px solid var(--primary-color);
    z-index: 1001;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
}

/* Подвал */
.footer {
    background: var(--bg-darker);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    border-top: 2px solid var(--primary-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition-fast);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .chat-sidebar {
        width: 100%;
        right: -100%;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}