/* ========================================
   MAGIC NUMBERS - BASE CSS
   Premium Casino Design System
   ======================================== */

/* === FONTS === */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-600.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat-700.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Russo One';
    src: url('../fonts/RussoOne-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* === CSS VARIABLES - Premium Casino Theme === */
:root {
    /* Primary Colors - Deep Purple Accent */
    --primary: #7C4DFF;
    --primary-light: #B388FF;
    --primary-dark: #651FFF;
    --secondary: #536DFE;
    
    /* Accent Colors */
    --accent: #FF4081;
    --accent-light: #FF80AB;
    --premium: #E040FB;
    --premium-dark: #AA00FF;
    
    /* Status Colors */
    --success: #00E676;
    --success-dark: #00C853;
    --warning: #FFD740;
    --warning-dark: #FFC400;
    --error: #FF5252;
    --error-dark: #FF1744;
    
    /* Background Colors - Deep Dark Theme */
    --dark: #0D0F1C;
    --darker: #080A14;
    --surface: rgba(13, 15, 28, 0.95);
    --surface-light: rgba(26, 28, 43, 0.95);
    --surface-elevated: rgba(35, 38, 58, 0.95);
    
    /* Text Colors */
    --light: #F8F9FA;
    --text: #E8EAED;
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-disabled: rgba(255, 255, 255, 0.38);
    
    /* Special Colors */
    --usdt: #26A17B;
    --usdt-light: #4ED3A0;
    --crypto: #F7931A;
    --gold: #FFD700;
    --gold-dark: #FFC107;
    
    /* Game Mode Colors */
    --mode-9: #00E676;
    --mode-9-bg: rgba(0, 230, 118, 0.15);
    --mode-3: #FF9100;
    --mode-3-bg: rgba(255, 145, 0, 0.15);
    
    /* Player Colors */
    --player1: #7C4DFF;
    --player2: #FF4081;
    --player3: #00E676;
    --bot: #AB47BC;
    
    /* Tier Colors */
    --bronze: #CD7F32;
    --silver: #C0C0C0;
    --platinum: #E5E4E2;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-border-hover: rgba(255, 255, 255, 0.2);
    
    /* Layout */
    --container-max-width: 1200px;
    --container-padding: 20px;
    --border-radius: 20px;
    --border-radius-lg: 24px;
    --border-radius-sm: 12px;
    --border-radius-xs: 8px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow-primary: 0 0 30px rgba(124, 77, 255, 0.4);
    --shadow-glow-success: 0 0 30px rgba(0, 230, 118, 0.4);
    --shadow-glow-accent: 0 0 30px rgba(255, 64, 129, 0.4);
    --shadow-glow-gold: 0 0 30px rgba(255, 215, 0, 0.4);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;
    --z-notification: 800;
}

/* === RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === BASE STYLES === */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    background: var(--darker);
    color: var(--light);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated gradient background for body */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 10% 20%, rgba(124, 77, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(255, 64, 129, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 230, 118, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker);
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 77, 255, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 77, 255, 0.6);
}

/* === SELECTION === */
::selection {
    background: var(--primary);
    color: white;
}

/* === NAVIGATION === */
.global-nav {
    width: 100%;
    background: rgba(8, 10, 20, 0.85);
    border-bottom: 1px solid var(--glass-border);
    padding: 12px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: var(--z-fixed);
    gap: 15px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-logo {
    font-family: 'Russo One', 'Montserrat', cursive;
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: var(--transition-normal);
    text-shadow: 0 0 30px rgba(124, 77, 255, 0.5);
}

.nav-logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 40px rgba(124, 77, 255, 0.8);
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-toggle {
    display: none;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: var(--transition-fast);
}

.nav-toggle:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: var(--transition-normal);
    border-radius: 2px;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
}

.nav-btn:hover {
    background: var(--glass-bg-hover);
    border-color: var(--primary);
    color: var(--light);
    transform: translateY(-2px);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
    transition: var(--transition-fast);
}

.nav-btn:hover .nav-icon {
    transform: scale(1.1);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--primary);
    transition: var(--transition-fast);
}

.nav-btn:hover .nav-avatar {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(255, 64, 129, 0.4);
}

.nav-profile.has-premium .nav-avatar,
.nav-profile.has-premium .nav-avatar-placeholder {
    border-color: var(--gold);
    box-shadow: var(--shadow-glow-gold);
    animation: premium-glow 2s ease-in-out infinite alternate;
}

@keyframes premium-glow {
    0% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.5); }
    100% { box-shadow: 0 0 25px rgba(255, 215, 0, 0.8); }
}

.nav-avatar-placeholder {
    display: block;
    width: 32px;
    height: 32px;
}

.nav-avatar-placeholder svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.nav-logout {
    background: rgba(255, 82, 82, 0.15);
    border-color: rgba(255, 82, 82, 0.3);
}

.nav-logout:hover {
    background: rgba(255, 82, 82, 0.25);
    border-color: var(--error);
}

.nav-wallet {
    font-weight: 700;
}

/* === PAGE CONTAINER === */
.page-container {
    max-width: var(--container-max-width);
    margin: 25px auto;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

/* Subtle glow effect on container */
.page-container::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

/* === PAGE HEADER (темная шапка с информацией о странице) === */
.page-header {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.1) 0%, rgba(255, 64, 129, 0.05) 100%);
    border-bottom: 1px solid var(--glass-border);
    padding: 24px 30px;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.page-header-content {
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 1;
}

.page-header-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow-primary);
}

.page-header-icon svg {
    width: 26px;
    height: 26px;
    fill: white;
}

.page-header-text {
    flex: 1;
}

.page-header-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--light);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* === PAGE CONTENT === */
.page-content {
    padding: 30px;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.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.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn svg,
.btn .inline-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Primary Button (default) */
.btn,
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.35);
}

.btn:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 77, 255, 0.5);
}

.btn:active,
.btn-primary:active {
    transform: translateY(0);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: #0D0F1C;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.35);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 230, 118, 0.5);
}

/* Accent Button */
.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 64, 129, 0.35);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 64, 129, 0.5);
}
/* Secondary Button (outline style) */
.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--light);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--glass-bg-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-secondary::before {
    display: none;
}

/* Premium Button */
.btn-premium {
    background: linear-gradient(135deg, var(--premium) 0%, var(--premium-dark) 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(224, 64, 251, 0.4);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(224, 64, 251, 0.6);
}
/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
    border-radius: 14px;
}

.btn-lg svg {
    width: 20px;
    height: 20px;
}

/* Button States */
.btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-disabled);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn:disabled::before {
    display: none;
}
/* === CARDS === */
.card {
    background: var(--glass-bg);
    border-radius: var(--border-radius-sm);
    padding: 25px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-normal);
}

.card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === FORM ELEMENTS === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--light);
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="time"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius-xs);
    background: var(--glass-bg);
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(124, 77, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.15);
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Input with icon */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-left: 48px;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
    transition: var(--transition-fast);
}

.input-with-icon input:focus + .input-icon,
.input-with-icon:focus-within .input-icon {
    fill: var(--primary);
}

/* Password Strength Indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    background: var(--glass-bg);
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: var(--transition-normal);
    width: 0;
}

.password-strength-bar.weak { width: 25%; background: var(--error); }
.password-strength-bar.fair { width: 50%; background: var(--warning); }
.password-strength-bar.good { width: 75%; background: var(--success); }
.password-strength-bar.strong { width: 100%; background: linear-gradient(90deg, var(--success), var(--primary)); }

/* === UTILITIES === */
.inline-icon {
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
    margin-right: 6px;
}

h1 .inline-icon,
h2 .inline-icon,
h3 .inline-icon {
    fill: white;
}

/* text-center, text-left, text-right removed - unused */

.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-usdt { color: var(--usdt); }
.text-gold { color: var(--gold); }

.mt-2 { margin-top: 20px; } /* Only mt-2 is used */

/* === NOTIFICATIONS / TOASTS === */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--surface-elevated);
    color: white;
    padding: 16px 24px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-notification);
    transform: translateX(calc(100% + 30px));
    transition: var(--transition-normal);
    border-left: 4px solid var(--success);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    border-left-color: var(--error);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification.info {
    border-left-color: var(--primary);
}

.notification-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    margin-bottom: 24px;
    opacity: 0.4;
}

.empty-state-icon svg {
    width: 80px;
    height: 80px;
    fill: var(--primary);
}

.empty-state h3 {
    color: var(--light);
    font-size: 1.2rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* === LOADING STATE === */
.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.spinner {
    border: 3px solid var(--glass-border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--glass-bg) 25%, var(--glass-bg-hover) 50%, var(--glass-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-xs);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    z-index: var(--z-modal);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
    margin: auto;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), var(--shadow-glow-primary);
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 24px 28px;
    border-radius: 22px 22px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath fill-rule='evenodd' d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
    line-height: 1;
    position: relative;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.modal-body {
    padding: 28px;
    color: var(--light);
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(124, 77, 255, 0.4); }
    50% { box-shadow: 0 0 40px rgba(124, 77, 255, 0.8); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* === TOOLTIPS === */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--surface-elevated);
    color: var(--light);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--glass-border);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
    /* Body */
    body {
        padding: 0;
    }

    /* Page container */
    .page-container {
        margin: 12px 10px;
        border-radius: 18px;
    }

    /* Page header */
    .page-header {
        padding: 18px 20px;
    }

    .page-header-icon {
        width: 44px;
        height: 44px;
    }

    .page-header-icon svg {
        width: 22px;
        height: 22px;
    }

    .page-header-title {
        font-size: 1.15rem;
    }

    .page-header-subtitle {
        font-size: 0.85rem;
    }

    .page-content {
        padding: 20px 16px;
    }

    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10px;
        border-radius: 18px;
    }

    .modal-header {
        padding: 18px 20px;
        border-radius: 16px 16px 0 0;
    }

    .modal-header h2 {
        font-size: 1.15rem;
    }

    .modal-body {
        padding: 20px 16px;
    }
    
    /* Notification */
    .notification {
        right: 10px;
        left: 10px;
        top: 10px;
        max-width: none;
        transform: translateY(-200%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    
    .notification.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* Hide top nav, show bottom nav */
    .global-nav {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Bottom nav spacing - universal for all pages */
    body {
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
    }
    
    .page-container {
        margin-bottom: 80px !important;
    }
    
    .page-content {
        padding-bottom: 20px;
    }
}

/* === MOBILE BOTTOM NAVIGATION === */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(8, 10, 20, 0.98);
    border-top: 1px solid var(--glass-border);
    padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    z-index: var(--z-fixed);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Glow effect on top border */
.bottom-nav::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.bottom-nav-links {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    transition: var(--transition-fast);
    position: relative;
    border-radius: 10px;
}

.bottom-nav-item:hover {
    color: var(--light);
}

.bottom-nav-item.active {
    color: var(--primary);
}

/* Active indicator dot */
.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: var(--transition-fast);
}

.bottom-nav-item.active svg {
    fill: var(--primary);
    transform: scale(1.1);
}

/* Notification badge on bottom nav */
.bottom-nav-item .nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    background: var(--error);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Show bottom nav on mobile */
@media (max-width: 768px) {
    .bottom-nav {
        display: block;
    }
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
