/**
 * Kalkulator KPR Modern - Stylesheet
 * Styling untuk tampilan modern, responsif, dan user-friendly
 */

/* Reset dan base styling */
.kalkulator-kpr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #667eea;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Header styling */
.kalkulator-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.kalkulator-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: white;
}

.kalkulator-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    color: rgba(255,255,255,0.9);
}

/* Content layout */
.kalkulator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Input section styling */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.input-group label {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.input-group input[type="number"] {
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Slider styling */
.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e1e8ed;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #5a6fd8;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-value {
    min-width: 80px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
    background: #f0f3ff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Result section styling */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    background: #667eea;
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.result-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0.9;
}

.result-card .amount {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}



/* Select styling */
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #2c3e50;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Currency input styling */
.currency-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* Chart container */
.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-height: 100%;
    max-width: 100%;
}

/* Detail Angsuran */
.detail-angsuran {
    background: white;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
    margin-top: 20px;
}

.detail-angsuran h3 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.detail-label {
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.detail-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    text-align: right;
}

/* Responsive design */
@media (max-width: 768px) {
    .kalkulator-kpr-container {
        margin: 10px;
        padding: 15px;
    }
    
    .kalkulator-header h2 {
        font-size: 2rem;
    }
    
    .kalkulator-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .result-card .amount {
        font-size: 1.8rem;
    }
    
    .slider-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .slider-value {
        text-align: center;
        min-width: auto;
    }
    
    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .kalkulator-header h2 {
        font-size: 1.5rem;
    }
    
    .kalkulator-header p {
        font-size: 1rem;
    }
    
    .result-card {
        padding: 20px;
    }
    
    .result-card .amount {
        font-size: 1.5rem;
    }
    

    
    .chart-container {
        height: 200px;
        padding: 15px;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation untuk smooth transitions */
.result-card,
.result-details,
.chart-container {
    transition: all 0.3s ease;
}

/* Hover effects */
.input-group input[type="number"]:hover {
    border-color: #c3d0e8;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* Button styling */
.calculate-btn {
    background: #764ba2;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.calculate-btn:hover {
    background: #6a4190;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

.toggle-btn {
    background: #764ba2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #6a4190;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

/* Table styling */
.angsuran-table th {
    background: #667eea;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Custom scrollbar untuk webkit browsers */
.kalkulator-kpr-container::-webkit-scrollbar {
    width: 8px;
}

.kalkulator-kpr-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.kalkulator-kpr-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.kalkulator-kpr-container::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}