/* =========================================================
   Base Variables & Resets
========================================================= */
:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(20, 26, 40, 0.6);
    --bg-card-hover: rgba(30, 38, 55, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #9ea4b0;
    --text-muted: #64748b;
    --accent-primary: #00e6a8; /* Neon Green */
    --accent-gradient: linear-gradient(135deg, #00e6a8 0%, #00b386 100%);
    --accent-purple: #7e57c2;
    --accent-danger: #ef5350;
    --accent-warning: #ffb74d;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', system-ui, sans-serif;
    --blur-glass: blur(16px);
}

body.light-theme {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent-primary: #00b386; 
    --blur-glass: blur(20px);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(126, 87, 194, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(0, 179, 134, 0.06) 0%, transparent 50%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(126, 87, 194, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(0, 230, 168, 0.04) 0%, transparent 50%);
    transition: background-color 0.4s ease, color 0.4s ease;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
}

/* =========================================================
   Typography & Headers
========================================================= */
.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* =========================================================
   Perspective Toggle
========================================================= */
.perspective-toggle-wrapper {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-color);
}

.perspective-toggle {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.perspective-toggle.active {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 230, 168, 0.3);
}

.light-theme .perspective-toggle.active {
    box-shadow: 0 4px 15px rgba(0, 179, 134, 0.3);
}

/* =========================================================
   Layout Grids
========================================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.results-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
    height: max-content;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr; 
    }
    .results-panel {
        position: relative;
        top: 0;
    }
}

/* =========================================================
   Panels & Glassmorphism
========================================================= */
.panel {
    background: var(--bg-card);
    backdrop-filter: var(--blur-glass);
    -webkit-backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

/* =========================================================
   Input Components
========================================================= */
.input-section-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.input-section-title:first-of-type {
    margin-top: 0;
}

.costs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 480px) {
    .costs-grid { grid-template-columns: 1fr; }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -0.3rem;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.2s ease;
}

.light-theme input[type="number"],
.light-theme input[type="text"],
.light-theme select {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.15);
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 230, 168, 0.1);
    background: var(--bg-card-hover);
}

input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
}

.highlight-input {
    background: rgba(0, 230, 168, 0.1) !important;
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
    font-weight: bold;
}

/* =========================================================
   Vehicle Selection & Images
========================================================= */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.8rem;
    color: var(--text-secondary);
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

select {
    appearance: none;
    cursor: pointer;
    font-weight: 500;
}

.vehicle-image-wrapper {
    width: 100%;
    height: 180px;
    background: radial-gradient(circle at center, rgba(126,87,194,0.1) 0%, transparent 70%);
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-top: 1rem;
}

.vehicle-image-wrapper img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 15px 20px rgba(0,0,0,0.3));
    transition: opacity 0.3s ease;
}

.uber-alert {
    background: rgba(255, 183, 77, 0.1);
    border: 1px solid rgba(255, 183, 77, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.uber-alert .icon {
    font-size: 1.2rem;
}


/* =========================================================
   Dynamic Custom Hits & Action Buttons
========================================================= */
.action-btn {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.light-theme .action-btn {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
}

.action-btn:hover { 
    background: rgba(255,255,255,0.15); 
}
.light-theme .action-btn:hover { 
    background: rgba(0,0,0,0.1); 
}

.dynamic-hit {
    background: rgba(239, 83, 80, 0.05);
    border: 1px solid rgba(239, 83, 80, 0.2);
    padding: 1rem 1rem 0;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.del-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-danger);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.del-btn:hover { background: #d32f2f; transform: scale(1.1); }

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

/* =========================================================
   Results Panel & Metrics
========================================================= */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

.metric-card.hero-metric {
    background: linear-gradient(180deg, rgba(30, 38, 55, 0.2) 0%, rgba(20, 26, 40, 0.6) 100%);
    border-top: 2px solid var(--accent-primary);
}

.light-theme .metric-card.hero-metric {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.metric-card.highlight {
    background: linear-gradient(135deg, rgba(126, 87, 194, 0.1) 0%, rgba(30, 38, 55, 0.6) 100%);
    border: 1px solid rgba(126, 87, 194, 0.3);
}

.light-theme .metric-card.highlight {
    background: linear-gradient(135deg, rgba(126, 87, 194, 0.1) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.metric-card h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0;
    display: flex;
    align-items:baseline;
    gap: 0.2rem;
}

.metric-value .currency {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.metric-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

@keyframes valueUpdate {
    0% { color: var(--accent-primary); text-shadow: 0 0 20px rgba(0, 230, 168, 0.5); transform: scale(1.05); }
    100% { color: var(--text-primary); text-shadow: none; transform: scale(1); }
}

.value-flash {
    animation: valueUpdate 0.8s ease-out forwards;
}

/* =========================================================
   Charts
========================================================= */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.canvas-wrapper {
    position: relative; 
    height: 400px;
    width: 100%;
}

/* =========================================================
   Call To Actions & Footer
========================================================= */
.action-section {
    margin: 4rem 0 2rem 0;
}

.action-heading {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
}

.action-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.action-card.premium {
    background: linear-gradient(145deg, rgba(126, 87, 194, 0.1) 0%, rgba(20, 26, 40, 0.6) 100%);
    border-color: rgba(126, 87, 194, 0.4);
}

.light-theme .action-card.premium {
    background: linear-gradient(145deg, rgba(126, 87, 194, 0.1) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.action-card.premium:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 10px 30px rgba(126, 87, 194, 0.15);
}

.action-icon {
    font-size: 1.8rem;
    background: rgba(126,87,194,0.1);
    padding: 0.8rem;
    border-radius: var(--radius-md);
}

.action-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.action-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.action-arrow {
    margin-left: auto;
    font-size: 1.2rem;
    color: var(--accent-primary);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.action-card:hover .action-arrow {
    opacity: 1;
    transform: translateX(0);
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-bottom: 2rem solid transparent;
}
