:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-main: #f5f5f5;
    --text-muted: #a0a0a0;
    --accent-color: #FF0000;
    --accent-hover: #e60000;
    --border-color: #333;
    --success-color: #2e7d32;
    --error-color: #d32f2f;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.card h2 i {
    color: var(--accent-color);
    width: 20px;
    height: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

input[type="number"], select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
    appearance: none;
}

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.2);
}

.select-wrapper {
    position: relative;
}

.select-wrapper i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Toggle Switch Styles */
.toggle-group {
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    cursor: pointer;
}

.toggle-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-text strong {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.toggle-text small {
    font-size: 12px;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Results Section */
.result-section {
    background: linear-gradient(145deg, #1e1e1e 0%, #171717 100%);
    border: 1px solid rgba(255, 0, 0, 0.1);
}

.breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
}

.breakdown-item span:last-child {
    color: var(--text-main);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.breakdown-item.total {
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 18px;
    color: var(--text-main);
    font-weight: 700;
}

.breakdown-item.total span:last-child {
    color: var(--accent-color);
}

.info-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 4px;
    cursor: help;
}

/* Savings Indicator */
.savings-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    margin-top: 20px;
    animation: fadeIn 0.5s ease-out;
}

.savings-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.savings-icon.positive {
    background: rgba(46, 125, 50, 0.2);
    color: var(--success-color);
}

.savings-icon.negative {
    background: rgba(211, 47, 47, 0.2);
    color: var(--error-color);
}

.savings-details {
    flex: 1;
}

.savings-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.savings-value {
    font-size: 20px;
    font-weight: 700;
}

.savings-icon.positive + .savings-details .savings-value {
    color: var(--success-color);
}
.savings-icon.negative + .savings-details .savings-value {
    color: var(--error-color);
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

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

/* Disabled states */
.disabled {
    opacity: 0.5;
    pointer-events: none;
}
