/* ═══════════════════════════════════════════════════════════════
   EMI CALCULATOR - NEW COMPACT DESIGN
   Aadhya Financial Consultancy Branding
   100% Complete | Unabridged | No Shortcuts
═══════════════════════════════════════════════════════════════ */

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

body {
    font-family: 'Poppins', sans-serif;
    background: #F0F4F8;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   CALCULATOR WRAPPER - FIXED ALIGNMENT
═══════════════════════════════════════════════════════════════ */

.calculator-wrapper {
    max-width: 1200px;
    margin-top: 0;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    padding-top: 20px;
    padding-right: 20px;
    padding-bottom: 40px;
    padding-left: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   AMORTIZATION SECTION - REMOVE BOTTOM GAP
═══════════════════════════════════════════════════════════════ */

.amortization-section {
    background: white;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(10, 78, 118, 0.1);
}

.amort-footer {
    padding-top: 15px;
    padding-right: 25px;
    padding-bottom: 15px;
    padding-left: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #E0E0E0;
    background: white;
}

/* ═══════════════════════════════════════════════════════════════
   CALCULATOR HEADER - DARK BLUE BAR
═══════════════════════════════════════════════════════════════ */

.calc-header {
    background: #0A4E76;
    padding-top: 18px;
    padding-right: 25px;
    padding-bottom: 18px;
    padding-left: 25px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-header h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-buttons {
    display: flex;
    gap: 12px;
}

.btn-prepayment {
    background: #2BAE66;
    color: white;
    border: none;
    padding-top: 10px;
    padding-right: 20px;
    padding-bottom: 10px;
    padding-left: 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
    font-family: 'Poppins', sans-serif;
}

.btn-prepayment:hover {
    background: #239B56;
    transform: translateY(-2px);
}

.btn-compare {
    background: transparent;
    color: white;
    border-width: 2px;
    border-style: solid;
    border-color: white;
    padding-top: 10px;
    padding-right: 20px;
    padding-bottom: 10px;
    padding-left: 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
    font-family: 'Poppins', sans-serif;
}

.btn-compare:hover {
    background: white;
    color: #0A4E76;
}

.btn-transfer {
    background: #D4A843;
    color: white;
    border: none;
    padding-top: 10px;
    padding-right: 20px;
    padding-bottom: 10px;
    padding-left: 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
    font-family: 'Poppins', sans-serif;
}

.btn-transfer:hover {
    background: #B8922E;
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CALCULATOR BODY
═══════════════════════════════════════════════════════════════ */

.calc-body {
    background: white;
    padding-top: 30px;
    padding-right: 30px;
    padding-bottom: 30px;
    padding-left: 30px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

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

/* ═══════════════════════════════════════════════════════════════
   LEFT COLUMN - LOAN DETAILS & RESULTS
═══════════════════════════════════════════════════════════════ */

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

/* Loan Details Section */
.loan-details-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 20px;
    margin-left: 0;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 15px;
    margin-left: 0;
}

.input-field {
    position: relative;
}

.input-field input {
    width: 100%;
    padding-top: 14px;
    padding-right: 45px;
    padding-bottom: 14px;
    padding-left: 14px;
    border-width: 1px;
    border-style: solid;
    border-color: #E0E0E0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background: white;
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

.input-field input:focus {
    outline: none;
    border-color: #00B5C9;
    box-shadow: 0 0 0 3px rgba(0, 181, 201, 0.1);
}

.input-field input::placeholder {
    color: #999;
}

.input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 0.875rem;
    pointer-events: none;
}

.input-field select {
    width: 100%;
    padding-top: 14px;
    padding-right: 40px;
    padding-bottom: 14px;
    padding-left: 14px;
    border-width: 1px;
    border-style: solid;
    border-color: #E0E0E0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    color: #333;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

.input-field select:focus {
    outline: none;
    border-color: #00B5C9;
    box-shadow: 0 0 0 3px rgba(0, 181, 201, 0.1);
}

.btn-calculate {
    background: #00B5C9;
    color: white;
    border: none;
    padding-top: 14px;
    padding-right: 30px;
    padding-bottom: 14px;
    padding-left: 30px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(0, 181, 201, 0.3);
}

.btn-calculate:hover {
    background: #0A4E76;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 78, 118, 0.4);
}

.calculate-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 5px;
}

/* Result Summary Section */
.result-summary-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 20px;
    margin-left: 0;
}

.result-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.result-card {
    padding-top: 20px;
    padding-right: 15px;
    padding-bottom: 20px;
    padding-left: 15px;
    border-radius: 10px;
    text-align: center;
    border-width: 2px;
    border-style: solid;
    border-color: transparent;
    background: #F8F9FA;
}

.result-card.emi-card {
    border-color: #0A4E76;
    background: white;
}

.result-card .amount {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 5px;
    margin-left: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.result-card .amount .symbol {
    font-size: 1rem;
    font-weight: 600;
}

.result-card.emi-card .amount {
    color: #0A4E76;
}

.result-card.interest-card .amount {
    color: #D4A843;
}

.result-card.total-card .amount {
    color: #00B5C9;
}

.result-card .label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   RIGHT COLUMN - LOAN BREAKDOWN CHART
═══════════════════════════════════════════════════════════════ */

.right-column {
    display: flex;
    flex-direction: column;
}

.loan-breakdown-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 20px;
    margin-left: 0;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-center-text {
    position: absolute;
    text-align: center;
    pointer-events: none;
}

.chart-center-text .label {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 5px;
    margin-left: 0;
}

.chart-center-text .value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0A4E76;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #333;
    font-weight: 500;
}

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

.legend-color.principal {
    background: #0A4E76;
}

.legend-color.interest {
    background: #D4A843;
}

/* ═══════════════════════════════════════════════════════════════
   AMORTIZATION SCHEDULE SECTION
═══════════════════════════════════════════════════════════════ */

.amort-header {
    background: #0A4E76;
    padding-top: 15px;
    padding-right: 25px;
    padding-bottom: 15px;
    padding-left: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.amort-header h2 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
}

.amort-header .close-btn {
    color: white;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
    transition-property: opacity;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

.amort-header .close-btn:hover {
    opacity: 1;
}

.table-container {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: auto;
}

.amort-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.amort-table thead {
    background: #E8EDF2;
    position: sticky;
    top: 0;
    z-index: 10;
}

.amort-table th {
    padding-top: 12px;
    padding-right: 15px;
    padding-bottom: 12px;
    padding-left: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 0.8rem;
    white-space: nowrap;
}

.amort-table td {
    padding-top: 10px;
    padding-right: 15px;
    padding-bottom: 10px;
    padding-left: 15px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #F0F0F0;
    color: #333;
}

.amort-table tbody tr:hover {
    background: #F8F9FA;
}

.amort-table tbody tr:nth-child(even) {
    background: #FAFAFA;
}

.amort-table tbody tr:nth-child(even):hover {
    background: #F0F4F8;
}

/* Footer with Download Button */

.btn-download {
    background: #FFB800;
    color: #333;
    border: none;
    padding-top: 10px;
    padding-right: 20px;
    padding-bottom: 10px;
    padding-left: 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
    font-family: 'Poppins', sans-serif;
}

.btn-download:hover {
    background: #E5A600;
    transform: translateY(-2px);
}

.pagination {
    display: flex;
    gap: 8px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border-width: 1px;
    border-style: solid;
    border-color: #E0E0E0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: #333;
    transition-property: all;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

.page-btn:hover {
    border-color: #00B5C9;
    color: #00B5C9;
}

.page-btn.active {
    background: #00B5C9;
    border-color: #00B5C9;
    color: white;
}



/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .calc-main-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .chart-wrapper {
        height: 250px;
    }
}

@media (max-width: 768px) {
    .calculator-wrapper {
        padding-top: 10px;
        padding-right: 10px;
        padding-bottom: 10px;
        padding-left: 10px;
    }

    .calc-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .calc-header h1 {
        font-size: 1.25rem;
    }

    .header-buttons {
        width: 100%;
        justify-content: center;
    }

    .calc-body {
        padding-top: 20px;
        padding-right: 15px;
        padding-bottom: 20px;
        padding-left: 15px;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .result-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .result-card .amount {
        font-size: 1.25rem;
    }

    .chart-wrapper {
        height: 220px;
    }

    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .amort-header {
        padding-top: 12px;
        padding-right: 15px;
        padding-bottom: 12px;
        padding-left: 15px;
    }

    .amort-footer {
        flex-direction: column;
        gap: 15px;
    }

    .btn-download {
        width: 100%;
        text-align: center;
    }

    .pagination {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .calc-header h1 {
        font-size: 1.125rem;
    }

    .btn-prepayment {
        padding-top: 8px;
        padding-right: 15px;
        padding-bottom: 8px;
        padding-left: 15px;
        font-size: 0.8rem;
    }

    .btn-compare {
        padding-top: 8px;
        padding-right: 15px;
        padding-bottom: 8px;
        padding-left: 15px;
        font-size: 0.8rem;
    }

    .loan-details-section h2 {
        font-size: 1.125rem;
    }

    .result-summary-section h2 {
        font-size: 1.125rem;
    }

    .loan-breakdown-section h2 {
        font-size: 1.125rem;
    }

    .result-card .amount {
        font-size: 1.125rem;
    }

    .chart-center-text .value {
        font-size: 1.25rem;
    }

    .amort-table {
        font-size: 0.75rem;
    }

    .amort-table th {
        padding-top: 8px;
        padding-right: 10px;
        padding-bottom: 8px;
        padding-left: 10px;
    }

    .amort-table td {
        padding-top: 8px;
        padding-right: 10px;
        padding-bottom: 8px;
        padding-left: 10px;
    }
}