/* I AutoFin 2026-Era FinTech Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #1e3a8a;
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --emerald-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --amber-gradient: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    --rose-gradient: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    --violet-gradient: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
    --cyan-gradient: linear-gradient(135deg, #0e7490 0%, #06b6d4 100%);
    --dark-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -2px rgba(0, 0, 0, 0.02);
    --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.02);
    --shadow-hover: 0 20px 30px -10px rgba(30, 58, 138, 0.12), 0 10px 15px -5px rgba(30, 58, 138, 0.05);
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.35);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Sidebar & Navigation */
.app-sidebar {
    width: 260px;
    height: 100vh;
    max-height: 100vh;
    background: #0f172a;
    color: #f8fafc;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-sidebar .brand-header {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: #0b1120;
}

.app-sidebar .nav-list-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}

.app-sidebar .nav-list-wrapper::-webkit-scrollbar {
    width: 5px;
}
.app-sidebar .nav-list-wrapper::-webkit-scrollbar-track {
    background: #0f172a;
}
.app-sidebar .nav-list-wrapper::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
.app-sidebar .nav-list-wrapper::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.app-sidebar .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-sidebar .nav-item {
    margin-bottom: 3px;
}

.app-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-size: 14.5px;
}

.app-sidebar .nav-link:hover, .app-sidebar .nav-link.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.22);
    border-left: 3px solid #3b82f6;
}

.app-sidebar .nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.app-sidebar .sidebar-section-header {
    color: #94a3b8 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 1.2px !important;
    text-transform: uppercase !important;
    padding: 14px 12px 6px 12px !important;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.95;
    position: relative;
}

.app-sidebar .sidebar-section-header::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
}

/* Animated Car Badge */
.animated-car-badge {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.animated-car-badge .car-icon {
    display: inline-block;
    animation: carDrive 2.4s ease-in-out infinite alternate;
}

@keyframes carDrive {
    0% { transform: translateX(-3px) translateY(0px) rotate(0deg); }
    30% { transform: translateX(2px) translateY(-1px) rotate(-1.5deg); }
    70% { transform: translateX(4px) translateY(1px) rotate(1deg); }
    100% { transform: translateX(-1px) translateY(0px) rotate(0deg); }
}

.animated-car-badge::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 4px;
    right: 4px;
    height: 2px;
    background: repeating-linear-gradient(90deg, #93c5fd 0, #93c5fd 4px, transparent 4px, transparent 8px);
    animation: roadMove 0.8s linear infinite;
}

@keyframes roadMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-8px); }
}


/* Main Content Area */
.app-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.app-header {
    height: 72px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-subtle);
}

.app-body {
    padding: 28px;
    flex-grow: 1;
}

/* FinTech Cards */
.fin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

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

.fin-kpi-card {
    border-radius: var(--radius-lg);
    padding: 22px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.15);
}

.fin-kpi-card .kpi-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 80px;
    opacity: 0.15;
    transform: rotate(-10deg);
}

.fin-kpi-card.kpi-blue { background: var(--primary-gradient); }
.fin-kpi-card.kpi-emerald { background: var(--emerald-gradient); }
.fin-kpi-card.kpi-amber { background: var(--amber-gradient); }
.fin-kpi-card.kpi-rose { background: var(--rose-gradient); }
.fin-kpi-card.kpi-violet { background: var(--violet-gradient); }
.fin-kpi-card.kpi-dark { background: var(--dark-gradient); }

/* Progress Ring */
.progress-ring-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: auto;
}

.progress-ring-circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* Touch-friendly Large Buttons */
.btn-fin-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.btn-fin-primary:hover {
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-fin-success {
    background: var(--emerald-gradient);
    color: #ffffff;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-fin-success:hover {
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

/* Touch-friendly Collect Button */
.btn-collect-huge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-collect-huge:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.5);
}

/* Vehicle Animation Elements */
.road-animation {
    position: relative;
    width: 100%;
    height: 120px;
    background: #1e293b;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.road-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 200%;
    height: 4px;
    background: repeating-linear-gradient(90deg, #f59e0b 0, #f59e0b 30px, transparent 30px, transparent 60px);
    animation: roadMove 2s linear infinite;
}

@keyframes roadMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.vehicle-moving {
    position: absolute;
    bottom: 25px;
    left: 40px;
    animation: vehicleBounce 0.6s ease-in-out infinite alternate;
}

@keyframes vehicleBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

/* Risk Badges */
.badge-risk {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-risk-low { background: #dcfce7; color: #15803d; }
.badge-risk-watch { background: #fef3c7; color: #b45309; }
.badge-risk-high { background: #ffedd5; color: #c2410c; }
.badge-risk-critical { background: #fee2e2; color: #b91c1c; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .mobile-bottom-nav {
        display: flex !important;
    }
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.06);
    z-index: 1050;
    align-items: center;
    justify-content: space-around;
}

.mobile-bottom-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.mobile-bottom-nav a.active {
    color: #2563eb;
}

/* ============================================================ */
/* Premium Glassmorphic & Metric Cards (2026 Enterprise UI)      */
/* ============================================================ */
.card-glass {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.card-glass:hover, .hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.05);
}

.metric-card {
    padding: 22px;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 70%);
    pointer-events: none;
}

.frosted-icon-box {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin: 8px 0 4px;
    letter-spacing: -0.5px;
}

.card-gradient-primary {
    background: linear-gradient(135deg, #312e81 0%, #4338ca 50%, #6366f1 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.card-gradient-emerald {
    background: linear-gradient(135deg, #064e3b 0%, #059669 50%, #10b981 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.card-gradient-amber {
    background: linear-gradient(135deg, #78350f 0%, #d97706 50%, #f59e0b 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.card-gradient-purple {
    background: linear-gradient(135deg, #581c87 0%, #7e22ce 50%, #a855f7 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.glow-on-hover {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.glow-on-hover:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.2) !important;
}
