/* ============================================
   CRYPTONALOG - MODERN DESIGN
   ============================================ */

/* === ШРИФТЫ === */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================
   VARIABLES & ROOT
   ============================================ */
:root {
    /* === ЦВЕТА === */
    --primary-blue: #3B82F6;
    --primary-purple: #8B5CF6;
    --accent-gold: #F59E0B;
    --dark-navy: #0F172A;

    /* Устаревшие переменные (для совместимости) */
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --secondary: #8B5CF6;
    --accent: #F59E0B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;

    /* === НЕЙТРАЛЬНЫЕ ЦВЕТА === */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-500: #64748B;
    --gray-900: #0F172A;

    /* === ГРАДИЕНТЫ === */
    --gradient-hero: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #334155 100%);
    --gradient-primary: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #14B8A6 100%);
    --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    --gradient-danger: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    --gradient-gold: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    --gradient-premium: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);

    /* === ТЕНИ === */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 16px 48px rgba(15, 23, 42, 0.16);
    --shadow-primary: 0 8px 32px rgba(59, 130, 246, 0.3);
    --shadow-success: 0 8px 32px rgba(16, 185, 129, 0.3);

    /* === BORDER RADIUS === */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --border-radius: 16px; /* для обратной совместимости */

    /* === SPACING (8px система) === */
    --spacing-1: 0.5rem;
    --spacing-2: 1rem;
    --spacing-3: 1.5rem;
    --spacing-4: 2rem;
    --spacing-5: 2.5rem;
    --spacing-6: 3rem;
    --spacing-8: 4rem;
    --spacing-10: 5rem;
    --spacing-12: 6rem;

    /* === ТИПОГРАФИКА === */
    --font-heading: 'Space Grotesk', -apple-system, system-ui, sans-serif;
    --font-body: 'Inter', -apple-system, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* === TRANSITIONS === */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 50%, #F59E0B 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--gray-900);
    overflow-x: hidden;
}

/* === ТИПОГРАФИКА === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-3);
}

h1 {
    font-size: 1.8rem;
    font-weight: 800;
}
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.95rem; }

.mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* Статичный фон (убрали анимацию для стабильности) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(240, 147, 251, 0.2) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    transition: var(--transition);
    position: relative;
    z-index: 1050;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
}

.navbar-brand:hover {
    opacity: 0.9;
}

.navbar-brand i {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 1rem !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link:hover {
    color: white !important;
}

/* Dropdown menu fix */
.navbar .dropdown-menu {
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 0.5rem;
    margin-top: 0.5rem;
    position: absolute;
    z-index: 1060;
}

.navbar .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.navbar .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.navbar .dropdown-item-text {
    color: rgba(255, 255, 255, 0.6) !important;
}

.navbar .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

.nav-link.dropdown-toggle::after {
    display: none;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
    background: white;
    border-radius: 24px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: none;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.4);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: var(--shadow-success);
}

.btn-success:hover {
    opacity: 0.9;
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.btn-outline-secondary {
    background: transparent;
    border: 2px solid var(--gray-200);
    color: var(--gray-900);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: 1.125rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
    background: white;
}

.card:hover {
    box-shadow: var(--shadow-xl);
}

.card-header {
    border: none;
    padding: 1.5rem;
    font-weight: 700;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-body {
    padding: 2rem;
}

/* Glassmorphism карточки */
.card.glass,
.card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Премиум карточка */
.card-premium {
    background: var(--gradient-premium);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Цветные карточки */
.card.border-primary {
    border-top: 4px solid var(--primary);
}

.card.border-success {
    border-top: 4px solid var(--success);
}

.card.border-danger {
    border-top: 4px solid var(--danger);
}

/* ============================================
   HERO SECTION
   ============================================ */
.display-4 {
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.lead {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

/* ============================================
   FEATURE CARDS (главная страница)
   ============================================ */

.bi-file-earmark-arrow-up {
    color: var(--primary);
}

.bi-calculator-fill {
    color: var(--success);
}

.bi-file-earmark-text {
    color: var(--warning);
}

/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    min-height: 48px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    outline: none;
}

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-1);
}

.form-text {
    color: var(--gray);
    font-size: 0.875rem;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-3);
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border-left: 4px solid var(--success);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 146, 60, 0.1) 100%);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
    border-left: 4px solid var(--info);
    color: #1e40af;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
}

.badge.bg-success {
    background: var(--gradient-success) !important;
}

.badge.bg-warning {
    background: var(--gradient-gold) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead {
    background: var(--gradient-primary);
    color: white;
}

.table thead th {
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    color: white;
    padding: var(--spacing-2);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover,
.table-hover tbody tr:hover {
    background: var(--gray-50);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem 0;
    margin-top: 4rem;
}

footer p {
    margin: 0.5rem 0;
}

footer strong {
    color: white;
}

/* ============================================
   RESULT CARDS (preview page)
   ============================================ */
.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.display-4 {
    font-size: 3rem;
    font-weight: 800;
}

/* ============================================
   CRYPTO PAYMENT OPTIONS
   ============================================ */
.crypto-option {
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.crypto-option:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.crypto-option .card-body {
    padding: 2rem;
}

/* ============================================
   SPINNER
   ============================================ */
.spinner-border {
    animation: spinner-grow 1s linear infinite;
}

@keyframes spinner-grow {
    0% {
        transform: rotate(0deg) scale(0.8);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(0.8);
    }
}

/* ============================================
   ПРОГРЕСС БАР
   ============================================ */
.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    overflow: hidden;
}

.progress-bar {
    background: var(--gradient-primary);
    transition: width 0.6s ease;
}

/* ============================================
   HERO СЕКЦИЯ
   ============================================ */
.hero-section {
    background: var(--gradient-hero);
    color: white;
    padding: var(--spacing-12) 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* ============================================
   СТАТИСТИКА
   ============================================ */
.stats-card {
    text-align: center;
    padding: var(--spacing-3);
    border-radius: var(--radius-lg);
    background: white;
    transition: var(--transition);
}

.stats-card:hover {
    box-shadow: var(--shadow-lg);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    margin: 0;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   SPACING UTILITIES
   ============================================ */
.section-spacing {
    padding: var(--spacing-8) 0;
}

/* ============================================
   АНИМАЦИЯ BOUNCE
   ============================================ */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.icon-bounce:hover {
    animation: bounce 0.5s ease;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }

    main {
        padding: 2rem 1rem;
        border-radius: 16px;
    }

    .display-4 {
        font-size: 2rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: var(--spacing-3);
    }

    .section-spacing {
        padding: var(--spacing-4) 0;
    }

    .hero-section {
        padding: var(--spacing-8) 0;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-success);
}

/* ============================================
   UTILITIES
   ============================================ */
.shadow-custom {
    box-shadow: var(--shadow-lg);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
}