/* ==========================================================================
   CSS Variables & Design System
   ========================================================================== */
:root {
    --font-sans: 'Outfit', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Colors */
    --color-bg: #07080b;
    --color-card-bg: rgba(18, 20, 28, 0.55);
    --color-card-inset: rgba(10, 11, 16, 0.6);
    --color-border: rgba(255, 255, 255, 0.07);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    
    --color-text-primary: #f3f4f6;
    --color-text-muted: #9ca3af;
    
    --color-primary: #7c4dff;
    --color-primary-glow: rgba(124, 77, 255, 0.15);
    
    --color-emerald: #00e676;
    --color-emerald-glow: rgba(0, 230, 118, 0.15);
    
    --color-cyan: #00e5ff;
    --color-cyan-glow: rgba(0, 229, 255, 0.15);
    
    --color-gold: #ffd700;
    --color-gold-bg: rgba(255, 215, 0, 0.05);
    --color-gold-border: rgba(255, 215, 0, 0.25);
    --color-gold-glow: rgba(255, 215, 0, 0.2);
    
    --color-coral: #ff5252;
    --color-coral-glow: rgba(255, 82, 82, 0.2);
    
    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #7c4dff 0%, #00e5ff 100%);
    --gradient-gold: linear-gradient(135deg, #ffe066 0%, #ffd700 50%, #cca300 100%);
    --gradient-green: linear-gradient(135deg, #00e676 0%, #00b0ff 100%);
    --gradient-card-border: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    
    /* Layout */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Glow Effects */
.background-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(124, 77, 255, 0.08) 0%, rgba(0, 229, 255, 0.02) 50%, rgba(0,0,0,0) 80%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px;
}

.font-numeric {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================================================
   Glassmorphism Helper
   ========================================================================== */
.glass {
    background: var(--color-card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.glass-inset {
    background: var(--color-card-inset);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

/* ==========================================================================
   Header Styles
   ========================================================================== */
.app-header {
    text-align: center;
    margin-bottom: 56px;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 32px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
}

/* Language Switcher styling */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    padding: 4px 10px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.lang-switcher:hover {
    border-color: var(--color-border-hover);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition-smooth);
    border-bottom: 2px solid transparent;
}

.lang-btn:hover {
    color: var(--color-text-primary);
}

.lang-btn.active {
    color: var(--color-cyan);
    border-bottom: 2px solid var(--color-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    font-weight: 300;
    pointer-events: none;
    user-select: none;
}

.logo-emoji {
    font-size: 1.1rem;
}

.logo-text {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
}

.name-input-container {
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

#friend-name {
    font-family: var(--font-sans);
    font-size: inherit;
    font-weight: 800;
    letter-spacing: inherit;
    color: var(--color-cyan);
    background: transparent;
    border: none;
    border-bottom: 2px dashed rgba(0, 229, 255, 0.4);
    outline: none;
    padding: 0 4px;
    margin: 0;
    width: 90px; /* Will be adjusted dynamically by JS, but standard fallback */
    max-width: 100%;
    text-align: center;
    caret-color: var(--color-cyan);
    transition: var(--transition-smooth);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

#friend-name:focus {
    border-bottom: 2px solid var(--color-cyan);
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

#friend-name::placeholder {
    color: rgba(255, 255, 255, 0.15);
    font-weight: 400;
    font-style: italic;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.15);
    text-shadow: none;
}

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto;
    font-weight: 400;
}

/* ==========================================================================
   Calculator Grid (Main Control Panel & Regret Panel)
   ========================================================================== */
.calculator-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 32px;
    margin-bottom: 64px;
}

.controls-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.panel-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
    border-left: 3px solid var(--color-primary);
    padding-left: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

/* Custom Number Input */
.number-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.number-input-wrapper input {
    width: 100%;
    padding: 16px 110px 16px 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.number-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* Hide default spinners */
.number-input-wrapper input::-webkit-outer-spin-button,
.number-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.number-input-wrapper input[type=number] {
    -moz-appearance: textfield;
}

.currency-select-container {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
}

.currency-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    outline: none;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    appearance: none; /* Hide default native arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2' viewBox='0 0 24 24'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px; /* Extra padding for custom arrow */
}

.currency-select:hover {
    border-color: var(--color-border-hover);
    color: var(--color-text-primary);
}

.currency-select:focus {
    border-color: var(--color-cyan);
    color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.currency-select option {
    background: #0f121d;
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    padding: 8px;
}

/* Presets (Quick Select Buttons) */
.presets-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.preset-btn {
    padding: 10px 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    border-color: var(--color-border-hover);
}

.preset-btn.active {
    background: var(--color-primary-glow);
    color: var(--color-cyan);
    border-color: var(--color-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

/* Custom Date Input */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input-wrapper input {
    width: 100%;
    padding: 16px 50px 16px 20px; /* Leave space for icon */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.date-input-wrapper input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.calendar-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    pointer-events: none; /* Clicks pass through */
    opacity: 0.7;
    transition: var(--transition-smooth);
    z-index: 2;
}

.date-input-wrapper:hover .calendar-icon {
    color: var(--color-cyan);
    opacity: 1;
}

/* Hide default browser indicator but stretch it to cover the field so click opens it */
.date-input-wrapper input::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0; /* Fully invisible */
    cursor: pointer;
    z-index: 3;
}

/* Status Info Box */
.status-box {
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--color-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-cyan);
    display: inline-block;
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    from { transform: scale(1); opacity: 0.6; }
    to { transform: scale(1.3); opacity: 1; }
}

.status-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-primary);
    line-height: 1.4;
}

/* ==========================================================================
   Summary Panel & Regret Scale
   ========================================================================== */
.summary-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid var(--color-gold-border);
    background: radial-gradient(circle at top right, rgba(255, 215, 0, 0.03) 0%, rgba(18, 20, 28, 0.55) 70%);
}

.summary-meta {
    margin-bottom: 12px;
}

.regret-badge {
    background: var(--color-gold-bg);
    border: 1px solid rgba(255, 215, 0, 0.15);
    color: var(--color-gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.regret-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.regret-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}

.regret-currency {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-gold);
}

.regret-amount {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--color-gold);
    line-height: 1;
    text-shadow: 0 0 20px var(--color-gold-glow);
}

.regret-description {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
    min-height: 48px; /* Prevents shifting when text changes */
}

/* Regret Gauge Visualized (Speedometer) */
.regret-gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.regret-gauge-wrapper {
    position: relative;
    width: 220px;
    height: 110px;
    margin-top: 10px;
}

.regret-gauge {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

#gauge-fill {
    transition: stroke-dashoffset 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.gauge-needle-wrapper {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 0;
}

.gauge-needle {
    position: absolute;
    bottom: 0;
    left: -2px; /* Center alignment */
    width: 4px;
    height: 85px;
    background: var(--color-text-primary);
    border-radius: 4px;
    transform-origin: bottom center;
    transform: rotate(-90deg); /* 0% default */
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
    z-index: 10;
}

/* Elegant needle pin in center bottom */
.gauge-center-pin {
    position: absolute;
    bottom: -8px;
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--color-text-primary);
    border-radius: 50%;
    border: 3px solid #1a1c26;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    z-index: 11;
}

/* Percentage display in the arc center */
.gauge-value {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-gold);
    text-shadow: 0 0 15px var(--color-gold-glow);
    z-index: 5;
    font-family: var(--font-sans);
}

/* Tick Labels Spaced Below Gauge */
.gauge-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.gauge-labels span {
    transition: var(--transition-smooth);
    opacity: 0.55;
    text-align: center;
}

/* Active highlights depending on the current regret level */
.gauge-labels span.active {
    opacity: 1;
    color: var(--color-text-primary);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.gauge-labels .label-calm.active { color: var(--color-emerald); text-shadow: 0 0 8px var(--color-emerald-glow); }
.gauge-labels .label-doubts.active { color: var(--color-cyan); text-shadow: 0 0 8px var(--color-cyan-glow); }
.gauge-labels .label-anxiety.active { color: var(--color-gold); text-shadow: 0 0 8px var(--color-gold-glow); }
.gauge-labels .label-anger.active { color: #ff7b00; text-shadow: 0 0 8px rgba(255, 123, 0, 0.2); }
.gauge-labels .label-fury.active { color: var(--color-coral); text-shadow: 0 0 8px var(--color-coral-glow); }

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--gradient-brand);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.icon {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Results Grid Section
   ========================================================================== */
.results-section {
    margin-top: 24px;
}

.section-heading {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    text-align: center;
}

.section-subheading {
    font-size: 1.05rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ==========================================================================
   Investment Card Design
   ========================================================================== */
.invest-card {
    position: relative;
    padding: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 20px;
    cursor: pointer;
}

.invest-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 15px 35px -5px rgba(0, 229, 255, 0.08), 0 15px 35px -5px rgba(0, 0, 0, 0.6);
}

.invest-card.gold-card:hover {
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 15px 35px -5px rgba(255, 215, 0, 0.08), 0 15px 35px -5px rgba(0, 0, 0, 0.6);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.015) 0%, rgba(255, 255, 255, 0) 50%);
    pointer-events: none;
    z-index: 0;
    transition: var(--transition-smooth);
}

.invest-card:hover .card-glow {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 50%);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1;
}

/* Icon Box & Color Themes */
.card-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--color-text-muted);
}

.card-icon-deposit { color: #818cf8; background: rgba(129, 140, 248, 0.1); border-color: rgba(129, 140, 248, 0.2); }
.card-icon-bond { color: var(--color-emerald); background: var(--color-emerald-glow); border-color: rgba(0, 230, 118, 0.2); }
.card-icon-cash { color: #34d399; background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.2); }
.card-icon-crypto { color: var(--color-cyan); background: var(--color-cyan-glow); border-color: rgba(0, 229, 255, 0.2); }
.card-icon-stocks { color: #38bdf8; background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.2); }
.card-icon-gold { color: var(--color-gold); background: var(--color-gold-bg); border-color: var(--color-gold-border); }

.card-svg {
    width: 24px;
    height: 24px;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
}

.badge-baseline { background: rgba(255, 255, 255, 0.05); color: var(--color-text-muted); }
.badge-safe { background: rgba(0, 230, 118, 0.1); color: var(--color-emerald); }
.badge-currency { background: rgba(52, 211, 153, 0.1); color: #34d399; }
.badge-crypto { background: rgba(0, 229, 255, 0.1); color: var(--color-cyan); }
.badge-growth { background: rgba(56, 189, 248, 0.1); color: #38bdf8; }
.badge-gold { background: var(--color-gold-bg); color: var(--color-gold); border: 1px solid rgba(255, 215, 0, 0.15); }

/* Card Body */
.card-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 1;
}

.rate-badge {
    align-self: flex-start;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.rate-badge.highlight-green {
    background: rgba(0, 230, 118, 0.05);
    border-color: rgba(0, 230, 118, 0.15);
    color: var(--color-emerald);
}

.rate-badge.highlight-blue {
    background: rgba(0, 229, 255, 0.05);
    border-color: rgba(0, 229, 255, 0.15);
    color: var(--color-cyan);
}

.rate-badge.highlight-gold {
    background: var(--color-gold-bg);
    border-color: var(--color-gold-border);
    color: var(--color-gold);
}

.rate-note {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-left: 2px;
}

/* Math Rows */
.math-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.math-row .label {
    color: var(--color-text-muted);
}

.math-row .value {
    font-size: 1.15rem;
    color: var(--color-text-primary);
}

.math-row.divider {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 14px;
}

.math-row .value.profit {
    color: var(--color-emerald);
    font-size: 1.25rem;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.1);
}

.card-comment {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    font-style: italic;
    min-height: 40px;
}

/* ==========================================================================
   Gold Card Extra Premium Styling
   ========================================================================== */
.gold-card {
    border: 1px solid var(--color-gold-border);
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.04) 0%, rgba(18, 20, 28, 0.6) 80%);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.03);
}

.gold-card:hover {
    border-color: var(--color-gold);
    box-shadow: 0 15px 35px -5px rgba(255, 215, 0, 0.15);
}

.card-glow-gold {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.02) 0%, rgba(255, 215, 0, 0) 55%);
    pointer-events: none;
    z-index: 0;
    transition: var(--transition-smooth);
}

.gold-card:hover .card-glow-gold {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.06) 0%, rgba(255, 215, 0, 0) 55%);
}

.card-glow-gold::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 20px rgba(255, 215, 0, 0.02);
    pointer-events: none;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.app-footer {
    margin-top: 80px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sources {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.5;
}

.copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Toast Notification Panel
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(18, 20, 28, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-cyan);
    border-radius: 100px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.hidden {
    opacity: 0;
    bottom: 20px;
    pointer-events: none;
}

.toast-icon {
    font-size: 1.1rem;
}

.toast-message {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ==========================================================================
   Loading States & API Links
   ========================================================================== */
/* API Links inside Investment Cards */
.card-api-link {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    align-self: flex-start;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
    transition: var(--transition-smooth);
    z-index: 2;
}

.card-api-link:hover {
    color: var(--color-cyan);
    border-color: var(--color-cyan);
}

.card-api-link svg {
    width: 10px;
    height: 10px;
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.card-api-link:hover svg {
    opacity: 1;
    transform: translate(1px, -1px);
}

/* Status Indicator Loading State */
.status-indicator.loading {
    background: var(--color-gold) !important;
    box-shadow: 0 0 10px var(--color-gold) !important;
}

/* Input Panel Block during Loading */
.controls-panel.loading-state {
    pointer-events: none;
    opacity: 0.8;
}

/* Shimmer Skeletal Effect */
.loading-shimmer {
    position: relative;
    overflow: hidden;
}

.loading-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
    z-index: 5;
    pointer-events: none;
}

.invest-card.loading .value,
.invest-card.loading .profit,
.regret-amount.loading {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================================================
   Responsive Adaptations (Breakpoints)
   ========================================================================== */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }
    
    .header-top-row {
        flex-direction: column;
        gap: 16px;
        align-items: center;
        margin-bottom: 24px;
    }
    
    .app-header {
        margin-bottom: 40px;
    }
    
    .main-title {
        font-size: 2.3rem;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .controls-panel, .summary-panel {
        padding: 24px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .regret-amount {
        font-size: 3.2rem;
    }
}

/* ==========================================================================
   Investment Opportunity Growth Chart Modal & SVG CSS
   ========================================================================== */
.card-chart-hint {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    opacity: 0.3;
    transition: var(--transition-smooth);
    margin-top: 4px;
    text-align: center;
    font-weight: 500;
}

.invest-card:hover .card-chart-hint {
    opacity: 0.9;
    color: var(--color-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.invest-card.gold-card:hover .card-chart-hint {
    color: var(--color-gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* Modal Overlay backdrop */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 5, 8, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Modal Content Container */
.modal-container {
    width: 100%;
    max-width: 680px;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.8), 0 0 40px rgba(124, 77, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.animate-slide-up {
    animation: modalSlideUp 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* Modal Header styling */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 16px;
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon-box {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 750;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.modal-close-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close-btn:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-border-hover);
    transform: rotate(90deg);
}

/* Modal Body */
.modal-summary-box {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    text-align: center;
}

.summary-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-metric .label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.summary-metric .value {
    font-size: 1.25rem;
    font-weight: 750;
    color: var(--color-text-primary);
}

.summary-metric .value.profit {
    color: var(--color-emerald);
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.15);
}

.modal-instruction {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin-bottom: 24px;
    padding: 8px 12px;
    border-left: 3px solid var(--chart-theme-color, var(--color-cyan));
    background: rgba(0, 229, 255, 0.02);
}

/* Chart Canvas Wrapper */
.chart-wrapper {
    position: relative;
    background: var(--color-card-inset);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 20px 24px 20px;
    overflow: visible;
    margin-bottom: 12px;
    touch-action: none;
}

#growth-chart {
    display: block;
    overflow: visible;
    z-index: 10;
}

/* Grid & chart paths */
.grid-line {
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 1;
}

.grid-label-y {
    fill: rgba(255, 255, 255, 0.3);
    font-size: 9px;
    font-family: var(--font-sans);
    font-weight: 500;
    text-anchor: end;
}

.chart-area {
    transition: d 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.chart-line {
    transition: d 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Hover indicators inside SVG */
.hover-line {
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.hover-point {
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.1s ease;
    filter: drop-shadow(0 0 6px var(--chart-theme-color, var(--color-cyan)));
}

.hover-line.hidden, .hover-point.hidden {
    opacity: 0;
}

/* Chart Tooltip Overlay */
.chart-tooltip {
    position: absolute;
    pointer-events: none;
    z-index: 20;
    background: rgba(18, 20, 28, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 229, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    transition: opacity 0.15s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translate(-50%, -100%);
    margin-top: -12px;
    min-width: 120px;
    text-align: center;
}

.chart-tooltip.hidden {
    opacity: 0;
}

.tooltip-date {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: capitalize;
}

.tooltip-value {
    color: var(--color-text-primary);
    font-weight: 800;
    font-size: 0.88rem;
}

/* Axis Labels */
.chart-axis-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Tablet / Mobile adaptations for chart modal */
@media (max-width: 768px) {
    .modal-container {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-summary-box {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }
    
    .summary-metric {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        padding-bottom: 6px;
    }
    
    .summary-metric:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .summary-metric .value {
        font-size: 1.1rem;
    }
    
    .chart-wrapper {
        padding: 10px 10px 20px 10px;
    }
    
    #growth-chart {
        height: 180px;
    }
}

