/* ════════════════════════════════════════════════════════════════════
   Sainfoxiya Modern UI Design System
   v1.0 - Clean Enterprise & Glassmorphism
   ════════════════════════════════════════════════════════════════════ */

:root {
    --brand-primary: #2563eb;
    --brand-secondary: #4f46e5;
    --brand-accent: #0ea5e9;
    --brand-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --surface-glass: rgba(255, 255, 255, 0.8);
    --surface-glass-dark: rgba(15, 23, 42, 0.8);
    --border-glass: rgba(255, 255, 255, 0.4);
    --bg-main: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.12);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #0ea5e9;
}

/* ── Global Enhancements ─────────────────────────────────────────── */
body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--bg-main);
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(229, 231, 235, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(241, 245, 249, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(243, 244, 246, 0.3) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

h1, h2, h3, .font-display {
    font-family: 'Syne', sans-serif !important;
    letter-spacing: -0.03em;
    font-weight: 800 !important;
}

p, span, div, .font-jakarta {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.mono {
    font-family: 'JetBrains Mono', monospace !important;
    letter-spacing: -0.05em;
}

/* ── Modern Components ───────────────────────────────────────────── */

/* Glassmorphism Card */
.glass-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-medium);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(248, 250, 252, 0.05) 50%, 
        rgba(241, 245, 249, 0.1) 100%);
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-strong);
    border-color: rgba(229, 231, 235, 0.5);
}

/* Premium Wallet Card */
.wallet-card-premium {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
    overflow: hidden;
    color: #1e293b;
    border-radius: 28px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: var(--shadow-strong);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.wallet-card-premium:hover {
    transform: translateY(-6px) rotateX(2deg);
    box-shadow: 0 30px 70px -15px rgba(229, 231, 235, 0.3);
}

.wallet-card-premium::before {
    content: '';
    position: absolute;
    top: -30%; right: -20%;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(229, 231, 235, 0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: shimmer 3s ease-in-out infinite;
}

.wallet-card-premium .glow-spot {
    position: absolute;
    width: 200px; height: 200px;
    background: rgba(241, 245, 249, 0.4);
    filter: blur(80px);
    opacity: 0.6;
    z-index: 0;
    top: 50%; left: 10%;
    transform: translateY(-50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateY(-50%) scale(1.2); }
}

/* Stat Cards */
.modern-stat-card {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 24px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.modern-stat-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: var(--shadow-strong);
    border-color: var(--brand-primary);
}

.modern-stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.modern-stat-card:hover::after {
    opacity: 0.05;
}

.modern-stat-card > * {
    position: relative;
    z-index: 1;
}

/* Action Tiles */
.action-tile-modern {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.action-tile-modern::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--brand-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.action-tile-modern:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: var(--shadow-medium);
    border-color: var(--brand-primary);
}

.action-tile-modern:hover::before {
    opacity: 1;
}

.action-tile-modern:hover * {
    color: white !important;
    transform: scale(1.1);
}

.action-tile-modern > * {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

/* Animated Buttons */
.btn-primary-modern {
    background: var(--brand-gradient);
    color: white;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 16px;
    padding: 14px 28px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn-primary-modern::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary-modern:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--shadow-strong);
}

.btn-primary-modern:hover::before {
    left: 100%;
}

.btn-primary-modern:active {
    transform: translateY(-2px) scale(1.02);
}

/* Loading animation for buttons */
.btn-primary-modern.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary-modern.loading::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Micro-Animations ────────────────────────────────────────────── */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
}

.fade-in-entry {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* ── Layout Overrides ───────────────────────────────────────────── */
.main-content-area {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .main-content-area {
        padding: 1rem;
    }
}

/* ── Tooltips ─────────────────────────────────────────────────── */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1e293b;
    color: white;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    width: max-content;
    max-width: 200px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ── Enhanced Mobile Experience ───────────────────────────────────── */
@media (max-width: 768px) {
    .glass-card {
        border-radius: 16px;
        margin: 8px;
    }
    
    .modern-stat-card {
        padding: 16px;
        border-radius: 16px;
    }
    
    .action-tile-modern {
        padding: 16px;
        border-radius: 12px;
    }
    
    .btn-primary-modern {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .wallet-card-premium {
        border-radius: 20px;
    }
}

/* ── New Modern Components ─────────────────────────────────────────── */

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-strong);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 25px 50px -12px rgba(102, 126, 234, 0.5);
}

/* Modern Badge */
.badge-modern {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--brand-gradient);
    color: white;
    box-shadow: var(--shadow-soft);
    animation: badge-pulse 2s ease-in-out infinite;
}

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

/* Progress Ring */
.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-bg {
    stroke: #e2e8f0;
}

.progress-ring-fill {
    stroke: url(#gradient);
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
}

/* Notification Toast */
.toast-modern {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slide-in-right 0.3s ease-out;
}

@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-modern.success {
    border-left: 4px solid #10b981;
}

.toast-modern.error {
    border-left: 4px solid #ef4444;
}

.toast-modern.warning {
    border-left: 4px solid #f59e0b;
}

/* Modern Input Field */
.input-modern {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: var(--shadow-soft);
}

.input-modern:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.input-modern::placeholder {
    color: #94a3b8;
}

/* Loading Skeleton Enhanced */
.skeleton-modern {
    background: linear-gradient(90deg, 
        #f8fafc 25%, 
        #e2e8f0 50%, 
        #f8fafc 75%);
    background-size: 200% 100%;
    animation: shimmer-modern 1.5s ease-in-out infinite;
    border-radius: 12px;
}

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