/* ============================================================
   UNP Wallet Web - Shared Stylesheet
   Dark theme with purple accent (#6c50bf)
   Fully responsive: Desktop sidebar + Mobile bottom nav
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-purple: rgba(108, 80, 191, 0.3);
    --purple: #6c50bf;
    --purple-light: #a78bfa;
    --purple-dark: #4c3a8a;
    --purple-glow: rgba(108, 80, 191, 0.4);
    --gradient-purple: linear-gradient(135deg, #6c50bf 0%, #9333ea 100%);
    --gradient-card: linear-gradient(145deg, rgba(108, 80, 191, 0.2) 0%, rgba(147, 51, 234, 0.15) 50%, rgba(59, 130, 246, 0.1) 100%);
    --text-primary: #ffffff;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-width: 280px;
    --topbar-height: 0px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 28px;
    --shadow-purple: 0 15px 40px -10px rgba(108, 80, 191, 0.35);
    --shadow-card: 0 4px 15px -3px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Light Theme Override ---- */
[data-theme="light"] {
    --bg-primary: #f0f2f7;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-subtle: rgba(0, 0, 0, 0.07);
    --border-light: rgba(0, 0, 0, 0.1);
    --border-purple: rgba(108, 80, 191, 0.25);
    --gradient-card: linear-gradient(145deg, rgba(108, 80, 191, 0.08) 0%, rgba(147, 51, 234, 0.05) 50%, rgba(59, 130, 246, 0.03) 100%);
    --text-primary: #1a1a2e;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-dim: #9ca3af;
    --shadow-card: 0 4px 20px -5px rgba(0, 0, 0, 0.1);
    --shadow-purple: 0 15px 40px -10px rgba(108, 80, 191, 0.25);
}

/* ---- Light theme overrides for components ---- */
[data-theme="light"] .bg-animated {
    background: linear-gradient(135deg, #eef0f5 0%, #f5f3ff 50%, #eef0f5 100%);
}

[data-theme="light"] .bg-glow { opacity: 0.12; }

[data-theme="light"] .particle {
    background: rgba(108, 80, 191, 0.25);
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-right-color: var(--border-subtle);
}

[data-theme="light"] .sidebar-logo img,
[data-theme="light"] .mobile-header-logo img,
[data-theme="light"] img.about-logo {
    filter: brightness(0) opacity(0.9);
}

[data-theme="light"] .sidebar-logo img {
    animation: logoPulseLight 4s ease-in-out infinite;
}

[data-theme="light"] .nav-item {
    color: var(--text-muted);
}

[data-theme="light"] .nav-item:hover {
    background: rgba(108, 80, 191, 0.08);
    color: var(--text-primary);
}

[data-theme="light"] .nav-item.active {
    background: var(--gradient-purple);
    color: #ffffff;
}

[data-theme="light"] .sidebar-user:hover {
    background: rgba(108, 80, 191, 0.06);
}

[data-theme="light"] .mobile-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top-color: var(--border-subtle);
}

[data-theme="light"] .mobile-header {
    background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .icon-btn {
    background: rgba(108, 80, 191, 0.06);
    border-color: var(--border-light);
    color: var(--purple);
}

[data-theme="light"] .icon-btn:hover {
    background: rgba(108, 80, 191, 0.12);
}

[data-theme="light"] .card {
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .card-glass {
    background: linear-gradient(145deg, rgba(108, 80, 191, 0.06) 0%, rgba(147, 51, 234, 0.04) 50%, rgba(59, 130, 246, 0.03) 100%);
    border-color: rgba(108, 80, 191, 0.15);
    box-shadow: 0 8px 32px -8px rgba(108, 80, 191, 0.12);
}

[data-theme="light"] .card-glass::before {
    background: radial-gradient(circle, rgba(167, 139, 250, 0.05) 0%, transparent 50%);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--border-light);
    color: var(--text-primary);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .input-wrapper {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--border-light);
}

[data-theme="light"] .input-wrapper:focus-within {
    background: rgba(255, 255, 255, 1);
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(108, 80, 191, 0.08);
}

[data-theme="light"] .input-wrapper input,
[data-theme="light"] .input-wrapper select,
[data-theme="light"] .input-wrapper textarea {
    color: var(--text-primary);
}

[data-theme="light"] .input-wrapper input::placeholder,
[data-theme="light"] .input-wrapper textarea::placeholder {
    color: var(--text-dim);
}

[data-theme="light"] .tab-group {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .tab-btn {
    color: var(--text-dim);
}

[data-theme="light"] .modal {
    background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%);
    border-color: rgba(108, 80, 191, 0.2);
}

[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .modal-close {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #toast {
    box-shadow: 0 20px 60px -15px rgba(108, 80, 191, 0.35);
}

[data-theme="light"] .loading-overlay {
    background: rgba(240, 242, 247, 0.95);
}

[data-theme="light"] .skeleton {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
}

[data-theme="light"] .toggle-switch {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .toggle-switch.active::after {
    background: #fff;
}

[data-theme="light"] .notification-modal {
    background: linear-gradient(180deg, #ffffff 0%, #f8f7ff 100%);
    border-color: rgba(108, 80, 191, 0.2);
}

[data-theme="light"] .notification-modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .notification-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--border-subtle);
}

[data-theme="light"] .notification-item:hover {
    background: rgba(108, 80, 191, 0.04);
}

[data-theme="light"] .hamburger-btn {
    background: rgba(108, 80, 191, 0.06);
    border-color: var(--border-light);
}

[data-theme="light"] .quick-action-icon {
    background: rgba(108, 80, 191, 0.08);
    border-color: rgba(108, 80, 191, 0.15);
}

[data-theme="light"] .divider {
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(108, 80, 191, 0.3);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(108, 80, 191, 0.5);
}

/* Light overrides for page-specific elements common across many pages */
[data-theme="light"] .back-btn {
    background: rgba(108, 80, 191, 0.06);
    border-color: var(--border-light);
    color: var(--purple);
}

[data-theme="light"] .back-btn:hover {
    background: rgba(108, 80, 191, 0.12);
}

[data-theme="light"] .login-card,
[data-theme="light"] .security-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(108, 80, 191, 0.15);
    box-shadow: 0 20px 60px -15px rgba(108, 80, 191, 0.15);
}

[data-theme="light"] .settings-card-group {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-card);
}

[data-theme="light"] .settings-item:hover {
    background: rgba(108, 80, 191, 0.04);
}

[data-theme="light"] .token-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--border-subtle);
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .token-card:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 24px -6px rgba(108, 80, 191, 0.15);
}

[data-theme="light"] .token-modal-sheet {
    background: #ffffff;
    border-color: var(--border-subtle);
}

[data-theme="light"] .token-modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .chain-item:hover {
    background: rgba(108, 80, 191, 0.04);
}

[data-theme="light"] .modal-drag-handle {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-close-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--border-subtle);
}

[data-theme="light"] .modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .receive-modal {
    background: #ffffff;
    border-color: var(--border-subtle);
}

[data-theme="light"] .receive-modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .receive-chain-info {
    background: rgba(108, 80, 191, 0.04);
}

[data-theme="light"] .receive-address {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-subtle);
}

[data-theme="light"] .receive-action-btn.secondary {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--border-subtle);
}

[data-theme="light"] .chain-action-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-subtle);
}

[data-theme="light"] .chain-action-btn:hover {
    background: rgba(108, 80, 191, 0.08);
}

[data-theme="light"] .filter-chip {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--border-subtle);
}

[data-theme="light"] .filter-chip.active,
[data-theme="light"] .filter-chip:hover {
    border-color: var(--border-purple);
}

[data-theme="light"] .stat-pill {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(108, 80, 191, 0.12);
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .balance-price-tag {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--border-subtle);
}

[data-theme="light"] .refresh-btn {
    background: rgba(108, 80, 191, 0.08);
    border-color: rgba(108, 80, 191, 0.2);
}

[data-theme="light"] .refresh-btn:hover {
    background: rgba(108, 80, 191, 0.15);
}

[data-theme="light"] .quick-action-circle {
    background: rgba(108, 80, 191, 0.06);
    border-color: rgba(108, 80, 191, 0.15);
}

[data-theme="light"] .activity-placeholder-icon {
    background: rgba(108, 80, 191, 0.06);
    border-color: rgba(108, 80, 191, 0.15);
}

/* Staking & Vault game-themed light overrides */
[data-theme="light"] .fx-layer,
[data-theme="light"] .stars-layer {
    opacity: 0.3;
}

[data-theme="light"] .neon-grid {
    opacity: 0.15;
}

[data-theme="light"] .glow-orb {
    opacity: 0.1;
}

[data-theme="light"] .sidebar-footer {
    border-top-color: var(--border-subtle);
}

/* ---- Theme Toggle Button ---- */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple-light);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: rgba(108, 80, 191, 0.2);
    border-color: var(--border-purple);
    transform: scale(1.05);
}

.theme-toggle .theme-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: flex; }

[data-theme="light"] .theme-toggle {
    background: rgba(108, 80, 191, 0.06);
    border-color: var(--border-light);
    color: var(--purple);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(108, 80, 191, 0.12);
}

[data-theme="light"] .theme-toggle .theme-icon-sun { display: flex; }
[data-theme="light"] .theme-toggle .theme-icon-moon { display: none; }

/* Floating theme toggle for login/security pages */
.theme-toggle-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* ---- Reset ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

html, body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overscroll-behavior: none;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img, svg, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.02); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }

/* ---- Animated Background ---- */
.bg-animated {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #0a0a0f 0%, #12121a 50%, #0a0a0f 100%);
    z-index: -2;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    z-index: -1;
    animation: bgFloat 12s ease-in-out infinite;
    pointer-events: none;
}

.bg-glow-1 {
    width: 500px; height: 500px;
    background: linear-gradient(135deg, #6c50bf 0%, #9333ea 100%);
    top: -150px; left: -150px;
}

.bg-glow-2 {
    width: 400px; height: 400px;
    background: linear-gradient(135deg, #3b82f6 0%, #6c50bf 100%);
    bottom: -100px; right: -100px;
    animation-delay: -6s;
}

.bg-glow-3 {
    width: 350px; height: 350px;
    background: linear-gradient(135deg, #9333ea 0%, #ec4899 100%);
    top: 40%; left: 50%;
    transform: translateX(-50%);
    opacity: 0.12;
    animation-delay: -3s;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(25px, -20px) scale(1.05); }
    66% { transform: translate(-15px, 15px) scale(0.95); }
}

/* ---- Particles ---- */
.particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px; height: 3px;
    background: rgba(108, 80, 191, 0.5);
    border-radius: 50%;
    animation: particleRise 14s infinite;
}

@keyframes particleRise {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* ============================================================
   LAYOUT: Sidebar (desktop) + Content
   ============================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar (Desktop) ---- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px 20px;
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 30%, var(--accent) 70%, transparent 100%);
    opacity: 0.5;
    animation: shimmerLine 3s ease-in-out infinite;
}

@keyframes shimmerLine {
    0%, 100% { opacity: 0.3; background-position: -200% center; }
    50% { opacity: 0.7; background-position: 200% center; }
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.04);
}

.sidebar-logo img {
    height: 44px;
    filter: drop-shadow(0 0 20px rgba(108, 80, 191, 0.5));
    animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 16px rgba(108, 80, 191, 0.4)); }
    50% { filter: drop-shadow(0 0 28px rgba(147, 51, 234, 0.6)); }
}

@keyframes logoPulseLight {
    0%, 100% { filter: brightness(0) opacity(0.85) drop-shadow(0 0 10px rgba(108, 80, 191, 0.15)); }
    50% { filter: brightness(0) opacity(0.9) drop-shadow(0 0 18px rgba(108, 80, 191, 0.3)); }
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 16px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    background: rgba(108, 80, 191, 0.1);
    color: var(--text-secondary);
}

.nav-item.active {
    background: var(--gradient-purple);
    color: #ffffff;
    box-shadow: 0 4px 15px -3px rgba(108, 80, 191, 0.5);
}

.nav-item i {
    font-size: 22px;
    width: 28px;
    text-align: center;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--error);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-subtle);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--text-dim);
}

/* ---- Main Content Area ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 40px 120px;
}

/* ---- Top Bar (Desktop) ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 32px;
    opacity: 0;
    animation: fadeInDown 0.6s ease forwards;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topbar-greeting {
    font-size: 14px;
    color: var(--text-muted);
}

.topbar-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Mobile Bottom Nav ---- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    z-index: 200;
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
}

.mobile-nav-item i { font-size: 24px; }

.mobile-nav-item.active {
    color: var(--purple-light);
}

.mobile-nav-item.active i {
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.5));
}

/* Mobile hamburger */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
}

.mobile-header-logo img { height: 32px; }

.hamburger-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple-light);
    font-size: 20px;
}

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* ---- Icon Buttons ---- */
.icon-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--purple-light);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.icon-btn:hover {
    background: rgba(108, 80, 191, 0.2);
    border-color: var(--border-purple);
    transform: scale(1.05);
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-purple);
    background: var(--bg-card-hover);
}

.card-glass {
    background: var(--gradient-card);
    border: 1px solid var(--border-purple);
    border-radius: var(--radius-2xl);
    padding: 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.card-glass::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.1) 0%, transparent 50%);
    animation: cardGlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardGlow {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.5; }
    50% { transform: translate(10%, 10%) rotate(180deg); opacity: 0.8; }
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    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.15), transparent);
    transition: left 0.5s ease;
}

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

.btn-primary {
    background: var(--gradient-purple);
    color: #ffffff;
    box-shadow: 0 4px 15px -3px rgba(108, 80, 191, 0.4);
}

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

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-purple);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-purple);
    color: var(--purple-light);
}

.btn-outline:hover {
    background: rgba(108, 80, 191, 0.15);
}

.btn-lg {
    height: 58px;
    font-size: 17px;
    border-radius: var(--radius-lg);
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn.loading { pointer-events: none; }

.btn.loading::after {
    content: '';
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

/* ---- Inputs ---- */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-label i { color: var(--purple); font-size: 16px; }

.input-wrapper {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-purple);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--purple);
    background: rgba(108, 80, 191, 0.1);
    box-shadow: 0 0 0 4px rgba(108, 80, 191, 0.1);
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
}

.input-wrapper input::placeholder,
.input-wrapper textarea::placeholder {
    color: var(--text-dim);
}

.input-wrapper .input-icon {
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.input-wrapper .input-icon:hover { color: var(--purple-light); }

/* ---- Badge / Tags ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge-purple { background: rgba(108, 80, 191, 0.15); color: var(--purple-light); }

/* ---- Tabs ---- */
.tab-group {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.tab-btn.active {
    background: var(--gradient-purple);
    color: #ffffff;
    box-shadow: 0 4px 15px -3px rgba(108, 80, 191, 0.5);
}

.tab-content { display: none; }
.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 1px solid var(--border-purple);
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 32px;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ---- Toast Notification ---- */
#toast {
    visibility: hidden;
    min-width: 280px;
    background: var(--gradient-purple);
    color: #ffffff;
    text-align: center;
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 20px 60px -15px rgba(108, 80, 191, 0.5);
    backdrop-filter: blur(10px);
}

#toast.show {
    visibility: visible;
    animation: toastIn 0.5s cubic-bezier(0.4, 0, 0.2, 1), toastOut 0.5s cubic-bezier(0.4, 0, 0.2, 1) 2.5s;
}

#toast.error { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
#toast.success { background: linear-gradient(135deg, #059669 0%, #047857 100%); }
#toast.warning { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }

/* ---- Loading Overlay ---- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    width: 48px; height: 48px;
    border-radius: 50%;
    position: relative;
    animation: spinRotate 1s linear infinite;
}

.loading-spinner::before,
.loading-spinner::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--purple);
    animation: clipFix 2s linear infinite;
}

.loading-spinner::after {
    border-color: var(--purple-light);
    animation: clipFix 2s linear infinite, spinRotate 0.5s linear infinite reverse;
    inset: 6px;
}

@keyframes spinRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes clipFix {
    0% { clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0); }
    25% { clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0); }
    50% { clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%); }
    75% { clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 100%); }
    100% { clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 0 100%, 0 0); }
}

.loading-text {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* ---- Skeleton Loading ---- */
.skeleton {
    background: linear-gradient(90deg, #1f1f2e 25%, #2a2a3e 50%, #1f1f2e 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

/* ---- Toggle Switch ---- */
.toggle-switch {
    width: 52px; height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-switch.active { background: var(--purple); }

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 24px; height: 24px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch.active::after {
    transform: translateX(24px);
    background: var(--bg-primary);
}

/* ---- Section Headers ---- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.section-link {
    font-size: 14px;
    color: var(--purple-light);
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
}

.section-link:hover { color: #c4b5fd; }

/* ---- Grid Layouts ---- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ---- Quick Actions ---- */
.quick-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    text-decoration: none;
    min-width: 72px;
}

.quick-action:hover { transform: translateY(-3px); }

.quick-action-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(108, 80, 191, 0.15);
    border: 1px solid var(--border-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--purple-light);
    transition: var(--transition);
}

.quick-action:hover .quick-action-icon {
    background: rgba(108, 80, 191, 0.3);
    box-shadow: 0 10px 30px -10px rgba(108, 80, 191, 0.5);
}

.quick-action-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---- Notification Modal ---- */
.notification-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.notification-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.notification-modal {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 1px solid var(--border-purple);
    border-radius: var(--radius-2xl);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-modal-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notification-modal-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(108, 80, 191, 0.2) 0%, rgba(147, 51, 234, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--purple-light);
}

.notification-list {
    padding: 16px 24px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    transition: var(--transition);
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.notification-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-purple);
}

.notification-item-icon {
    width: 44px; height: 44px;
    min-width: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(108, 80, 191, 0.2) 0%, rgba(147, 51, 234, 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--purple-light);
}

.notification-item-icon.success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.15)); color: var(--success); }
.notification-item-icon.warning { background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15)); color: var(--warning); }
.notification-item-icon.error { background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.15)); color: var(--error); }

.notification-item-content { flex: 1; min-width: 0; }
.notification-item-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.notification-item-message { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.notification-item-time { font-size: 11px; color: var(--text-dim); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@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 fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes toastIn {
    from { bottom: 0; opacity: 0; transform: translateX(-50%) scale(0.9); }
    to { bottom: 40px; opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes toastOut {
    from { bottom: 40px; opacity: 1; transform: translateX(-50%) scale(1); }
    to { bottom: 0; opacity: 0; transform: translateX(-50%) scale(0.9); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

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

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; transform: scaleX(0.5); }
    50% { opacity: 1; transform: scaleX(1); }
}

@keyframes coinFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.3); opacity: 0; }
}

@keyframes waves {
    0% { transform: scale(0.6); opacity: 0.2; }
    50% { opacity: 0.7; }
    100% { transform: scale(1.2); opacity: 0; }
}

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

@keyframes portalPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(108, 80, 191, 0.3), inset 0 0 20px rgba(108, 80, 191, 0.2); }
    50% { box-shadow: 0 0 40px rgba(108, 80, 191, 0.5), inset 0 0 40px rgba(108, 80, 191, 0.3); }
}

/* ---- Utility classes ---- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-purple { color: var(--purple-light); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-white { color: var(--text-primary); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-purple), transparent);
    margin: 24px 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-nav { display: block; }
    .mobile-header { display: flex; }
    .page-container { padding: 0 20px 100px; }
    .topbar { padding: 16px 0 24px; }
    .topbar-title { font-size: 22px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .page-container { padding: 0 16px 100px; }
    .card-glass { padding: 24px; border-radius: var(--radius-xl); }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .quick-actions { justify-content: center; }
    .modal { padding: 24px; width: 95%; }
}

/* ---- Desktop enhancements ---- */
@media (min-width: 1025px) {
    .mobile-only { display: none !important; }
}

@media (max-width: 1024px) {
    .desktop-only { display: none !important; }
}
