/* ===== MODERN LOTTERY SITE STYLES ===== */

/* Импорт Tailwind CSS */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Кастомные CSS переменные (устанавливаются из PHP) */
:root {
    --color-main-bg: #111827;
    --color-card-bg: #1F2937;
    --color-main-text: #F3F4F6;
    --color-accent: #38BDF8;
    --color-gold-start: #FBBF24;
    --color-gold-end: #D97706;
    --font-title: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --button-corners: lg;
    --card-corners: xl;
    
    /* Дополнительные переменные */
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.15);
    --shadow-gold: 0 4px 20px rgba(251, 191, 36, 0.25);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-main-bg);
    color: var(--color-main-text);
    line-height: 1.6;
    overflow-x: hidden;
    
    /* Красивый градиентный фон */
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(251, 191, 36, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(167, 139, 250, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

.font-title {
    font-family: var(--font-title);
}

/* ===== УТИЛИТАРНЫЕ КЛАССЫ ===== */

.bg-main-bg { background-color: var(--color-main-bg); }
.bg-card-bg { background-color: var(--color-card-bg); }
.text-main-text { color: var(--color-main-text); }
.text-accent { color: var(--color-accent); }
.border-accent { border-color: var(--color-accent); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    outline: none;
    
    /* Анти-алиасинг для четких границ */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.btn::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.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

/* Золотая кнопка */
.btn-golden {
    background: linear-gradient(135deg, var(--color-gold-start), var(--color-gold-end));
    color: #1a1a1a;
    box-shadow: var(--shadow-gold);
    border-radius: calc(var(--button-corners) * 0.25rem);
}

.btn-golden:hover {
    background: linear-gradient(135deg, #fcd34d, #f59e0b);
    box-shadow: 0 8px 30px rgba(251, 191, 36, 0.4);
    color: #0f0f0f;
}

/* Вторичная кнопка */
.btn-secondary {
    background: transparent;
    border-color: var(--color-accent);
    color: var(--color-accent);
    border-radius: calc(var(--button-corners) * 0.25rem);
    position: relative;
    z-index: 1;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--color-accent);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-secondary:hover::after {
    width: 100%;
}

.btn-secondary:hover {
    color: var(--color-main-bg);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

/* ===== НАВИГАЦИЯ ===== */

.nav-link {
    position: relative;
    padding: 0.5rem 0;
    color: #d1d5db;
    transition: var(--transition-smooth);
    font-weight: 500;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-gold-start));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: white;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===== HERO СЕКЦИЯ ===== */

.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--color-main-bg), transparent);
    z-index: 2;
}

.hero-section > * {
    position: relative;
    z-index: 3;
}

/* Анимированные частицы для фона */
.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: var(--color-accent);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    opacity: 0.1;
}

.particle:nth-child(1) { width: 4px; height: 4px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 6px; height: 6px; left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { width: 3px; height: 3px; left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { width: 5px; height: 5px; left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { width: 4px; height: 4px; left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { width: 6px; height: 6px; left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { width: 3px; height: 3px; left: 70%; animation-delay: 0.5s; }
.particle:nth-child(8) { width: 5px; height: 5px; left: 80%; animation-delay: 1.5s; }
.particle:nth-child(9) { width: 4px; height: 4px; left: 90%; animation-delay: 2.5s; }

@keyframes float {
    0%, 100% { transform: translateY(100vh) scale(0); }
    10% { transform: translateY(90vh) scale(1); }
    90% { transform: translateY(-10vh) scale(1); }
    100% { transform: translateY(-10vh) scale(0); }
}

/* ===== КАРТОЧКИ ЛОТЕРЕЙ ===== */

.lottery-card {
    background: var(--color-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: calc(var(--card-corners) * 0.25rem);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
    backdrop-filter: blur(10px);
}

.lottery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(56, 189, 248, 0.1) 0%,
        transparent 50%,
        rgba(251, 191, 36, 0.1) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.lottery-card > * {
    position: relative;
    z-index: 2;
}

.lottery-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-accent);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(56, 189, 248, 0.2),
        var(--shadow-glow);
}

.lottery-card:hover::before {
    opacity: 1;
}

/* ===== ТАЙМЕРЫ ОБРАТНОГО ОТСЧЕТА ===== */

.countdown-timer {
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

.timer-box {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 800;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 3.5rem;
    position: relative;
    overflow: hidden;
}

.timer-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== FAQ СЕКЦИЯ ===== */

.faq-item {
    background: var(--color-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: calc(var(--card-corners) * 0.25rem);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.faq-item:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 1.125rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer.open {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    color: #d1d5db;
    line-height: 1.7;
}

/* ===== УТИЛИТЫ ALPINE.JS ===== */

[x-cloak] {
    display: none !important;
}

/* ===== КАСТОМНЫЙ СКРОЛЛБАР ===== */

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-main-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-accent), var(--color-gold-start));
    border-radius: 6px;
    border: 2px solid var(--color-main-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0ea5e9, #eab308);
}

/* ===== АНИМАЦИИ ===== */

@keyframes glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

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

/* Классы для анимаций */
.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

.animate-slide-up {
    animation: slide-up 0.6s ease-out;
}

/* ===== ГРАДИЕНТНЫЕ ТЕКСТЫ ===== */

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

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

/* ===== LOADING STATES ===== */

.skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

/* Планшеты */
@media (max-width: 768px) {
    .hero-section {
        min-height: 80vh;
        background-attachment: scroll;
    }
    
    .lottery-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .countdown-timer {
        gap: 0.5rem;
    }
    
    .timer-box {
        padding: 0.5rem 0.75rem;
        min-width: 3rem;
        font-size: 0.875rem;
    }
}

/* Мобильные устройства */
@media (max-width: 640px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .hero-section {
        min-height: 70vh;
    }
    
    .countdown-timer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .timer-box {
        padding: 0.5rem;
        min-width: 2.5rem;
        font-size: 0.75rem;
    }
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Высокий контраст */
@media (prefers-contrast: high) {
    .lottery-card {
        border-color: white;
    }
    
    .btn-secondary {
        border-width: 3px;
    }
    
    .nav-link {
        font-weight: 700;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .hero-section,
    .lottery-card,
    .btn,
    nav {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .hero-section::before,
    .hero-section::after {
        display: none;
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ УТИЛИТЫ ===== */

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.neon-glow {
    box-shadow: 
        0 0 5px var(--color-accent),
        0 0 10px var(--color-accent),
        0 0 15px var(--color-accent);
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Hover эффекты для интерактивности */
.hover-lift {
    transition: var(--transition-smooth);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

.hover-scale {
    transition: var(--transition-smooth);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ===== ФИНАЛЬНЫЕ ШТРИХИ ===== */

/* Smooth focus для accessibility */
*:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Плавное появление контента */
.fade-in {
    opacity: 0;
    animation: fade-in 0.6s ease-out forwards;
}

@keyframes fade-in {
    to { opacity: 1; }
}

/* Стили загружены успешно */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}