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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.header p {
    color: #6c757d;
    font-size: 1.1rem;
}

.main-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
    font-size: 1.3rem;
}

.card-header p {
    color: #6c757d;
    margin-top: 5px;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.tab {
    padding: 15px 25px;
    cursor: pointer;
    border: none;
    background: none;
    color: #6c757d;
    font-size: 1rem;
    transition: all 0.3s;
}

.tab.active {
    color: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
    border-bottom: 3px solid linear-gradient(90deg, #004d6e 0%, #00accc 100%);
    background: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
    color: white;
    font-weight: bold;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

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

.form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
}

.slider-group {
    margin-top: 10px;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

.rate-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid linear-gradient(90deg, #004d6e 0%, #00accc 100%);
}

.rate-current {
    font-size: 1.1rem;
    font-weight: 600;
    color: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
}

.rate-guarantee {
    color: #28a745;
    font-size: 0.9rem;
    margin-top: 5px;
}

.rate-tiers {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 10px;
}

.rate-tiers div {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}

.results-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.monthly-payment {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 15px 0;
}

.payment-subtitle {
    color: #6c757d;
    margin-bottom: 25px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.detail-label {
    color: #6c757d;
}

.detail-value {
    font-weight: 600;
    color: #495057;
}

.loan-breakdown {
    margin-top: 20px;
}

.breakdown-chart {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.principal-bar {
    background: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
    flex: 98;
}

.interest-bar {
    background: #fd7e14;
    flex: 2;
}

.breakdown-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.9rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.btn-primary {
    background: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    width: 100%;
}

.btn-primary:hover {
    background: #00accc;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

tr:hover {
    background: #f8f9fa;
}

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

.comparison-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    position: relative;
}

.comparison-card.selected {
    border-color: linear-gradient(90deg, #004d6e 0%, #00accc 100%);
}

.comparison-card.recommended {
    border-color: #28a745;
}

.comparison-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.comparison-subtitle {
    color: #6c757d;
    margin-bottom: 15px;
}

.comparison-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.savings-badge {
    background: #d4edda;
    color: #155724;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.extra-cost-badge {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.eligibility-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.income-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.analysis-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.debt-ratio-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
    position: relative;
}

.debt-ratio-fill {
    height: 100%;
    background: linear-gradient(to right, #28a745 0%, #ffc107 33%, #dc3545 40%);
    width: 100%;
}

.debt-ratio-indicator {
    position: absolute;
    top: -5px;
    width: 2px;
    height: 30px;
    background: #000;
}

.ratio-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
}

.eligibility-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.eligible {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.not-eligible {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.approval-time {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid linear-gradient(90deg, #004d6e 0%, #00accc 100%);
    margin-top: 20px;
}

.start-application {
    text-align: center;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px; /* Reduce padding for more screen space */
    }

    .header h1 {
        font-size: 1.8rem; /* Reduce header font size */
    }

    .header p {
        font-size: 0.9rem; /* Smaller subtitle font */
    }

    .main-card {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Softer shadow for mobile */
    }

    .card-header {
        padding: 15px; /* Reduce padding */
    }

    .card-header h2 {
        font-size: 1.1rem; /* Smaller header */
    }

    .tabs {
        flex-wrap: wrap; /* Allow tabs to wrap if needed */
    }

    .tab {
        padding: 10px 15px; /* Reduce tab padding */
        font-size: 0.9rem; /* Smaller font for tabs */
    }

    .tab-content {
        padding: 15px; /* Reduce padding in tab content */
    }

    .calculator-grid {
        grid-template-columns: 1fr; /* Already single column, kept for clarity */
        gap: 15px; /* Reduce gap between sections */
    }

    .form-group {
        gap: 5px; /* Tighter spacing for form elements */
    }

    .form-group label {
        font-size: 0.9rem; /* Smaller labels */
    }

    .form-group input,
    .form-group select {
        padding: 8px 12px; /* Reduce input padding */
        font-size: 0.9rem; /* Smaller input text */
    }

    .slider-group {
        margin-top: 5px; /* Reduce margin */
    }

    .slider-labels {
        font-size: 0.75rem; /* Smaller slider labels */
    }

    .rate-info {
        padding: 10px; /* Reduce padding */
        font-size: 0.8rem; /* Smaller text in rate info */
    }

    .rate-current {
        font-size: 1rem; /* Smaller rate display */
    }

    .results-section {
        padding: 15px; /* Reduce padding */
    }

    .monthly-payment {
        font-size: 1.8rem; /* Reduce font size for monthly payment */
    }

    .payment-subtitle {
        font-size: 0.85rem; /* Smaller subtitle */
    }

    .details-grid {
        grid-template-columns: 1fr; /* Already single column, kept for clarity */
        gap: 10px; /* Reduce gap between details */
    }

    .detail-item {
        padding: 5px 0; /* Reduce padding */
        font-size: 0.9rem; /* Smaller text */
    }

    .loan-breakdown {
        margin-top: 10px; /* Reduce margin */
    }

    .breakdown-legend {
        font-size: 0.85rem; /* Smaller legend text */
        gap: 10px; /* Reduce gap between legend items */
    }

    .btn-primary {
        padding: 10px 20px; /* Reduce button padding */
        font-size: 0.9rem; /* Smaller button text */
    }

    .btn-secondary {
        padding: 8px 15px; /* Reduce secondary button padding */
        font-size: 0.85rem; /* Smaller text */
    }

    .table-container {
        font-size: 0.85rem; /* Smaller table text */
    }

    th,
    td {
        padding: 8px; /* Reduce table cell padding */
    }

    .comparison-grid {
        grid-template-columns: 1fr; /* Already single column, kept for clarity */
        gap: 15px; /* Reduce gap between cards */
    }

    .comparison-card {
        padding: 15px; /* Reduce card padding */
    }

    .comparison-title {
        font-size: 1.1rem; /* Smaller title */
    }

    .comparison-subtitle {
        font-size: 0.85rem; /* Smaller subtitle */
    }

    .comparison-details {
        gap: 8px; /* Reduce gap between details */
        font-size: 0.9rem; /* Smaller text */
    }

    .savings-badge,
    .extra-cost-badge {
        padding: 6px 10px; /* Reduce badge padding */
        font-size: 0.8rem; /* Smaller badge text */
    }

    .eligibility-grid {
        grid-template-columns: 1fr; /* Already single column, kept for clarity */
        gap: 15px; /* Reduce gap */
    }

    .income-section,
    .analysis-section {
        padding: 15px; /* Reduce padding */
    }

    .debt-ratio-bar {
        height: 15px; /* Smaller bar height */
    }

    .ratio-labels {
        font-size: 0.75rem; /* Smaller labels */
    }

    .eligibility-status {
        padding: 10px; /* Reduce padding */
        font-size: 0.9rem; /* Smaller text */
    }

    .approval-time {
        padding: 10px; /* Reduce padding */
        font-size: 0.9rem; /* Smaller text */
    }

    .start-application {
        margin-top: 20px; /* Reduce margin */
    }
}
