﻿:root {
    /* Dark Theme (Default) */
    --bg-color: #0d1117;
    --panel-bg: rgba(22, 27, 34, 0.85);
    --panel-border: rgba(255, 255, 255, 0.15);
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --primary: #58a6ff;
    --primary-gradient: linear-gradient(135deg, #58a6ff 0%, #a371f7 100%);
    --success: #2ea043;
    --danger: #f85149;
    --warning: #d29922;
    --input-bg: rgba(0,0,0,0.4);
    --input-border: rgba(255,255,255,0.2);
    --hover-bg: rgba(255,255,255,0.1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --glass-blur: blur(16px);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

:root.light-mode {
    --bg-color: #f8fafc;
    --panel-bg: rgba(255, 255, 255, 0.95);
    --panel-border: rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --text-muted: #475569;
    --primary: #2563eb;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --hover-bg: rgba(0,0,0,0.05);
    --shadow: 0 8px 24px rgba(0,0,0,0.06);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(88, 166, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(163, 113, 247, 0.05) 0%, transparent 40%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Main Layout */
.app-main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .app-main {
        grid-template-columns: 350px 1fr;
    }
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    backdrop-filter: var(--glass-blur);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.panel-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 1rem;
}

.panel-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.panel-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Forms */
.pricing-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.select-wrapper, .input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

select, input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
    appearance: none;
}

option {
    background: var(--bg-color);
    color: var(--text-main);
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 2.5rem;
}

.currency, .units {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.select-wrapper i {
    position: absolute;
    right: 1rem;
    pointer-events: none;
    color: var(--text-muted);
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

/* Dashboard Outputs */
.results-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dashboard-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.exportable-card {
    position: relative;
    transition: var(--transition);
}

.exportable-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--panel-border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: grid;
    place-items: center;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-box {
    background: var(--hover-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-box.primary {
    background: rgba(88, 166, 255, 0.1);
    border-color: rgba(88, 166, 255, 0.3);
}

.metric-box.highlight {
    background: rgba(163, 113, 247, 0.1);
    border-color: rgba(163, 113, 247, 0.3);
}

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

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-main);
}

.metric-box.primary .metric-value {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.metric-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Charts & Comparison */
.charts-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chart-container {
    height: 300px;
    width: 100%;
}

.market-comparison {
    margin-top: 1rem;
}

.market-comparison h4 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.gauge-container {
    position: relative;
    padding-bottom: 2rem;
}

.gauge-track {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    position: relative;
}

.gauge-fill {
    position: absolute;
    height: 100%;
    left: 0;
    width: 50%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.gauge-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-main);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.5);
    z-index: 2;
}

.gauge-marker.target {
    background: var(--primary);
}

.gauge-marker.competitor {
    background: var(--text-muted);
    width: 12px;
    height: 12px;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.gauge-insight {
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

/* Insights Grid */
.insights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.insight-block {
    background: var(--hover-bg);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.25rem;
}

.insight-block h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.insight-block p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.source-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.source-tag a {
    color: var(--primary);
    text-decoration: none;
}

.source-tag a:hover {
    text-decoration: underline;
}

.actions-list {
    list-style: none;
}

.actions-list li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.actions-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.danger-zone {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.3);
}

.danger-zone h4 {
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(88, 166, 255, 0.5);
    transform: translateY(-1px);
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.exportable-card {
    animation: fadeIn 0.4s ease forwards;
}
