/* ========== SmartCredit AI — Ultra-Premium Simulator Page ========== */

/* CSS Variables */
:root {
    --primary-green: #22c55e;
    --primary-green-hover: #16a34a;
    --primary-green-light: #ecfdf5;
    --primary-navy: #001f3f;
    --slider-blue: #3b82f6;
    --warning-orange: #f59e0b;
    --danger-red: #ef4444;
    --danger-red-light: #fef2f2;
    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --track-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfeff 30%, #eff6ff 60%, #faf5ff 100%);
    color: var(--text-dark);
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.text-green { color: var(--primary-green) !important; }

/* Decorative Background Orbs */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}
.bg-orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(34,197,94,0.15), transparent 70%);
    top: -100px; left: -100px;
    animation: orbFloat1 20s ease-in-out infinite;
}
.bg-orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.12), transparent 70%);
    bottom: -80px; right: -80px;
    animation: orbFloat2 25s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-10px, -40px) scale(0.95); }
    75% { transform: translate(-30px, -10px) scale(1.02); }
}
@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 25px) scale(1.08); }
    66% { transform: translate(20px, -15px) scale(0.96); }
}

/* ========== LAYOUT & CARDS ========== */
.simulator-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.header-section {
    opacity: 0;
    animation: fadeInDown 0.7s ease forwards;
}

.header-section h1 {
    color: var(--primary-navy);
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-navy), var(--primary-green-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-section p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

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

.simulator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px) saturate(150%);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.05), inset 0 0 0 1px rgba(255,255,255,0.6);
    padding: 32px;
    border: 1px solid rgba(226,232,240,0.5);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--slider-blue), #8b5cf6);
    background-size: 200% 100%;
    animation: gradientShift 4s ease infinite;
}

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

.card:hover {
    transform: translateY(-4px) scale(1.005);
    box-shadow: 0 20px 48px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(34,197,94,0.08);
}

.card-title {
    font-size: 1.15rem;
    color: var(--primary-navy);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

/* ========== SLIDERS SECTION ========== */
.sliders-container {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-header label {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

.slider-value {
    font-weight: 700;
    color: var(--primary-navy);
    font-size: 1.05rem;
    background: linear-gradient(135deg, var(--primary-navy), var(--slider-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.2s ease;
}

/* ========== CUSTOM RANGE SLIDER ========== */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary-green), var(--slider-blue));
    outline: none;
    cursor: pointer;
    position: relative;
    transition: box-shadow 0.3s ease;
}

input[type=range]:hover {
    box-shadow: 0 0 12px rgba(34,197,94,0.2);
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 3px solid var(--slider-blue);
    box-shadow: 0 2px 8px rgba(59,130,246,0.3), 0 0 0 4px rgba(59,130,246,0.08);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

input[type=range]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 3px solid var(--slider-blue);
    box-shadow: 0 2px 8px rgba(59,130,246,0.3), 0 0 0 4px rgba(59,130,246,0.08);
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.25);
    box-shadow: 0 4px 16px rgba(59,130,246,0.4), 0 0 0 6px rgba(59,130,246,0.12);
}

input[type=range]::-webkit-slider-runnable-track {
    border-radius: 8px;
}

/* ========== RESULTS SECTION ========== */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.metric-box {
    background: rgba(248,250,252,0.8);
    backdrop-filter: blur(8px);
    padding: 20px 16px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    border: 1px solid rgba(226,232,240,0.5);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

.metric-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-green), var(--slider-blue));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.metric-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.06);
    border-color: rgba(34,197,94,0.15);
}

.metric-box:hover::before {
    transform: scaleX(1);
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-navy);
    transition: transform 0.3s ease, color 0.3s ease;
}

/* ========== COMPARISON BOX ========== */
.comparison-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(248,250,252,0.8);
    backdrop-filter: blur(8px);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(226,232,240,0.5);
    margin-bottom: 24px;
    transition: box-shadow 0.4s ease;
}

.comparison-box:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.comp-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.comp-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comp-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-navy);
}

.comp-divider {
    color: var(--text-muted);
    font-size: 1.2rem;
    opacity: 0.4;
    padding: 0 16px;
    transition: transform 0.3s ease;
}

.comparison-box:hover .comp-divider {
    transform: translateX(4px);
    opacity: 0.7;
}

/* ========== BADGES ========== */
.badge {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: box-shadow 0.3s ease;
}

.badge.approved {
    background: rgba(34,197,94,0.1);
    color: var(--primary-green);
    box-shadow: 0 0 0 0 rgba(34,197,94,0);
}

.badge.approved:hover {
    box-shadow: 0 0 16px rgba(34,197,94,0.2);
}

.badge.review {
    background: #fef3c7;
    color: #b45309;
}

.badge.declined, .badge.rejected {
    background: rgba(239,68,68,0.08);
    color: var(--danger-red);
}

/* ========== STATUS MESSAGE ========== */
.status-message {
    padding: 18px 20px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    line-height: 1.5;
}

.status-message::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    background-size: 200% 100%;
    animation: shimmerStatus 4s ease-in-out infinite;
    pointer-events: none;
}

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

.status-message.success {
    background: linear-gradient(135deg, rgba(209,250,229,0.8), rgba(220,252,231,0.8));
    color: #059669;
    border: 1px solid rgba(16,185,129,0.2);
}

.status-message.warning {
    background: linear-gradient(135deg, rgba(254,226,226,0.8), rgba(254,242,242,0.8));
    color: #dc2626;
    border: 1px solid rgba(239,68,68,0.2);
}

.status-message.neutral {
    background: linear-gradient(135deg, rgba(224,231,255,0.8), rgba(238,242,255,0.8));
    color: #4338ca;
    border: 1px solid rgba(99,102,241,0.2);
}

/* ========== CHART ========== */
.chart-card { margin-top: 8px; }
.canvas-wrapper { position: relative; height: 350px; width: 100%; }

/* ========== FOOTER ========== */
.footer {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(226,232,240,0.5);
    padding: 24px 0;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34,197,94,0.3), rgba(59,130,246,0.3), transparent);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.footer-logo { display: flex; align-items: center; gap: 6px; font-weight: 700; }

.footer-links { display: flex; gap: 24px; color: var(--text-muted); }

.footer-links a {
    position: relative;
    transition: color 0.3s ease;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-green), var(--slider-blue));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.footer-links a:hover { color: var(--primary-green); }
.footer-links a:hover::after { width: 100%; }

.copyright { color: var(--text-muted); }

/* ========== ANIMATIONS ========== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.pulse-update { animation: pulseUpdate 0.4s ease-in-out; }
@keyframes pulseUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

/* Staggered card entrance */
.parameters-card { animation-delay: 0.1s; }
.results-card { animation-delay: 0.2s; }
.chart-card.fade-in { animation-delay: 0.3s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .simulator-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .metrics-row { grid-template-columns: 1fr; }
    .footer-container { flex-direction: column; gap: 16px; text-align: center; }
    .comparison-box { flex-direction: column; gap: 16px; }
}

/* ========== DARK THEME ========== */
body.dark-theme .bg-orb-1 {
    background: radial-gradient(circle, rgba(52,211,153,0.08), transparent 70%);
}
body.dark-theme .bg-orb-2 {
    background: radial-gradient(circle, rgba(96,165,250,0.06), transparent 70%);
}

body.dark-theme .metric-box {
    background: rgba(30,41,59,0.5) !important;
}

body.dark-theme input[type=range] {
    background: linear-gradient(90deg, rgba(52,211,153,0.5), rgba(96,165,250,0.5));
}

body.dark-theme .comparison-box {
    background: rgba(30,41,59,0.5) !important;
}