:root {
    --primary: #D97706;
    --primary-hover: #b45309;
    --secondary: #FBBF24;
    --accent: #FEF3C7;
    --background: #1A1400;
    --background-card: #2c2505;
    --text: #ffffff;
    --text-muted: #d1d5db;
    --surface: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.2s ease-in-out;
}

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

body {
    background-color: var(--background);
    color: var(--text);
    font-family: var(--font-family);
    line-height: 1.5;
    min-height: 100vh;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent);
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.currency-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.currency-selector select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
}

/* Main Layout */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    main {
        grid-template-columns: 1.5fr 1fr;
    }
}

/* Cards */
.card {
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--secondary);
}

/* Inputs */
.input-group {
    margin-bottom: 1rem;
}

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

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.add-expense-container {
    margin-bottom: 1rem;
}

#add-expense-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

#add-expense-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text);
    border-color: var(--text);
}

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

/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

/* Results */
.results-column {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.results-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid var(--secondary);
}

.primary-result {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem 0;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.primary-result .label {
    display: block;
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-result .value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.secondary-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-item {
    background: rgba(255,255,255,0.03);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.result-item .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.result-item .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.annual-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(217, 119, 6, 0.1);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.annual-result .label {
    font-weight: 500;
}

.annual-result .value {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
}

/* Breakdown Bar */
.breakdown-bar {
    display: flex;
    height: 12px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.bar-segment {
    height: 100%;
    transition: width 0.5s ease-out;
}

.bar-segment.expenses { background-color: #ef4444; }
.bar-segment.tax { background-color: #f59e0b; }
.bar-segment.income { background-color: #10b981; }
.bar-segment.profit { background-color: var(--primary); }

.breakdown-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    justify-content: center;
}

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

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.expenses { background-color: #ef4444; }
.dot.tax { background-color: #f59e0b; }
.dot.income { background-color: #10b981; }
.dot.profit { background-color: var(--primary); }

/* Scenario Section */
.scenario-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.scenario-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.scenario-controls input {
    flex: 1;
}

.scenario-list-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scenario-list-container select {
    flex: 1;
}

.danger-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.75rem;
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Expense List Dynamic Items */
.expense-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.expense-item input[type="text"] {
    flex: 2;
}

.expense-item input[type="number"] {
    flex: 1;
}

.remove-expense-btn {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem;
    font-size: 1.25rem;
}

.remove-expense-btn:hover {
    color: #ef4444;
    background: transparent;
    transform: none;
}
