/* styles.css - Refined Fintech Theme (Light Mode) */

/* ── Remove up/down spinner arrows inside SIP & SWP form number inputs ── */
.glass-card input[type=number]::-webkit-inner-spin-button,
.glass-card input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.glass-card input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* 1. Reset & Base */
:root {
    /* Primary Brand Gradient */
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);

    /* Accents */
    --color-acc-growth: #10b981;
    /* Emerald 500 */
    --color-acc-withdraw: #f43f5e;
    /* Rose 500 */

    /* Colors */
    --color-text-primary: #0f172a;
    /* Slate 900 */
    --color-text-secondary: #64748b;
    /* Slate 500 */
    --color-border: #e2e8f0;
    /* Slate 200 */
    --color-bg: #f8fafc;
    /* Slate 50 */

    /* Shadows */
    --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.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
    /* Indigo Glow */

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.9);
    /* White with opacity */
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(79, 81, 93, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Size-matching fallback to prevent CLS during font swap */
@font-face {
    font-family: 'Plus Jakarta Sans Fallback';
    src: local('Arial');
    size-adjust: 107%;
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
}

body {
    background-color: var(--color-bg);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.05), transparent 25%);
    background-attachment: fixed;
    font-family: 'Plus Jakarta Sans', 'Plus Jakarta Sans Fallback', 'Inter', Arial, sans-serif;
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-text-primary);
}

.text-slate-500 {
    color: #64748b !important;
}

/* For Disclaimer */
.text-slate-400 {
    color: var(--color-text-secondary) !important;
}

/* WCAG contrast-safe green and emerald variants */
.text-green-700 {
    color: oklch(52.7% .154 150.069);
}

.text-emerald-700 {
    color: oklch(50.8% .118 165.612);
}

/* Input Fields */
input[type="number"],
select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s;
}

input[type="number"]:focus,
select:focus {
    border-color: var(--color-acc-growth);
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* 3. Components */

/* Elegant Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
    /* 16px */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.08);
}

/* Inputs */
input[type="number"],
input[type="text"],
select,
textarea {
    /* width: 100%;  Removed to allow specific width classes */
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: #fff;
    border: 1px solid #cbd5e1;
    /* Slate 300 */
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    box-shadow: var(--shadow-sm);
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 12px;
    z-index: 10;
    color: #94a3b8;
    /* Slate 400 */
    pointer-events: none;
    transition: color 0.2s;
}

.input-group:focus-within .input-icon {
    color: #6366f1;
    /* Indigo 500 */
}

.input-with-icon {
    padding-left: 2.5rem !important;
    /* Make room for icon */
}

/* Adornments (Right side) */
.input-suffix {
    position: absolute;
    right: 12px;
    z-index: 10;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.8);
    /* Slight backdrop */
    padding-left: 4px;
}

/* Gradient Focus Ring – disabled to allow Tailwind focus utilities */
/* input:focus { ... } */

/* input:hover — border handled by Tailwind utilities */

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid-full {
        grid-column: 1 / -1;
    }
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: #475569;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.btn-accent {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(244, 63, 94, 0.3);
}

.btn-accent:hover {
    box-shadow: 0 10px 15px -3px rgba(244, 63, 94, 0.4);
}

/* Table */
.table-container {
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.75rem;
    /* Ensure radius applies to bg */
}

th {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--color-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: #334155;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

/* Utility */
/* Utility */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: var(--gradient-primary);
    background-size: 200% auto;
    animation: gradient-flow 5s ease infinite;
}

.text-gradient-accent {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-image: var(--gradient-accent);
    background-size: 200% auto;
    animation: gradient-flow 5s ease infinite;
}

/* Animations */
@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-subtle {
    0% {
        box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    }

    50% {
        box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.5);
    }

    100% {
        box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    }
}

.btn-primary:hover {
    animation: pulse-subtle 2s infinite;
    transform: translateY(-1px);
}

/* Card Shine Effect */
.glass-card {
    position: relative;
    /* overflow: hidden; */
    /* For the shine - Disabled to prevent clipping
    /* ... existing props ... */
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

/* 
.glass-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(60deg,
            rgba(255, 255, 255, 0) 20%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0) 80%);
    transition: transform 0.6s;
    pointer-events: none;
}

.glass-card:hover::after {
    transform: translateX(100%);
    transition: transform 0.6s;
} 
*/

/* Custom Range Slider */
/* Custom Range Slider */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
}

/* Thumb Styles */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #10b981;
    /* Emerald 500 */
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    transition: transform 0.2s;
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.4);
    background: #10b981;
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.2);
}

input[type=range]:hover::-webkit-slider-thumb {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15);
}

input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border: none;
    border-radius: 50%;
    background: #10b981;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    transition: transform 0.2s;
}

input[type=range]:active::-moz-range-thumb {
    transform: scale(1.4);
    background: #10b981;
}

input[type=range]:hover::-moz-range-thumb {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15);
}

/* SWP Rose Variant (overrides Emerald) */
.accent-rose-500::-webkit-slider-thumb {
    background: #fb7185;
    /* Rose 400 */
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.1);
}

.accent-rose-500:active::-webkit-slider-thumb {
    background: #fb7185;
    box-shadow: 0 0 0 8px rgba(251, 113, 133, 0.2);
}

.accent-rose-500:hover::-webkit-slider-thumb {
    box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.15);
}

.accent-rose-500::-moz-range-thumb {
    background: #fb7185;
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.1);
}

.accent-rose-500:active::-moz-range-thumb {
    background: #fb7185;
}

.accent-rose-500:hover::-moz-range-thumb {
    box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.15);
}

/* Track Styles */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #e2e8f0;
    border-radius: 3px;
    transition: background 0.2s ease;
}

input[type=range]:hover::-webkit-slider-runnable-track {
    background: #cbd5e1;
}

/* Custom Scrollbar for Table */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #e2e8f0;
    border-radius: 3px;
    transition: background 0.2s ease;
}

/* Accent Color Modifiers for SWP */
.accent-rose-600::-webkit-slider-thumb {
    background: #e11d48;
    /* Rose 600 */
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.1);
}

.accent-rose-600::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 6px rgba(225, 29, 72, 0.15);
}

.accent-rose-600::-moz-range-thumb {
    background: #e11d48;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.1);
}

/* --- Goal Reverser Styles --- */
.hero-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid #e2e8f0;
    text-align: center;
    color: var(--color-text-primary);
    font-size: 3rem;
    font-weight: 800;
    width: 100%;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.hero-input:focus {
    outline: none;
    border-bottom-color: #6366f1;
    /* Indigo 500 */
    transform: scale(1.02);
}

.pill-input {
    display: inline-flex;
    align-items: center;
    background-color: white;
    box-shadow: var(--shadow-sm);
    border-radius: 9999px;
    padding: 8px 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.pill-input:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.pill-input label {
    margin-right: 8px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

.pill-input input {
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    width: 60px;
    padding: 0;
    box-shadow: none;
    font-weight: 700;
    text-align: right;
}

.pill-input input:focus {
    outline: none;
    box-shadow: none;
}

/* Staircase Visualization */
.staircase-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 300px;
    padding: 20px;
    gap: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    border: 1px solid var(--color-border);
}

.stair-step {
    flex-grow: 1;
    background-image: linear-gradient(to top, #4f46e5, #818cf8);
    border-radius: 6px 6px 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stair-step:hover {
    transform: translateY(-4px) scale(1.02);
    background-image: linear-gradient(to top, #4338ca, #6366f1);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.stair-step .tooltip {
    visibility: hidden;
    width: max-content;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 20;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

.stair-step:hover .tooltip {
    visibility: visible;
    opacity: 1;
    bottom: 120%;
}


/* --- Navbar Styles --- */
.navbar-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Transitions */
.transition-width {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-numbers {
    transition: all 0.3s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Small screens (phones) ── */
@media (max-width: 640px) {

    /* Compact table cells */
    th {
        padding: 0.5rem 0.35rem;
        font-size: 0.65rem;
        letter-spacing: 0.02em;
    }

    td {
        padding: 0.5rem 0.35rem;
        font-size: 0.75rem;
    }

    /* Disable hover lift on touch — causes jank */
    .glass-card:hover {
        transform: none;
        box-shadow: var(--glass-shadow);
    }

    /* Mobile: larger slider thumb for touch targets (min 48px touch area) */
    input[type=range] {
        height: 44px;
        /* invisible touch area meets 48px guideline */
    }

    input[type=range]::-webkit-slider-thumb {
        height: 24px;
        width: 24px;
        margin-top: -9px;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    }

    input[type=range]::-moz-range-thumb {
        height: 24px;
        width: 24px;
        box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    }

    /* Goal Reverser hero input */
    .hero-input {
        font-size: 1.75rem;
    }

    /* Staircase shorter on mobile */
    .staircase-container {
        height: 200px;
        padding: 12px;
        gap: 3px;
    }

    /* Pill inputs wrap better */
    .pill-input {
        padding: 6px 12px;
    }

    .pill-input label {
        font-size: 0.75rem;
    }
}

/* ── Medium screens (tablets) ── */
@media (max-width: 768px) {

    /* Slightly smaller table cells */
    th {
        padding: 0.625rem 0.5rem;
        font-size: 0.7rem;
    }

    td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* ── Missing Tailwind responsive utilities ──
   The purged tailwind.min.css build does not include sm:/lg: prefixed classes.
   These manual overrides ensure responsive behavior works correctly. */

/* sm: breakpoint (≥640px) */
@media (min-width: 640px) {
    .sm\:hidden {
        display: none !important;
    }

    .sm\:flex {
        display: flex !important;
    }

    .sm\:flex-row {
        flex-direction: row !important;
    }

    .sm\:inline {
        display: inline !important;
    }

    .sm\:inline-flex {
        display: inline-flex !important;
    }

    .sm\:gap-4 {
        gap: 1rem !important;
    }

    .sm\:p-6 {
        padding: 1.5rem !important;
    }

    .sm\:p-12 {
        padding: 3rem !important;
    }

    .sm\:text-5xl {
        font-size: 3rem !important;
        line-height: 1 !important;
    }
}

/* md: breakpoint (≥768px) */
@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .md\:text-7xl {
        font-size: 4.5rem !important;
        line-height: 1 !important;
    }
}

/* lg: breakpoint (≥1024px) */
@media (min-width: 1024px) {
    .lg\:p-8 {
        padding: 2rem !important;
    }

    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}