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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

main {
    padding: 40px;
}

section {
    margin-bottom: 40px;
}

h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 25px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

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

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

.input-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

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

.input-group input:hover {
    border-color: #bdc3c7;
}

.calculate-btn, .reset-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.calculate-btn:hover, .reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.calculate-btn:active, .reset-btn:active {
    transform: translateY(0);
}

.reset-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    margin-top: 20px;
}

.reset-btn:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.export-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.export-btn:active {
    transform: translateY(0);
}

.result-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #dee2e6;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.result-value {
    font-weight: 700;
    color: #27ae60;
    font-size: 1.2rem;
}

.final-result {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    margin: 20px -30px -30px -30px;
    padding: 25px 30px;
    border-radius: 0 0 12px 12px;
}

.final-result .result-label,
.final-result .result-value {
    color: white;
    font-size: 1.3rem;
}

.calculation-breakdown {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
}

.calculation-breakdown h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.breakdown-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.breakdown-step {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.breakdown-step:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.step-number {
    background: #3498db;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.step-description {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.step-value {
    font-weight: 700;
    color: #27ae60;
    font-size: 1.1rem;
    margin-left: 10px;
}

.step-formula {
    font-weight: 700;
    color: #e67e22;
    font-size: 1rem;
    margin-left: 10px;
    font-family: 'Courier New', monospace;
}

.step-explanation {
    font-weight: 600;
    color: #e74c3c;
    font-size: 0.95rem;
    margin-left: 10px;
    font-style: italic;
}

.final-calculation {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    border-left-color: #27ae60;
}

.final-calculation .step-number {
    background: white;
    color: #27ae60;
}

.final-calculation .step-description,
.final-calculation .step-value {
    color: white;
    font-size: 1.2rem;
}

.no-tax-explanation {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-left-color: #e74c3c;
}

.no-tax-explanation .step-number {
    background: white;
    color: #e74c3c;
}

.no-tax-explanation .step-description,
.no-tax-explanation .step-explanation {
    color: white;
}

footer {
    background: #34495e;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 30px 20px;
    }
    
    .monthly-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-value {
        align-self: flex-end;
    }
}

/* Animation for result section */
.result-section {
    animation: slideIn 0.5s ease-out;
}

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

/* Input number styling */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

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

/* Success message styling */
.success-message {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 600;
    display: none;
    animation: successSlideIn 0.5s ease-out;
}

@keyframes successSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}