/* Astor Forward Budget Act 2025 - Budget Simulator Styles */

/* CSS Variables for consistent theming */
:root {
    /* Color Palette */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Neutral Colors */
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-color: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* 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.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition: all 0.2s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-color: #f8fafc;
        --text-light: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: #334155;
        --border-light: #475569;
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-2xl) 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.title {
    margin-bottom: var(--spacing-md);
}

.title-main {
    display: block;
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.title-sub {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 500;
    opacity: 0.9;
}

.subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.8;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--spacing-xl);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

/* Control Panel */
.control-panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    height: fit-content;
    position: sticky;
    top: var(--spacing-xl);
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
}

.panel-title .material-icons {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
}

/* Control Groups */
.control-group {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.control-group-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-light);
}

/* Control Items */
.control-item {
    margin-bottom: var(--spacing-lg);
}

.control-item:last-child {
    margin-bottom: 0;
}

.control-item label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.slider::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.slider::-moz-range-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.value-input-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 100px;
    position: relative;
}

.value-input {
    width: 80px;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    text-align: center;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.value-input::-webkit-outer-spin-button,
.value-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

.value-input:focus {
    outline: none;
    background: rgba(37, 99, 235, 0.05);
    border-radius: var(--radius-sm);
}

.value-input:hover {
    background: rgba(37, 99, 235, 0.02);
    border-radius: var(--radius-sm);
}

/* Functional number input arrows */


/* Specific width adjustments for different value types */
.value-input-container[data-type="percentage"] {
    min-width: 100px;
}

.value-input-container[data-type="percentage"] .value-input {
    width: 70px;
}

.value-input-container[data-type="population"] {
    min-width: 120px;
}

.value-input-container[data-type="population"] .value-input {
    width: 90px;
}

.value-input-container[data-type="budget"] {
    min-width: 115px;
}

.value-input-container[data-type="budget"] .value-input {
    width: 85px;
}

.value-input-container[data-type="wage"] {
    min-width: 130px;
}

.value-input-container[data-type="wage"] .value-input {
    width: 100px;
}

.unit {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 500;
    min-width: 20px;
}

.slider-value {
    min-width: 60px;
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
    font-size: var(--font-size-sm);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn .material-icons {
    font-size: var(--font-size-lg);
}

/* Results Panel */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.summary-card {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-card.revenue .card-icon {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.summary-card.expenditure .card-icon {
    background: linear-gradient(135deg, var(--secondary-color), #475569);
    color: white;
}

.summary-card.deficit .card-icon {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.summary-card .card-icon.surplus {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.summary-card.loans .card-icon {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

.summary-card.gdp .card-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.card-icon .material-icons {
    font-size: var(--font-size-xl);
}

.card-content h3 {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
}

.card-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--spacing-xs);
}

.card-change {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-weight: 500;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
}

.chart-container {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    min-height: 300px;
    position: relative;
}

.chart-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

/* Tables Section */
.tables-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
}

.table-container {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.table-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.data-table th,
.data-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-color);
    font-size: var(--font-size-sm);
}

.data-table td {
    color: var(--text-color);
}

.data-table tr:hover {
    background: var(--bg-secondary);
}

.total-row {
    background: var(--bg-tertiary);
    font-weight: 600;
}

/* Inflation note styling */
.inflation-note td {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    font-size: 0.9em;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 8px;
}

.total-row td {
    color: var(--text-color);
}

/* Analysis Section */
.analysis-section {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.analysis-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.analysis-item {
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.analysis-item h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
}

.analysis-item p {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.6;
}

/* Projection Section */
.projection-section {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
}

.projection-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
}

.projection-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.projection-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.projection-card h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
}

.projection-card p {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.6;
}

.projection-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
}

.projection-alerts {
    margin-bottom: var(--spacing-lg);
}

.alert {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #92400e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #991b1b;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #166534;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #1e40af;
}

.projection-details {
    margin-top: var(--spacing-xl);
}

.projection-subtitle {
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.key-metrics {
    margin-top: var(--spacing-xl);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.metric-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
}

.metric-card h5 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-light);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.metric-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.metric-label {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    font-weight: 500;
}

/* Status classes for projection table */
.status-good {
    color: #10b981;
    font-weight: 600;
}

.status-warning {
    color: #f59e0b;
    font-weight: 600;
}

.status-critical {
    color: #ef4444;
    font-weight: 600;
}

.positive {
    color: #10b981;
    font-weight: 600;
}

.negative {
    color: #ef4444;
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: var(--spacing-xl);
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer p {
    color: var(--text-light);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.footer p:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .control-panel {
        position: static;
        order: 2;
    }
    
    .results-panel {
        order: 1;
    }
}

@media (max-width: 768px) {
    .header {
        padding: var(--spacing-xl) 0;
    }
    
    .title-main {
        font-size: var(--font-size-3xl);
    }
    
    .title-sub {
        font-size: var(--font-size-lg);
    }
    
    .main-content {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .tables-section {
        grid-template-columns: 1fr;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
    }
    
    .control-panel {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 var(--spacing-md);
    }
    
    .main-content {
        padding: var(--spacing-md);
    }
    
    .control-panel {
        padding: var(--spacing-md);
    }
    
    .slider-container {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-sm);
    }
    
    .slider-value {
        text-align: center;
    }
    
    .summary-card {
        flex-direction: column;
        text-align: center;
    }
    
    .card-icon {
        margin-bottom: var(--spacing-sm);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.slider:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .control-panel,
    .action-buttons {
        display: none;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .tables-section {
        grid-template-columns: 1fr;
    }
}
