* {
    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;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calculator-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.calculator-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculator-title {
    font-size: 2rem;
    color: #2d3748;
    text-align: center;
    padding: 30px 20px 10px;
    font-weight: 700;
}

.calculator-subtitle {
    text-align: center;
    color: #718096;
    font-size: 1rem;
    padding-bottom: 30px;
}

.calculator-content {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* Input Section */
.input-section {
    padding: 20px;
}

.input-group {
    margin-bottom: 35px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-prefix,
.input-suffix {
    color: #718096;
    font-weight: 600;
    font-size: 1rem;
}

.input-prefix {
    margin-right: 8px;
}

.input-suffix {
    margin-left: 8px;
}

.input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    outline: none;
}

.input-wrapper input::-webkit-outer-spin-button,
.input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-wrapper input[type=number] {
    -moz-appearance: textfield;
}

/* Slider */
.slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e2e8f0;
    outline: none;
    margin-top: 15px;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #a0aec0;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 30px;
    border-radius: 15px;
}

.result-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.emi-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 8px;
}

.emi-card .result-label {
    opacity: 0.95;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
}

/* Chart */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Breakdown */
.breakdown {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #4a5568;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.color-dot.principal {
    background: #667eea;
}

.color-dot.interest {
    background: #f56565;
}

.breakdown-value {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .calculator-title {
        font-size: 1.5rem;
        padding: 20px 15px 10px;
    }

    .calculator-subtitle {
        font-size: 0.9rem;
        padding-bottom: 20px;
    }

    .calculator-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }

    .input-section {
        padding: 10px;
    }

    .input-group {
        margin-bottom: 25px;
    }

    .input-wrapper {
        padding: 10px 12px;
    }

    .input-wrapper input {
        font-size: 1rem;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .calculate-btn {
        padding: 14px;
        font-size: 1rem;
    }

    .results-section {
        padding: 20px;
    }

    .result-card {
        padding: 16px;
    }

    .chart-container {
        padding: 15px;
    }

    .breakdown {
        padding: 15px;
    }

    .breakdown-value {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .calculator-title {
        font-size: 1.3rem;
    }

    .calculator-subtitle {
        font-size: 0.85rem;
    }

    .input-group label {
        font-size: 0.9rem;
    }

    .result-icon {
        font-size: 1.5rem;
    }

    .result-label {
        font-size: 0.85rem;
    }

    .result-value {
        font-size: 1.3rem;
    }

    .breakdown-label {
        font-size: 0.85rem;
    }

    .breakdown-value {
        font-size: 0.95rem;
    }
}