/* ================================
   Loan Calculator Styles
   ================================ */

:root {
    --primary-color: #007b40;
    --secondary-color: #e74c3c;
    --success-color: #27ae60;
    --info-color: #3498db;
    --warning-color: #f39c12;
    --danger-color: #c0392b;
    --light-bg: #f8f9fa;
    --border-color: #e0e6ed;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
}

.loan-calculator {
    padding: 60px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef2 100%);
    min-height: 100vh;
}

.calculator-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Card Styling ===== */
.calculator-card,
.breakdown-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.calculator-card:hover,
.breakdown-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
    background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
    color: white;
    padding: 0;
    border-bottom: none;
}

.calculator-card .card-header {
    background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
    padding: 40px;
    color: white;
}

.card-header h3.card-title {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.card-body {
    padding: 30px;
}

/* ===== Header Content ===== */
.header-content {
    padding: 0;
}

/* ===== Calculator Title ===== */
.calculator-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.calculator-title i {
    font-size: 36px;
}

.calculator-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 16px;
    margin: 0;
    font-weight: 400;
}

/* ===== Form Styling ===== */
.loan-form {
    margin-top: 0;
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #f0f2f5;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section.button-section {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.loan-form .form-group {
    margin-bottom: 0;
}

.loan-form .form-label {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.loan-form .form-label i {
    color: #007b40;
    font-size: 18px;
}

.loan-form .form-label span:nth-child(2) {
    flex: 1;
}

.required {
    color: #e74c3c;
    font-weight: 700;
}

.loan-form .form-control,
.loan-form .input-group-text,
.loan-form .form-select {
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.loan-form .form-control:focus,
.loan-form .form-select:focus {
    border-color: #007b40;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 64, 0.1);
    outline: none;
}

.loan-form .input-group-text {
    background-color: #f0f2f5;
    border-right: none;
    color: #7f8c8d;
    font-weight: 600;
}

.currency-badge {
    background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
    color: white;
    border: none !important;
    font-weight: 700;
    padding: 12px 18px !important;
    border-radius: 6px 0 0 6px;
}

.period-badge {
    background: #007b40;
    color: white;
    border: none !important;
    font-weight: 600;
    padding: 12px 18px !important;
    border-radius: 0 6px 6px 0;
}

.loan-form .input-group .form-control {
    border-left: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.form-hint {
    font-size: 13px;
    color: #7f8c8d !important;
    margin-top: 6px;
    display: block;
    font-style: italic;
}

.loan-form .form-label i {
    color: #007b40;
    font-size: 18px;
}

.required {
    color: #e74c3c;
    font-weight: 700;
}

.loan-form .form-control,
.loan-form .input-group-text,
.loan-form .form-select {
    border: 2px solid #e0e6ed;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.loan-form .form-control:focus,
.loan-form .form-select:focus {
    border-color: #007b40;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 64, 0.1);
    outline: none;
}

.loan-form .input-group-text {
    background-color: #f0f2f5;
    border-right: none;
    color: #7f8c8d;
    font-weight: 600;
}

.currency-badge {
    background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
    color: white;
    border: none !important;
    font-weight: 700;
    padding: 12px 18px !important;
}

.loan-form .input-group .form-control {
    border-left: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.form-text {
    font-size: 13px;
    color: #7f8c8d !important;
    margin-top: 5px;
    display: block;
}

/* ===== Button Styling ===== */
.btn-calculate {
    background: linear-gradient(135deg, #007b40 0%, #005a2e 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-calculate:hover {
    background: linear-gradient(135deg, #005a2e 0%, #003d1f 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 64, 0.3);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    border: none;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d 0%, #616770 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(127, 140, 141, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn i {
    font-size: 18px;
}

/* Breakdown Section */
.breakdown-section {
    animation: slideIn 0.6s ease-out;
}

.breakdown-title {
    color: #2c3e50;
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
}

.breakdown-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #3498db;
}

.breakdown-card:nth-child(2) {
    border-left-color: #e74c3c;
}

.breakdown-card:nth-child(3) {
    border-left-color: #f39c12;
}

.breakdown-subtitle {
    color: #34495e;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #ecf0f1;
    transition: all 0.3s ease;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item:hover {
    background-color: #f8f9fa;
    padding-left: 10px;
    padding-right: 10px;
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 4px;
}

.breakdown-item.highlight {
    background-color: #f0f8ff;
    padding: 16px;
    border-radius: 6px;
    border-bottom: none;
    margin-top: 10px;
}

.item-label {
    color: #2c3e50;
    font-weight: 500;
    font-size: 15px;
}

.item-value {
    color: #34495e;
    font-weight: 600;
    font-size: 16px;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calculator-title {
        font-size: 24px;
    }

    .calculator-card .card-header {
        padding: 25px;
    }

    .loan-form {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-section {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .form-hint {
        font-size: 12px;
    }

    .breakdown-title {
        font-size: 24px;
    }

    .breakdown-card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px 0;
    }

    .item-value {
        text-align: left;
        width: 100%;
    }

    .breakdown-item.highlight {
        padding: 12px;
    }

    .breakdown-subtitle {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .loan-calculator {
        padding: 30px 0;
    }

    .calculator-title {
        font-size: 20px;
    }

    .calculator-subtitle {
        font-size: 14px;
    }

    .loan-form {
        padding: 15px;
    }

    .form-section {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .btn-calculate {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Loading and Error States */
.form-control.is-invalid {
    border-color: #e74c3c;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.error-message i {
    font-size: 14px;
}

/* Animation for number changes */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.item-value {
    animation: pulse 0.3s ease-in-out;
}

/* Utility Classes */
.btn-block {
    width: 100% !important;
}

/* Print Styles */
@media print {
    .loan-form,
    #calculateBtn,
    #resetBtn {
        display: none;
    }

    .breakdown-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
