/* ============================================
   Savyng - Premium Dark UI Foundation
   ============================================ */

/* --- Core Dark Theme Variables --- */
:root {
    --bg-primary: #030712;
    --bg-secondary: #0a0f1e;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-card-hover: rgba(15, 23, 42, 0.8);
    --border-subtle: rgba(99, 102, 241, 0.12);
    --border-glow: rgba(6, 182, 212, 0.25);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --glow-cyan: rgba(6, 182, 212, 0.15);
    --glow-emerald: rgba(16, 185, 129, 0.15);
    --glow-indigo: rgba(99, 102, 241, 0.15);
}

/* --- Force Dark Mode Always --- */
html {
    color-scheme: dark;
}

/* --- Keyframes --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes orbFloat {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -40px) scale(1.05); }
    66%  { transform: translate(-20px, 20px) scale(0.95); }
    100% { transform: translate(0, 0) scale(1); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 8px var(--glow-cyan); }
    50%      { box-shadow: 0 0 24px var(--glow-cyan), 0 0 48px rgba(6, 182, 212, 0.08); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes borderGlow {
    0%, 100% { border-color: rgba(6, 182, 212, 0.2); }
    50%      { border-color: rgba(6, 182, 212, 0.4); }
}
@keyframes subtleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%  { transform: translateY(-8px) rotate(0.5deg); }
    75%  { transform: translateY(4px) rotate(-0.5deg); }
}
@keyframes glowPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.7; }
}
@keyframes scanLine {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

/* --- Utility Animation Classes --- */
.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.animate-fade-in-down {
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.animate-fade-in {
    animation: fadeIn 0.5s ease both;
}
.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger Delays */
.stagger-1  { animation-delay: 0.05s; }
.stagger-2  { animation-delay: 0.1s; }
.stagger-3  { animation-delay: 0.15s; }
.stagger-4  { animation-delay: 0.2s; }
.stagger-5  { animation-delay: 0.25s; }
.stagger-6  { animation-delay: 0.3s; }
.stagger-7  { animation-delay: 0.35s; }
.stagger-8  { animation-delay: 0.4s; }
.stagger-9  { animation-delay: 0.45s; }
.stagger-10 { animation-delay: 0.5s; }
.stagger-11 { animation-delay: 0.55s; }
.stagger-12 { animation-delay: 0.6s; }

/* --- Scroll Reveal (Progressive Enhancement) --- */
/* Content is visible by default. Only hide when JS confirms IntersectionObserver is ready. */
.scroll-reveal {
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.js-scroll-ready .scroll-reveal:not(.revealed) {
    opacity: 0;
    transform: translateY(24px);
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- App Background --- */
.app-bg {
    background: linear-gradient(135deg, #030712 0%, #0a0f1e 40%, #0c1222 60%, #030712 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}
.app-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.018) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* --- Auth Background (Login/Register) --- */
.auth-bg-animated {
    background: linear-gradient(135deg, #030712, #0c1222, #030712);
    background-size: 300% 300%;
    animation: gradientShift 15s ease infinite;
}

/* --- Glassmorphism Cards --- */
.glass-card {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-card:hover {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(6, 182, 212, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 24px rgba(6, 182, 212, 0.06);
}

.glass-card-static {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 16px;
}

/* Metric card variants with accent glows */
.glass-card-cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(6, 182, 212, 0.15);
}
.glass-card-cyan:hover {
    border-color: rgba(6, 182, 212, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 30px rgba(6, 182, 212, 0.1);
}

.glass-card-emerald {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(16, 185, 129, 0.15);
}
.glass-card-emerald:hover {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 30px rgba(16, 185, 129, 0.1);
}

.glass-card-indigo {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(99, 102, 241, 0.15);
}
.glass-card-indigo:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 30px rgba(99, 102, 241, 0.1);
}

.glass-card-purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(168, 85, 247, 0.15);
}
.glass-card-purple:hover {
    border-color: rgba(168, 85, 247, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 30px rgba(168, 85, 247, 0.1);
}

/* Featured/highlight card */
.glass-card-glow {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(99, 102, 241, 0.08), rgba(15, 23, 42, 0.6));
    border: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.glass-card-glow:hover {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.12), 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- Glass Navigation --- */
.glass-nav {
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}

/* --- Glass Table --- */
.glass-table {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    overflow: hidden;
}
.glass-table thead {
    background: rgba(6, 182, 212, 0.04);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}
.glass-table tbody tr {
    border-bottom: 1px solid rgba(99, 102, 241, 0.06);
    transition: background 0.2s ease;
}
.glass-table tbody tr:hover {
    background: rgba(6, 182, 212, 0.04);
}
.glass-table tbody tr:last-child {
    border-bottom: none;
}

/* --- Hover Interactions --- */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-glow {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.hover-glow:hover {
    box-shadow: 0 0 24px var(--glow-cyan);
}

.hover-glow-emerald {
    transition: box-shadow 0.3s ease;
}
.hover-glow-emerald:hover {
    box-shadow: 0 0 24px var(--glow-emerald);
}

.hover-glow-indigo {
    transition: box-shadow 0.3s ease;
}
.hover-glow-indigo:hover {
    box-shadow: 0 0 24px var(--glow-indigo);
}

/* --- Button Effects --- */
.btn-press {
    transition: transform 0.1s ease;
}
.btn-press:active {
    transform: scale(0.97);
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
}
@keyframes rippleExpand {
    to { transform: scale(4); opacity: 0; }
}

/* Premium gradient button */
.btn-glow {
    background: linear-gradient(135deg, #06b6d4, #6366f1);
    color: white;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px 24px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
}
.btn-glow:hover {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.btn-glow-emerald {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: white;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px 24px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
}
.btn-glow-emerald:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

/* Secondary/outline button */
.btn-glass {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #94a3b8;
    font-weight: 500;
    border-radius: 12px;
    padding: 12px 24px;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-glass:hover {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(6, 182, 212, 0.3);
    color: #e2e8f0;
}

/* --- Floating Orbs --- */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}
.orb-emerald {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.5), transparent 70%);
    animation: orbFloat 12s ease-in-out infinite;
}
.orb-cyan {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.4), transparent 70%);
    animation: orbFloat 15s ease-in-out infinite reverse;
}
.orb-indigo {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
    animation: orbFloat 18s ease-in-out infinite;
}

/* App-page ambient orbs (fixed position, more subtle) */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

/* --- Flash Messages --- */
.flash-message {
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.flash-message.fade-out {
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --- Input Focus Glow --- */
.input-enhanced {
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.input-enhanced:focus {
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12), 0 0 16px rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.5) !important;
}

/* Glass input style */
.input-glass {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(99, 102, 241, 0.12);
    color: #f1f5f9;
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.25s ease;
    outline: none;
}
.input-glass.has-icon-left {
    padding-left: 40px;
}
.input-glass::placeholder {
    color: #475569;
}
.input-glass:focus {
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1), 0 0 16px rgba(6, 182, 212, 0.06);
    background: rgba(15, 23, 42, 0.7);
}

/* --- Nav Active Indicator --- */
.nav-link-active {
    position: relative;
    color: #06b6d4 !important;
}
.btn-glow-emerald.nav-link-active {
    color: white !important;
}
.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #06b6d4, #6366f1);
    border-radius: 1px;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* Hide active underline in mobile nav */
.md\:hidden .nav-link-active::after {
    display: none;
}

/* --- Scroll-aware Navbar --- */
.nav-compact {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}
.nav-compact .text-2xl {
    font-size: 1.25rem !important;
}

/* --- Shimmer Badge --- */
.shimmer-badge {
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.15), transparent);
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite;
}

/* --- Currency Selector Pills --- */
.currency-pill {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}
.currency-pill:hover {
    color: #94a3b8;
    background: rgba(6, 182, 212, 0.06);
}
.currency-pill-active {
    color: #06b6d4 !important;
    background: rgba(6, 182, 212, 0.1) !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.1);
}

/* --- Status Badges --- */
.badge-buy {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-sell {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-active {
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-fx {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* --- Delete Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease both;
}
.modal-content {
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* --- Loading Spinner --- */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* --- Gradient Text --- */
.text-gradient {
    background: linear-gradient(135deg, #06b6d4, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-emerald {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Profit/Loss Colors --- */
.text-profit {
    color: #34d399;
}
.text-loss {
    color: #f87171;
}
.bg-profit-subtle {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
}
.bg-loss-subtle {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.35);
}

/* --- Page Entrance Animation --- */
.page-enter {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* --- Table Row Entrance --- */
/* Row animations are handled by JS data-stagger to avoid CSS/JS conflicts.
   The data-stagger system manages opacity and transform transitions. */

/* --- Loading Skeletons --- */
.skeleton {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.06) 25%, rgba(99, 102, 241, 0.12) 50%, rgba(99, 102, 241, 0.06) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
.skeleton-text {
    height: 14px;
    width: 80%;
    margin-bottom: 8px;
}
.skeleton-chart {
    height: 200px;
    width: 100%;
}

/* --- CSS Tooltip System --- */
[data-tooltip] {
    position: relative;
    cursor: help;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(6, 182, 212, 0.15);
    color: #94a3b8;
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Price Flash Animations --- */
@keyframes priceFlashGreen {
    0%   { text-shadow: 0 0 0 transparent; }
    30%  { text-shadow: 0 0 12px rgba(16, 185, 129, 0.6); }
    100% { text-shadow: 0 0 0 transparent; }
}
@keyframes priceFlashRed {
    0%   { text-shadow: 0 0 0 transparent; }
    30%  { text-shadow: 0 0 12px rgba(239, 68, 68, 0.6); }
    100% { text-shadow: 0 0 0 transparent; }
}
.price-flash-green {
    animation: priceFlashGreen 1.2s ease-out 0.5s both;
}
.price-flash-red {
    animation: priceFlashRed 1.2s ease-out 0.5s both;
}

/* --- Nav Link Page Transition --- */
.page-exit {
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* --- Landing Page: Word Reveal --- */
@keyframes wordReveal {
    from { opacity: 0; transform: translateY(40px); filter: blur(8px); }
    to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}
.animate-word-reveal {
    opacity: 0;
    animation: wordReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-stagger-1 { animation-delay: 0.1s; }
.hero-stagger-2 { animation-delay: 0.4s; }
.hero-stagger-3 { animation-delay: 0.7s; }
.hero-stagger-4 { animation-delay: 1.1s; }
.hero-stagger-5 { animation-delay: 1.4s; }

/* --- Landing Page: Bounce Down (scroll indicator) --- */
@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(8px); }
}
.animate-bounce-down {
    animation: bounceDown 1.5s ease-in-out infinite;
}

/* --- Landing Page: Gradient Mesh Background --- */
@keyframes meshFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33%      { transform: translate(30px, -30px) rotate(1deg); }
    66%      { transform: translate(-20px, 20px) rotate(-1deg); }
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 600px 600px at 20% 50%, rgba(16, 185, 129, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 30%, rgba(6, 182, 212, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 60% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    animation: meshFloat 20s ease-in-out infinite;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(16, 185, 129, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
    z-index: 0;
}

/* --- Landing Page: Flowing Particles --- */
@keyframes particleFlow {
    0%   { transform: translateX(-100px); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateX(calc(100vw + 100px)); opacity: 0; }
}

.particles-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particleFlow linear infinite;
}

/* --- Accessibility: Focus Styles --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
}

/* Remove default outline when focus-visible is supported (non-keyboard focus) */
:focus:not(:focus-visible) {
    outline: none;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .scroll-reveal { opacity: 1 !important; transform: none !important; }
    .js-scroll-ready .scroll-reveal:not(.revealed) { opacity: 1 !important; transform: none !important; }
    .hover-lift:hover { transform: none; }
    .orb, .ambient-orb { animation: none !important; opacity: 0.15; }
    .page-enter { animation: none; opacity: 1; }
    .skeleton { animation: none; }
    [data-tooltip]::after { transition: none; }
    .price-flash-green, .price-flash-red { animation: none; }
    .animate-word-reveal { opacity: 1; filter: none; transform: none; animation: none; }
    .animate-bounce-down { animation: none; }
    .hero-bg::before { animation: none; }
    .particle { animation: none; opacity: 0; }
}

/* ============================================
   Mobile Bottom Tab Navigation
   ============================================ */
.bottom-tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-tab-inner {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: 64px;
    max-width: 480px;
    margin: 0 auto;
}

.bottom-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 0 6px;
    min-height: 48px;
    min-width: 48px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.bottom-tab-item:active {
    transform: scale(0.92);
    transition: transform 0.1s ease;
}

.bottom-tab-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.bottom-tab-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Active tab state */
.bottom-tab-active {
    color: #06b6d4 !important;
}
.bottom-tab-active .bottom-tab-icon {
    filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.4));
}
.bottom-tab-active .bottom-tab-label {
    opacity: 1;
    font-weight: 600;
}
.bottom-tab-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, #06b6d4, #6366f1);
    border-radius: 0 0 2px 2px;
}

/* Center Add button */
.bottom-tab-add {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}
.bottom-tab-add-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-10px);
    transition: all 0.2s ease;
}
.bottom-tab-add-btn:active {
    transform: translateY(-8px) scale(0.95);
}

/* Body padding for bottom nav on mobile */
@media (max-width: 767px) {
    body.has-bottom-nav {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    /* Footer is hidden on mobile (hidden md:block), no spacing needed */
}

/* ============================================
   Offline State Banner
   ============================================ */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(245, 158, 11, 0.92);
    color: #030712;
    text-align: center;
    padding: 5px 16px;
    font-size: 12px;
    font-weight: 600;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
}
.offline-banner.visible {
    display: block;
    transform: translateY(0);
}

/* ============================================
   Mobile Card View (transaction cards)
   ============================================ */
.tx-card {
    transition: all 0.2s ease;
}
.tx-card:active {
    transform: scale(0.98);
}

/* ============================================
   Touch Target Optimization
   ============================================ */
@media (max-width: 767px) {
    /* Ensure action buttons in tables/cards have 44px tap zones */
    .touch-target {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Currency pills on mobile */
    .currency-pill {
        padding: 8px 16px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    /* Goal card action buttons */
    .goal-action {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
    }
    .goal-action:active {
        background: rgba(255, 255, 255, 0.05);
    }

    /* Pagination buttons */
    .btn-glass {
        min-height: 44px;
    }
}
