/**
 * Modern Dynamic LK Styles
 * Beautiful, animated, and lively design
 */

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-cool: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    
    /* Background */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-card-hover: rgba(51, 65, 85, 0.9);
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.4);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--spacing-md) 0;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

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

.header-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    opacity: 0.8;
}

.header-home-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar-container {
    position: relative;
    cursor: pointer;
    display: inline-block;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 2px solid var(--primary);
    object-fit: cover;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    cursor: pointer;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.user-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid var(--primary);
    cursor: pointer;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* Header balance badge */
.header-balance {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px 5px 8px;
    background: rgba(46, 184, 90, 0.12);
    border: 1px solid rgba(46, 184, 90, 0.3);
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.header-balance:hover {
    background: rgba(46, 184, 90, 0.22);
    border-color: rgba(46, 184, 90, 0.55);
    transform: scale(1.04);
}
.header-balance:active {
    transform: scale(0.97);
}
.header-balance svg {
    color: #2eb85a;
    flex-shrink: 0;
}
.header-balance-val {
    font-size: 13px;
    font-weight: 700;
    color: #2eb85a;
    line-height: 1;
}
.header-balance-cur {
    font-size: 10px;
    font-weight: 500;
    color: rgba(46, 184, 90, 0.75);
    line-height: 1;
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* User info block: avatar + name+balance column */
.user-info-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
}
.user-info-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 110px;
}

.user-menu-username {
    padding: 10px 14px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* User Menu Popup */
.user-menu-popup {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    min-width: 220px;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1000;
    animation: fadeInDown 0.3s ease;
}

.user-menu-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Light theme - white background */
body.light-theme .user-menu-popup {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Dark theme - dark background */
body:not(.light-theme) .user-menu-popup {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.user-menu-item:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.user-menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: var(--spacing-xs) 0;
    padding: 0;
    cursor: default;
}

.user-menu-divider:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.1);
}

.user-menu-theme-toggle {
    justify-content: space-between;
    cursor: default;
}

.user-menu-item-logout {
    color: #ef4444 !important;
}

.user-menu-item-logout:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #dc2626 !important;
}

.user-menu-theme-toggle:hover {
    transform: none;
}

/* Theme Toggle Switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    transition: var(--transition-normal);
    border-radius: var(--radius-full);
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition-normal);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.theme-switch input:checked + .theme-slider {
    background: var(--gradient-primary);
}

.theme-switch input:checked + .theme-slider:before {
    transform: translateX(24px);
}

/* Light Theme */
body.light-theme,
html.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(241, 245, 249, 0.9);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
}

body.light-theme::before {
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(96, 165, 250, 0.03) 0%, transparent 50%);
}

body.light-theme .user-menu-item.user-menu-divider {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .user-menu-divider:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.light-theme .user-menu-item-logout {
    color: #dc2626 !important;
}

body.light-theme .user-menu-item-logout:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #b91c1c !important;
}

/* Main Navigation */
.main-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    padding: 6px;
    border-radius: var(--radius-lg);
    margin: var(--spacing-lg) 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.main-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.1;
    z-index: 0;
}

.nav-btn {
    flex: 1 1 auto;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--gradient-primary);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    z-index: -1;
}

.nav-btn:hover::before,
.nav-btn.active::before {
    width: 200%;
    height: 200%;
}

.nav-btn:hover,
.nav-btn.active {
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

.nav-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.nav-btn:hover svg,
.nav-btn.active svg {
    transform: scale(1.1) rotate(5deg);
}

.nav-btn span {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1;
}

/* Light theme styles for navigation buttons */
body.light-theme .main-nav::before,
html.light-theme .main-nav::before {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03), rgba(59, 130, 246, 0.03));
    opacity: 1;
}

body.light-theme .nav-btn::before,
html.light-theme .nav-btn::before {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

body.light-theme .nav-btn,
html.light-theme .nav-btn {
    background: transparent;
}

body.light-theme .nav-btn:hover,
body.light-theme .nav-btn.active,
html.light-theme .nav-btn:hover,
html.light-theme .nav-btn.active {
    color: #6366f1 !important;
    background: rgba(99, 102, 241, 0.12) !important;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2) !important;
}

body.light-theme .nav-btn:hover::before,
body.light-theme .nav-btn.active::before,
html.light-theme .nav-btn:hover::before,
html.light-theme .nav-btn.active::before {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

body.light-theme .nav-btn:hover svg,
body.light-theme .nav-btn.active svg,
html.light-theme .nav-btn:hover svg,
html.light-theme .nav-btn.active svg {
    color: #6366f1 !important;
    fill: #6366f1 !important;
    stroke: #6366f1 !important;
}

body.light-theme .nav-btn:hover span,
body.light-theme .nav-btn.active span,
html.light-theme .nav-btn:hover span,
html.light-theme .nav-btn.active span {
    color: #6366f1 !important;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    animation: fadeInUp 0.6s ease;
    position: relative;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.5);
}

.card-header {
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-header svg {
    width: 14px;
    height: 14px;
    color: var(--primary-light);
    filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.5));
    flex-shrink: 0;
}

.card-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.card-body {
    padding: var(--spacing-lg);
}

/* Stats Grid */
.stats-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--spacing-xs);
    margin: var(--spacing-md) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.stats-grid::-webkit-scrollbar {
    display: none;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.6s ease;
    animation-fill-mode: both;
    flex: 1 1 0;
    min-width: fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.stat-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
    line-height: 1.2;
    white-space: nowrap;
}

.stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    line-height: 1.2;
    display: inline-flex;
    white-space: nowrap;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-secondary {
    background: var(--gradient-secondary);
}

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

/* Welcome (Web) */
/* Welcome Page - Modern Design */
.web-auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg) 0;
}

.welcome-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.welcome-main {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-xl);
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: welcomeFadeIn 0.6s ease-out;
}

@keyframes welcomeFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    animation: welcomeGlow 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes welcomeGlow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(20%, 20%) scale(1.2);
        opacity: 0.8;
    }
}

.welcome-content {
    position: relative;
    z-index: 1;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    animation: welcomeSlideDown 0.5s ease-out 0.1s both;
}

@keyframes welcomeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
    animation: welcomePulse 2s ease-in-out infinite;
}

@keyframes welcomePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

.welcome-title {
    font-size: 32px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    letter-spacing: -0.03em;
    animation: welcomeSlideDown 0.5s ease-out 0.2s both;
}

.welcome-title-gradient {
    background: linear-gradient(135deg, #6366f1, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.welcome-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
    animation: welcomeSlideDown 0.5s ease-out 0.3s both;
}

.welcome-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.welcome-feature-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    animation: welcomeSlideUp 0.5s ease-out both;
    position: relative;
    overflow: hidden;
}

.welcome-feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.welcome-feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.welcome-feature-card:hover::before {
    opacity: 1;
}

.welcome-feature-card:hover .welcome-feature-icon {
    transform: scale(1.1) rotate(5deg);
}

@keyframes welcomeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-feature-icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.welcome-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(59, 130, 246, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.welcome-feature-content {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.welcome-feature-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.welcome-feature-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.welcome-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    animation: welcomeSlideDown 0.5s ease-out 0.5s both;
}

.welcome-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.welcome-btn-primary {
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.welcome-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.welcome-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
}

.welcome-btn-primary:hover::before {
    opacity: 1;
}

.welcome-btn-primary span,
.welcome-btn-primary svg {
    position: relative;
    z-index: 1;
}

.welcome-btn-primary svg {
    transition: transform 0.3s ease;
}

.welcome-btn-primary:hover svg {
    transform: translateX(4px);
}

.welcome-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.welcome-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Light Theme */
body.light-theme .welcome-main {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

body.light-theme .welcome-glow {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}

body.light-theme .welcome-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.1));
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

body.light-theme .welcome-feature-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(15, 23, 42, 0.1);
}

body.light-theme .welcome-feature-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

body.light-theme .welcome-feature-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(59, 130, 246, 0.1));
    border-color: rgba(99, 102, 241, 0.2);
}

body.light-theme .welcome-btn-secondary {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}

body.light-theme .welcome-btn-secondary:hover {
    background: rgba(15, 23, 42, 0.1);
    border-color: rgba(15, 23, 42, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .welcome-main {
        padding: var(--spacing-lg);
    }
    
    .welcome-title {
        font-size: 28px;
    }
    
    .welcome-features {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .welcome-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .welcome-main {
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
    }
    
    .welcome-title {
        font-size: 24px;
    }
    
    .welcome-description {
        font-size: 14px;
    }
    
    .welcome-feature-card {
        padding: 12px;
    }
    
    .welcome-feature-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-normal);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--bg-secondary);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.list-item:hover::before {
    transform: scaleY(1);
}

.list-item:hover {
    background: var(--bg-card-hover);
    padding-left: var(--spacing-lg);
    transform: translateX(4px);
}

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all var(--transition-normal);
}

.list-item:hover .list-item-icon {
    opacity: 1;
    transform: scale(1.1) rotate(5deg);
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.list-item-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.list-item-arrow {
    font-size: 20px;
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}

.list-item:hover .list-item-arrow {
    transform: translateX(4px);
}

/* Dashboard */
.dashboard {
    padding: var(--spacing-lg) 0;
}

.welcome-banner {
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: fadeInDown 0.6s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.welcome-banner h2 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Page Header */
.page-header {
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInUp 0.6s ease;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.3;
}

/* Admin Panel Button */
.admin-panel-btn {
    padding: 8px 16px;
    background: var(--gradient-secondary);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.admin-panel-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Icon Buttons */
.icon-btn-small {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.icon-btn-small:hover {
    transform: scale(1.1);
    background: var(--primary);
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: var(--spacing-lg);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .stats-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
    }
    
    .stat-card {
        padding: 6px 10px;
        flex: 1 1 auto;
        min-width: fit-content;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-label {
        font-size: 8px;
    }
    
    .main-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-btn {
        flex: 1 1 auto;
        min-width: 70px;
        flex-shrink: 1;
    }
    
    .nav-btn span {
        font-size: 11px;
    }
    
    .nav-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
    }
    
    .stat-card {
        padding: 5px 8px;
        flex: 1 1 auto;
        min-width: fit-content;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .stat-label {
        font-size: 7px;
    }
    
    .main-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .nav-btn {
        flex: 1 1 auto;
        min-width: 60px;
        flex-shrink: 1;
    }
    
    .nav-btn span {
        font-size: 10px;
    }
    
    .nav-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Floating particles effect */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-100px) translateX(50px);
    }
    50% {
        transform: translateY(-200px) translateX(-50px);
    }
    75% {
        transform: translateY(-100px) translateX(100px);
    }
}

/* Server Management Buttons */
.server-item-actions {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-server-edit,
.btn-server-delete {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-server-edit {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.3);
}

.btn-server-edit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-server-edit:hover::before {
    width: 140px;
    height: 140px;
}

.btn-server-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

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

.btn-server-edit svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.btn-server-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.3);
}

.btn-server-delete::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-server-delete:hover::before {
    width: 140px;
    height: 140px;
}

.btn-server-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

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

.btn-server-delete svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

.server-list-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.btn-add-server {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-add-server::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn-add-server:hover::before {
    width: 400px;
    height: 400px;
}

.btn-add-server:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-add-server:active {
    transform: translateY(-1px);
}

.btn-add-server svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.btn-add-server:hover svg {
    transform: rotate(90deg) scale(1.1);
}

/* Light theme adjustments for server buttons */
html.light-theme .btn-server-edit,
body.light-theme .btn-server-edit {
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2);
}

html.light-theme .btn-server-edit:hover,
body.light-theme .btn-server-edit:hover {
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

html.light-theme .btn-server-delete,
body.light-theme .btn-server-delete {
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.2);
}

html.light-theme .btn-server-delete:hover,
body.light-theme .btn-server-delete:hover {
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

html.light-theme .btn-add-server,
body.light-theme .btn-add-server {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

html.light-theme .btn-add-server:hover,
body.light-theme .btn-add-server:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* Server Form Buttons */
.server-form-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.btn-test-connection,
.btn-save-server,
.btn-cancel-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-test-connection {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-test-connection::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn-test-connection:hover::before {
    width: 300px;
    height: 300px;
}

.btn-test-connection:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

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

.btn-test-connection svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.btn-test-connection:hover svg {
    transform: scale(1.1);
}

.btn-save-server {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-save-server::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.btn-save-server:hover::before {
    width: 300px;
    height: 300px;
}

.btn-save-server:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-save-server:active:not(:disabled) {
    transform: translateY(0);
}

.btn-save-server:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.btn-save-server svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.btn-save-server:hover:not(:disabled) svg {
    transform: scale(1.1) translateY(-1px);
}

.btn-cancel-form {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-cancel-form::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-cancel-form:hover::before {
    width: 200px;
    height: 200px;
}

.btn-cancel-form:hover {
    transform: translateY(-1px);
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

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

.btn-cancel-form svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.btn-cancel-form:hover svg {
    transform: rotate(90deg);
}

/* Light theme adjustments for form buttons */
html.light-theme .btn-test-connection,
body.light-theme .btn-test-connection {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

html.light-theme .btn-test-connection:hover,
body.light-theme .btn-test-connection:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

html.light-theme .btn-save-server,
body.light-theme .btn-save-server {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

html.light-theme .btn-save-server:hover:not(:disabled),
body.light-theme .btn-save-server:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

html.light-theme .btn-cancel-form,
body.light-theme .btn-cancel-form {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

html.light-theme .btn-cancel-form:hover,
body.light-theme .btn-cancel-form:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* Statistics Toggle Switches */
.statistics-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    padding: var(--spacing-xs) 0;
    user-select: none;
}

.statistics-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.statistics-toggle input[type="checkbox"]:checked + .toggle-slider {
    background: var(--gradient-primary);
    border-color: var(--primary);
}

.statistics-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #ffffff;
}

.statistics-toggle:hover .toggle-slider {
    border-color: var(--primary);
}

.statistics-toggle span:last-child {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.statistics-section-divider {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--spacing-sm) 0;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.statistics-section-divider::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 1px;
    background: var(--gradient-primary);
}

/* Notifications */
.notification {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    min-width: 300px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.notification.info {
    border-left: 4px solid var(--info);
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.notification-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification.hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* Light theme adjustments for notifications */
.light-theme .notification {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .notification-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Accounts expand button */
.btn-expand-accounts {
    position: relative;
    overflow: hidden;
}

.btn-expand-accounts::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-expand-accounts:hover::before {
    width: 300px;
    height: 300px;
}

.btn-expand-accounts:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modalFadeIn 0.2s ease;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.22s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

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

@keyframes modalSlideIn {
    from { transform: translateY(-12px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)     scale(1);    opacity: 1; }
}

/* Light theme modal */
.light-theme .modal-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

.light-theme .modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.light-theme .modal-close {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.light-theme .modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
}
