/* Savings Calculator Styles */
.savings-calculator-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.calculator-header h3 {
    color: #2c3e50;
    font-size: 28px;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.calculator-description {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

.calculator-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid rgb(255, 219, 1);
}

.section-title {
    color: #2c3e50;
    font-size: 20px;
    margin: 0 0 20px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 500;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 14px;
}

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

.input-wrapper input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.currency {
    position: absolute;
    right: 16px;
    color: #7f8c8d;
    font-weight: 500;
    pointer-events: none;
}

.calculator-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.calculate-btn, .reset-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.calculate-btn {
    border-radius: 47px;
    color: var(--e-global-color-primary);
    background-color: var(--e-global-color-165ad66);
    border-color: var(--e-global-color-165ad66);
}

.reset-btn {
    border-radius: 47px;
    color: var(--e-global-color-primary);
    background-color: var(--e-global-color-165ad66);
    border-color: var(--e-global-color-165ad66);
}
.calculate-btn:hover, .reset-btn:hover {
    color: var(--e-global-color-primary);
    background: rgb(255, 219, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 219, 1, 0.3);
}

.calculator-results {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid rgb(255, 219, 1);
}

.results-title {
    color: #34495e;
    font-size: 22px;
    margin: 0 0 25px 0;
    font-weight: 600;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-item {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-item.highlight {
    background: rgba(46, 204, 113, 0.2);
    border: 2px solid rgba(46, 204, 113, 0.5);
}

.result-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.result-percentage {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 600;
}

.savings-chart {
    margin: 30px 0;
}

.chart-bar {
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    margin-bottom: 15px;
}

.chart-segment {
    height: 100%;
    transition: width 0.8s ease;
}

.chart-segment.expenses {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.chart-segment.savings {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.expenses {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.legend-color.savings {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.savings-advice {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid #f39c12;
}

.advice-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 16px;
}

.advice-text {
    line-height: 1.6;
    opacity: 0.95;
}

.calculator-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e8ed;
    border-left: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .savings-calculator-container {
        padding: 15px;
        margin: 10px;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .calculator-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .calculate-btn, .reset-btn {
        width: 100%;
        max-width: 280px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .calculator-header h3 {
        font-size: 24px;
    }
    
    .calculator-description {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .input-wrapper input {
        padding: 10px 50px 10px 14px;
        font-size: 14px;
    }
    
    .result-value {
        font-size: 20px;
    }
}
