/* ===== BASE RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tahoma', 'Segoe UI', Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, #1a237e, #0d47a1);
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
}

.header h1 i {
    margin-left: 12px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.85;
    margin-top: 5px;
}

/* ===== CARDS ===== */
.calculator-card,
.info-card {
    background: white;
    border-radius: 16px;
    padding: 25px 30px;
    margin: 25px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ===== INPUT SECTION ===== */
.input-section .form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #555;
}

.form-group label i {
    margin-left: 8px;
    color: #0d47a1;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border 0.3s, box-shadow 0.3s;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #0d47a1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.15);
    background: white;
}

.form-group .hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #888;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ===== SECTION TITLE ===== */
.section-title {
    font-weight: 700;
    color: #0d47a1;
    margin: 18px 0 10px 0;
    font-size: 1.05rem;
    border-bottom: 2px dashed #e0e0e0;
    padding-bottom: 6px;
}

.section-title i {
    margin-left: 10px;
}

/* ===== MODE INDICATOR ===== */
.mode-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 10px;
    margin: 15px 0 20px 0;
    font-weight: 600;
}

.mode-badge {
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.from-mode {
    background: #e3f2fd;
    color: #0d47a1;
}

.to-mode {
    background: #e8f5e9;
    color: #1b5e20;
}

.mode-indicator i {
    color: #999;
    font-size: 1.2rem;
}

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 71, 161, 0.3);
}

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

.btn-sm {
    padding: 6px 14px;
    background: #e8eaf6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-sm:hover {
    background: #c5cae9;
}

.btn-danger {
    padding: 6px 14px;
    background: #ffebee;
    color: #c62828;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #ffcdd2;
}

/* ===== RESULT SECTION ===== */
.result-section {
    background: #e8f5e9;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border-right: 5px solid #2e7d32;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h2 {
    font-size: 1.2rem;
    color: #1b5e20;
}

#resultContent {
    font-size: 1.1rem;
    line-height: 2;
    margin-top: 10px;
}

#resultContent .highlight {
    color: #c62828;
    font-weight: 700;
    font-size: 1.4rem;
}

#resultContent .result-detail {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

#resultContent .result-detail p {
    margin: 6px 0;
}

.result-detail .mode-info {
    background: #fff8e1;
    padding: 8px 14px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 0.95rem;
}

.result-detail .mode-info i {
    margin-left: 6px;
    color: #f57c00;
}

.placeholder {
    color: #999;
    font-style: italic;
}

/* ===== HISTORY ===== */
.history-section {
    margin-top: 25px;
}

.history-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #444;
}

.history-section h3 i {
    margin-left: 8px;
    color: #0d47a1;
}

#historyList {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.history-item .date {
    color: #888;
    font-size: 0.8rem;
}

.history-item .value {
    font-weight: 700;
    color: #0d47a1;
}

#clearHistoryBtn {
    margin-top: 10px;
}

/* ===== CHART ===== */
.chart-section {
    margin-top: 25px;
}

.chart-section h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #444;
}

.chart-section h3 i {
    margin-left: 8px;
    color: #0d47a1;
}

#inflationChart {
    max-height: 250px;
    width: 100%;
}

/* ===== INFO CARD ===== */
.info-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #444;
}

.info-card h3 i {
    margin-left: 8px;
    color: #0d47a1;
}

#dataInfo {
    font-size: 0.9rem;
    color: #666;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 8px;
}

/* ===== FOOTER ===== */
.footer {
    background: #1a237e;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .calculator-card,
    .info-card {
        padding: 18px;
    }

    .result-section {
        padding: 15px;
    }

    #resultContent {
        font-size: 1rem;
    }

    .mode-indicator {
        flex-wrap: wrap;
        gap: 8px;
    }
}