/**
 * Loan Calculator Page Styles
 * Fully responsive design with mobile-first approach
 * Breakpoints: mobile ≤767px, tablet 768px-1199px, desktop ≥1200px
 * All measurements in px units as requested
 */

/* ===================================
   CONTAINER AND LAYOUT
   =================================== */
   .calc-container {
    width: 100%;
    min-height: 100vh;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.calc-card {
    width: 100%;
    max-width: 1648px;
    background-color: var(--color-white);
    border-radius: 24px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ===================================
   HEADER SECTION
   =================================== */
.calc-header {
    width: 100%;
}

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

.calc-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.calc-title {
    font-family: var(--font-heading);
    font-size: 24px;
    line-height: 32px;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin: 0;
    flex: 1;
}

.close-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.1);
}

.close-btn:active {
    transform: scale(0.95);
}

/* ===================================
   BEDROOM SELECTION SECTION
   =================================== */
.bedroom-selection {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.selection-title {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 24px;
    line-height: 32px;
    font-weight: var(--font-weight-bold);
    color: #141414;
    text-align: center;
    margin: 0;
}

.bedroom-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 21px;
    flex-wrap: wrap;
    width: 100%;
}

.bedroom-btn {
    width: 220px;
    height: 160px;
    border: 2px solid #898989;
    border-radius: 8px;
    background-color: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 10px;
    transition: all 0.3s ease;
    color: #141414;
}

.bedroom-btn:hover {
    border-color: var(--color-secondary-100);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(163, 126, 44, 0.2);
}

.bedroom-btn.active {
    background-color: var(--color-secondary-100);
    border-color: #898989;
    color: var(--color-white);
}

.bedroom-btn.text-btn {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 24px;
    line-height: 32px;
    font-weight: var(--font-weight-bold);
}

.bedroom-btn span {
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    line-height: 28px;
    font-weight: var(--font-weight-normal);
    text-align: center;
}

.bed-icons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.bed-icons.three-beds,
.bed-icons.four-beds {
    flex-direction: column;
    gap: 8px;
}

.bed-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bedroom-btn svg {
    width: 32px;
    height: 32px;
}

/* ===================================
   CALCULATOR CONTENT SECTION
   =================================== */
.calc-content {
    width: 100%;
    display: flex;
    gap: 98px;
    align-items: flex-start;
    margin-top: 80px;
}

/* ===================================
   FORM SECTION (LEFT SIDE)
   =================================== */
.calc-form {
    width: 384px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-field label {
    font-family: 'Roboto', sans-serif;
    font-size: 20px;
    line-height: 28px;
    font-weight: var(--font-weight-normal);
    color: #141414;
}

.input-wrapper {
    position: relative;
    width: 100%;
    height: 40px;
    border: 1px solid #737373;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 12px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 24px;
    color: #141414;
    outline: none;
}

.input-wrapper input::placeholder {
    color: #d2d2d2;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: 2px solid var(--color-primary-100);
    outline-offset: -1px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding-right: 36px;
    color: #d2d2d2;
}

.dropdown-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 24px;
    height: 24px;
}

.calculate-btn {
    width: 100%;
    height: 40px;
    background-color: var(--color-black);
    color: #f1f3f4;
    border: 1px solid #737373;
    border-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 24px;
    font-weight: var(--font-weight-normal);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0px;
}

.calculate-btn:hover {
    background-color: #1a1a1a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* ===================================
   RESULTS TABLE SECTION (RIGHT SIDE)
   =================================== */
.calc-results {
    flex: 1;
    min-width: 0;
}

.results-table {
    width: 100%;
}

.table-header {
    height: 75px;
    background-color: #f0f0f0;
}



.table-cell {
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #cacaca;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 24px;
    line-height: 32px;
    font-weight: var(--font-weight-medium);
    text-align: center;
}

.header-cell {
    color: #141414;
}

.result-value {
    color: #dedcdc;
}

/* ===================================
   TABLET RESPONSIVE (768px - 1199px)
   =================================== */
@media (max-width: 1199px){

    .calc-content{
        flex-direction: column;
    }
    .calc-form {
        width: 100%;
    }

    .form-fields {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .calc-card {
        padding: 32px;
        gap: 32px;
    }

    .selection-title {
        font-size: 20px;
        line-height: 28px;
    }

    .bedroom-buttons {
        gap: 16px;
    }

    .bedroom-btn {
        width: 180px;
        height: 140px;
        gap: 12px;
    }

    .bedroom-btn.text-btn {
        font-size: 20px;
        line-height: 28px;
    }

    .bedroom-btn span {
        font-size: 18px;
        line-height: 24px;
    }

    .calc-content {
        gap: 48px;
    }

    

    .form-field label {
        font-size: 18px;
        line-height: 24px;
    }

    .table-cell {
        font-size: 20px;
        line-height: 28px;
        padding: 8px;
    }

    .table-cell:nth-child(1) { width: 100px; }
    .table-cell:nth-child(2) { width: 130px; }
    .table-cell:nth-child(3) { width: 170px; }
    .table-cell:nth-child(4) { width: 170px; }
    .table-cell:nth-child(5) { width: 120px; }
}

/* ===================================
   MOBILE RESPONSIVE (≤767px)
   =================================== */
@media (max-width: 767px) {
    

    .calc-card {
        padding: 24px;
        gap: 32px;
        border-radius: 16px;
    }

    /* Header */
    .header-content {
        gap: 12px;
    }

    .calc-icon {
        width: 40px;
        height: 40px;
    }

    .calc-title {
        font-size: 20px;
        line-height: 28px;
    }

    .close-btn {
        width: 40px;
        height: 40px;
    }

    /* Bedroom Selection */
    .bedroom-selection {
        gap: 32px;
    }

    .selection-title {
        font-size: 18px;
        line-height: 24px;
        padding: 0 16px;
    }

    .bedroom-buttons {
        flex-direction: row;
        gap: 12px;
        width: 100%;
        max-width: 450px;
    }
        

    
    .bedroom-btn {
        width: calc(50% - 6px);
    }
    
    
    .bedroom-btn:first-child {
        margin-top: 0;

        width: 100%;
        height: 120px;
        gap: 12px;
    }
    .calc-content{
        margin-top: 40px;
    }
    .form-fields{
        justify-content: center;
    }
    .bedroom-btn.text-btn {
        font-size: 18px;
        line-height: 24px;
    }

    .bedroom-btn span {
        font-size: 16px;
        line-height: 22px;
    }

    .bed-icons svg {
        width: 28px;
        height: 28px;
    }

    /* Calculator Content */
    .calc-content {
        flex-direction: column;
        gap: 40px;
    }

    .calc-form {
        width: 100%;
        gap: 40px;
    }

    .form-field label {
        font-size: 16px;
        line-height: 24px;
        margin-bottom: 0;
    }

    .input-wrapper {
        height: 44px;
    }

    .calculate-btn {
        height: 44px;
        font-size: 16px;
    }

    /* Results Table */
    .calc-results {
        width: 100%;
        overflow-x: auto;
    }

    .results-table {
        min-width: 600px;
    }

    .table-header {
        height: 60px;
    }

    .table-cell {
        font-size: 16px;
        line-height: 22px;
        padding: 6px 4px;
    }

    .table-cell:nth-child(1) { width: 80px; }
    .table-cell:nth-child(2) { width: 110px; }
    .table-cell:nth-child(3) { width: 140px; }
    .table-cell:nth-child(4) { width: 140px; }
    .table-cell:nth-child(5) { width: 100px; }
}

/* ===================================
   EXTRA SMALL MOBILE (≤480px)
   =================================== */
@media (max-width: 480px) {
    .modal-lg {
        max-width: calc(100% - 20px);
    }
    .modal-body {
        padding: 0 16px !important;
    }
    .calc-card {
        padding: 20px;
        gap: 24px;
    }

    .calc-title {
        font-size: 18px;
        line-height: 24px;
    }

    .selection-title {
        font-size: 20px;
        line-height: 24px;
    }
    .form-field{
        width: calc(100% - 40px);
    }
    .bedroom-btn:first-child {
        height: 48px;
    }
    .modal-header svg{
        width: 31px;
    }
    .bedroom-btn {
        height: 100px;
        border-radius: 4px;
    }

    .bedroom-btn.text-btn {
        font-size: 16px;
        line-height: 22px;
    }

    .bedroom-btn span {
        font-size: 14px;
        line-height: 20px;
    }

    .form-field label {
        font-size: 14px;
        line-height: 20px;
    }

    .input-wrapper input,
    .input-wrapper select {
        font-size: 14px;
    }

    .table-cell {
        font-size: 14px;
        line-height: 20px;
    }
}


/* High contrast mode support */
@media (prefers-contrast: high) {
    .bedroom-btn {
        border-width: 3px;
    }

    .table-cell {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bedroom-btn,
    .calculate-btn,
    .close-btn,
    .input-wrapper input,
    .input-wrapper select {
        transition: none;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {

    .calc-card {
        box-shadow: none;
        padding: 20px;
    }

    .close-btn,
    .calculate-btn {
        display: none;
    }

    .bedroom-selection,
    .calc-form {
        page-break-inside: avoid;
    }
}
