* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

nav {
    text-align: left;
    margin-bottom: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 0.8;
}

main {
    padding: 40px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.option-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.card-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.option-card h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.option-card p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1em;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s;
    margin-top: 20px;
}

.btn-secondary:hover {
    transform: scale(1.05);
    background: #5a6268;
}

.budget-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 30px;
}

.form-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.form-section input[type="number"] {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: border-color 0.3s;
}

.form-section input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.form-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.priority-slider {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.priority-slider label {
    display: block;
    margin-bottom: 10px;
}

.priority-slider input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.priority-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.priority-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.slider-value {
    display: inline-block;
    margin-left: 15px;
    font-weight: 600;
    color: #667eea;
    font-size: 1.1em;
}

.budget-info {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.button-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 20px;
}

.budget-info-button {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1.1em;
}

.budget-info-button span:first-child {
    font-weight: 600;
    color: #333;
}

.budget-status {
    font-weight: 600;
}

.budget-status.positive {
    color: #28a745;
}

.budget-status.negative {
    color: #dc3545;
}

.allocation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.allocation-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.allocation-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.allocation-item input {
    width: 100%;
}

.allocation-item input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.results-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.chart-wrapper {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.chart-wrapper h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    text-align: center;
    font-weight: 600;
}

.chart-wrapper canvas {
    max-height: 300px;
}

.results-section h2 {
    margin-bottom: 25px;
    color: #333;
    text-align: center;
}

.summary-total-header {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    text-align: center;
}

.summary-total-header h2 {
    margin-bottom: 8px;
    color: white;
    font-size: 1.4em;
}

.total-budget-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
}

.total-label {
    opacity: 0.9;
}

.total-amount {
    font-size: 1.5em;
    font-weight: 700;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.result-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #667eea;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-card h3 {
    color: #333;
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
}

.card-percentage {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.result-card .amount {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.summary-grid .summary-total-header {
    grid-column: 1 / -1;
}

.summary-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #667eea;
}

.summary-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

.summary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.summary-item-name {
    font-weight: 600;
    font-size: 0.95em;
    color: #333;
}

.summary-item-name.savings-highlight {
    color: #28a745;
    font-weight: 700;
}

.summary-item-percentage {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.summary-item-amount {
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.summary-item .progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.summary-item .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.summary-item .progress-bar.savings-bar {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.summary-total {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-size: 1.2em;
    margin-top: 15px;
    font-weight: 600;
}

footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #666;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

