/* ============================================
   ПЕРЕМЕННЫЕ ТЕМ
   ============================================ */

:root {
    /* Светлая тема */
    --bg-primary: #f7f2ea;
    --bg-secondary: #eee8de;
    --bg-card: #ffffff;
    --bg-card-hover: #f5efe7;
    --bg-input: #f0ebe3;
    --bg-dropdown: #ffffff;
    --text-primary: #1a1410;
    --text-secondary: #5c4f3e;
    --text-muted: #a0907a;
    --text-inverse: #ffffff;
    --border: rgba(200, 157, 92, 0.2);
    --border-hover: rgba(200, 157, 92, 0.4);
    --shadow: 0 4px 20px rgba(44, 36, 26, 0.06);
    --shadow-hover: 0 8px 32px rgba(44, 36, 26, 0.12);
    --shadow-dropdown: 0 12px 40px rgba(44, 36, 26, 0.12);
    --accent: #c89d5c;
    --accent-hover: #b8893a;
    --accent-light: #e8d4b0;
    --accent-glow: rgba(200, 157, 92, 0.25);
    --gold: #d4af37;
    --gold-light: #ecd88a;
    --discord: #5865f2;
    --discord-hover: #4752c4;
    --danger: #c0392b;
    --success: #27ae60;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f0d18;
    --bg-secondary: #1a1728;
    --bg-card: #221f32;
    --bg-card-hover: #2a2640;
    --bg-input: #1a1728;
    --bg-dropdown: #2a2640;
    --text-primary: #eee8f0;
    --text-secondary: #a89ab8;
    --text-muted: #6a5a78;
    --text-inverse: #ffffff;
    --border: rgba(200, 157, 92, 0.12);
    --border-hover: rgba(200, 157, 92, 0.25);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-dropdown: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* ============================================
   БАЗОВЫЕ СТИЛИ
   ============================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

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

/* ============================================
   HEADER
   ============================================ */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition), border-color var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    transition: color var(--transition);
}

.logo i {
    font-size: 26px;
    color: var(--gold);
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.logo span {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================
   КНОПКИ
   ============================================ */

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--accent)) !important;
    color: var(--text-inverse) !important;
    padding: 8px 22px !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 4px 16px var(--accent-glow);
    transition: all var(--transition) !important;
    border: none !important;
    font-weight: 600 !important;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 24px var(--accent-glow) !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover)) !important;
}

.btn-primary.btn-large {
    padding: 14px 36px !important;
    font-size: 17px !important;
    border-radius: var(--radius) !important;
    font-weight: 700 !important;
}

.btn-secondary {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    padding: 8px 22px !important;
    border-radius: var(--radius-sm) !important;
    border: 2px solid var(--border) !important;
    transition: all var(--transition) !important;
    font-weight: 500 !important;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--bg-card-hover) !important;
    border-color: var(--gold) !important;
    transform: translateY(-2px) !important;
}

.btn-secondary.btn-large {
    padding: 14px 36px !important;
    font-size: 17px !important;
    border-radius: var(--radius) !important;
}

/* ============================================
   ПРОФИЛЬ
   ============================================ */

.profile-container {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    background: var(--bg-card);
    border-radius: 24px;
    border: 2px solid var(--border);
    transition: all var(--transition);
    cursor: pointer;
    min-height: 40px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.profile-btn:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow);
}

.profile-btn .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    object-fit: cover;
    display: none;
}

.profile-btn .avatar.show {
    display: block;
}

.profile-btn .chevron {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform var(--transition);
}

.profile-btn.active .chevron {
    transform: rotate(180deg);
}

/* ============================================
   ВЫПАДАЮЩЕЕ МЕНЮ ПРОФИЛЯ
   ============================================ */

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-dropdown);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-dropdown);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 200;
}

.profile-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown .dropdown-header {
    padding: 8px 12px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.profile-dropdown .dropdown-header .user-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.profile-dropdown .dropdown-header .user-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.profile-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
    font-size: 14px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
}

.profile-dropdown .dropdown-item:hover {
    background: rgba(200, 157, 92, 0.08);
    color: var(--text-primary);
}

.profile-dropdown .dropdown-item i {
    width: 20px;
    color: var(--text-muted);
}

.profile-dropdown .dropdown-item .badge {
    margin-left: auto;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(200, 157, 92, 0.12);
    color: var(--gold);
}

.profile-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.profile-dropdown .dropdown-item.danger {
    color: var(--danger);
}

.profile-dropdown .dropdown-item.danger:hover {
    background: rgba(192, 57, 43, 0.08);
}

/* ============================================
   HERO
   ============================================ */

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 60px 0 40px;
    gap: 40px;
    flex-wrap: wrap;
    min-height: 60vh;
}

.hero-content {
    flex: 1;
    min-width: 300px;
}

.hero-content .badge {
    display: inline-block;
    padding: 6px 20px;
    background: rgba(200, 157, 92, 0.10);
    color: var(--accent);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 20px;
    border: 1px solid rgba(200, 157, 92, 0.15);
    text-transform: uppercase;
}

.hero-content h1 {
    font-size: 48px;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.hero-content h1 .highlight {
    background: linear-gradient(135deg, var(--gold), var(--accent), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: goldShine 4s ease-in-out infinite;
}

@keyframes goldShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 500px;
    line-height: 1.8;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    min-width: 200px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image .shield-icon {
    font-size: 120px;
    color: var(--gold);
    filter: drop-shadow(0 0 60px rgba(200, 157, 92, 0.2));
    animation: float 5s ease-in-out infinite;
    line-height: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-14px) rotate(2deg); }
}

/* ============================================
   АНИМАЦИИ И ПЛАВНОСТИ
   ============================================ */

/* Плавное появление элементов */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Применяем анимации к элементам */
.feature-card {
    animation: fadeInUp 0.6s ease forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-card:nth-child(4) { animation-delay: 0.2s; }
.feature-card:nth-child(5) { animation-delay: 0.25s; }
.feature-card:nth-child(6) { animation-delay: 0.3s; }

.why-item {
    animation: fadeInUp 0.6s ease forwards;
}

.why-item:nth-child(1) { animation-delay: 0.05s; }
.why-item:nth-child(2) { animation-delay: 0.1s; }
.why-item:nth-child(3) { animation-delay: 0.15s; }
.why-item:nth-child(4) { animation-delay: 0.2s; }

.stat-item {
    animation: fadeInUp 0.5s ease forwards;
}

.stat-item:nth-child(1) { animation-delay: 0.05s; }
.stat-item:nth-child(2) { animation-delay: 0.1s; }
.stat-item:nth-child(3) { animation-delay: 0.15s; }
.stat-item:nth-child(4) { animation-delay: 0.2s; }

.server-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

/* Плавные переходы для всех интерактивных элементов */
a, button, .server-card, .feature-card, .why-item, .stat-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Плавное появление страницы */
.hero, .features, .why-us, .cta-section, .stats-banner {
    animation: fadeIn 0.8s ease;
}

/* Загрузочный спиннер с анимацией */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Пульсация для кнопок */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.btn-primary:active {
    animation: pulse 0.3s ease;
}

/* Скелетон-загрузка для серверов */
.loading-skeleton {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 20px;
    animation: shimmer 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* ============================================
   СТАТИСТИКА (BANNER)
   ============================================ */

.stats-banner {
    padding: 30px 0 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.stat-item {
    text-align: center;
}

.stat-item .stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: -0.5px;
}

.stat-item .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

/* ============================================
   FEATURES
   ============================================ */

.features {
    padding: 50px 0 40px;
}

.features h2 {
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.features .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    padding: 28px 24px;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    transition: all var(--transition);
    box-shadow: var(--shadow);
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--gold);
    box-shadow: var(--shadow-hover);
}

.feature-card .feature-icon {
    font-size: 36px;
    color: var(--gold);
    margin-bottom: 14px;
    display: block;
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

/* ============================================
   ПОЧЕМУ МЫ
   ============================================ */

.why-us {
    padding: 40px 0;
}

.why-us h2 {
    text-align: center;
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 36px;
    letter-spacing: -0.5px;
}

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

.why-item {
    text-align: center;
    padding: 20px;
}

.why-item i {
    font-size: 36px;
    color: var(--gold);
    margin-bottom: 12px;
    display: block;
}

.why-item h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.why-item p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   CTA (ПРИЗЫВ К ДЕЙСТВИЮ)
   ============================================ */

.cta-section {
    padding: 50px 0 40px;
}

.cta-content {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
    border-radius: var(--radius);
    padding: 50px 40px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.cta-content h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.cta-content p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 24px;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 20px;
}

footer .heart {
    color: #e74c3c;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 34px;
    }
    
    .hero-image .shield-icon {
        font-size: 80px;
    }
    
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .why-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        padding: 20px;
    }
    
    .cta-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 28px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons a {
        justify-content: center;
        text-align: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .why-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-btn .name {
        display: none;
    }
    
    .profile-dropdown {
        min-width: 180px;
        right: -20px;
    }
}