:root {
    /* Light Mode (Default) */
    --primary-color: #2563eb;
    --success-color: #059669;
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-color: #1e293b;
    --text-muted: #64748b;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --input-bg: rgba(255, 255, 255, 0.5);
    --chart-grid: rgba(0, 0, 0, 0.05);
    --chart-text: #64748b;
}

body.dark-mode {
    /* Dark Mode */
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    --input-bg: rgba(0, 0, 0, 0.2);
    --chart-grid: rgba(255, 255, 255, 0.05);
    --chart-text: #94a3b8;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Glassmorphism Utilities */
.glass-nav,
.glass-card,
.glass-footer {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* Navigation */
.glass-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.back-link {
    justify-self: start;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--text-color);
}

.logo {
    justify-self: center;
    font-weight: 700;
    font-size: 1.2rem;
    background: linear-gradient(to right, var(--primary-color), var(--success-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-btn {
    justify-self: end;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    padding: 0.5rem;
    border-radius: 50%;
}

.theme-btn:hover {
    color: var(--primary-color);
    background: var(--glass-border);
    transform: rotate(15deg);
}

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

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

/* Input Card */
.input-card {
    padding: 2rem;
    height: fit-content;
}

.input-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

input[type="number"],
input[type="month"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    padding: 1rem 1rem 1rem 2.8rem;
    /* Space for icon */
    border-radius: 10px;
    color: var(--text-color);
    font-size: 1.1rem;
    font-family: 'JetBrains Mono', monospace;
    transition: border-color 0.3s, background 0.3s, color 0.3s;
    box-sizing: border-box;
}

input[type="month"] {
    padding-left: 1rem;
    /* No icon for date usually or different styling */
}

input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1.5rem 0;
}

.highlight-group input {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

.highlight-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

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

.metric-card {
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.metric-card.success {
    border-bottom: 4px solid var(--success-color);
}

.metric-card.info {
    border-bottom: 4px solid var(--primary-color);
}

.metric-card.warning {
    border-bottom: 4px solid #f59e0b;
    /* Amber */
}

.metric-card.warning .metric-value {
    color: #f59e0b;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    width: 100%;
}

.metric-value {
    font-size: 1.75rem;
    /* Significantly smaller to fit */
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.2rem;
    font-family: 'JetBrains Mono', monospace;
    width: 100%;
    overflow-wrap: break-word;
    /* Prevent clipping */
    line-height: 1.2;
}

.metric-card.success .metric-value {
    color: var(--success-color);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

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

/* Chart Card */
.chart-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.chart-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-item::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-item.standard::before {
    background: #94a3b8;
    /* Grey for standard */
}

.legend-item.accelerated::before {
    background: var(--success-color);
    /* Green for accelerated */
}

.canvas-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Summary Card */
.summary-card {
    padding: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.summary-row.highlight {
    color: var(--text-color);
    font-weight: 600;
}

.summary-row.highlight span:last-child {
    color: var(--success-color);
}

/* SEO Content */
/* SEO Content */
.seo-content {
    color: var(--text-muted);
    line-height: 1.8;
    padding: 3rem;
    font-size: 1.05rem;
}

.seo-content h2 {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.seo-content h3 {
    color: var(--text-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.seo-content p {
    margin-bottom: 1.5rem;
}

.seo-content ul {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.seo-content li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.seo-content li::before {
    content: '•';
    color: var(--success-color);
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.5;
}

.seo-content strong {
    color: var(--text-color);
}

.glass-footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}