@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;1,500;1,600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* --- Outer Wrapper & Layout --- */
.cobba-calc-outer-container {
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #2f3930;
    box-sizing: border-box;
}

.cobba-calc-outer-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.cobba-calc-card {
    background: #ffffff;
    border-radius: 24px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(47, 57, 48, 0.08), 
                0 0 1px 1px rgba(47, 57, 48, 0.03);
    width: 100%;
}

/* --- Left Column: Inputs --- */
.cobba-calc-inputs {
    flex: 1.1;
    padding: 48px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cobba-calc-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8ca687;
    margin-bottom: 12px;
}

.cobba-calc-title {
    font-size: 32px;
    font-weight: 700;
    color: #2f3930;
    line-height: 1.25;
    margin-bottom: 12px;
}

.cobba-calc-title em {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 600;
    color: #9cb497;
}

.cobba-calc-subtitle {
    font-size: 14px;
    color: #6a7c6e;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Slider Rows */
.cobba-calc-row {
    margin-bottom: 28px;
}

.cobba-calc-row:last-of-type {
    margin-bottom: 8px;
}

.cobba-row-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.cobba-calc-label {
    font-size: 15px;
    font-weight: 600;
    color: #2f3930;
}

.cobba-row-value-container {
    font-size: 22px;
    font-weight: 700;
    color: #1a221b;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.cobba-val-prefix, .cobba-val-suffix {
    font-size: 15px;
    font-weight: 500;
    color: #6a7c6e;
}

.cobba-residual-dolls {
    font-size: 14px;
    font-weight: 500;
    color: #6a7c6e;
    margin-left: 6px;
}

/* Custom Slider CSS */
.cobba-slider-container {
    position: relative;
    width: 100%;
}

.cobba-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    outline: none;
    background: linear-gradient(to right, #9cb497 0%, #9cb497 var(--percent, 0%), #e3e8e4 var(--percent, 0%), #e3e8e4 100%);
    cursor: pointer;
    transition: background 0.1s ease;
}

/* Webkit Thumbs */
.cobba-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #9cb497;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.15s ease;
}

.cobba-range:hover::-webkit-slider-thumb {
    transform: scale(1.15);
    border-color: #8ca687;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* Firefox Thumbs */
.cobba-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #9cb497;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.15s ease;
}

.cobba-range:hover::-moz-range-thumb {
    transform: scale(1.15);
    border-color: #8ca687;
}

/* Min/Max Limits Row */
.cobba-row-limits {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #9ab09f;
}

/* --- Right Column: Results --- */
.cobba-calc-results {
    flex: 0.9;
    padding: 48px;
    background: linear-gradient(145deg, #242c25 0%, #151b16 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.cobba-results-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #a5bb9e;
    margin-bottom: 8px;
}

.cobba-results-frequency {
    font-size: 18px;
    font-weight: 500;
    color: #e3e8e4;
    margin-bottom: 12px;
}

.cobba-repayment-display-box {
    display: flex;
    align-items: baseline;
    margin-bottom: 24px;
}

.cobba-repayment-currency {
    color: #9cb497;
    font-size: 38px;
    font-weight: 700;
    margin-right: 4px;
    line-height: 1;
}

.cobba-repayment-val {
    font-size: 68px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.02em;
}

.cobba-repayment-suffix {
    font-size: 16px;
    font-weight: 500;
    color: #9ab09f;
    margin-left: 6px;
}

/* Grid for smaller repayments */
.cobba-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.cobba-grid-col {
    display: flex;
    flex-direction: column;
}

.cobba-grid-label {
    font-size: 12px;
    color: #9ab09f;
    margin-bottom: 4px;
    font-weight: 500;
}

.cobba-grid-val {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
}

.cobba-calc-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    width: 100%;
    margin-bottom: 28px;
}

/* Button Actions */
.cobba-actions-container {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.cobba-btn-primary {
    flex: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #9cb497;
    color: #1c241c;
    padding: 15px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(156, 180, 151, 0.15);
}

.cobba-btn-primary:hover {
    background: #aabf8e;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(156, 180, 151, 0.25);
    color: #121812;
}

.cobba-btn-primary svg {
    transition: transform 0.2s ease;
}

.cobba-btn-primary:hover svg {
    transform: translateX(4px);
}

.cobba-btn-secondary {
    flex: 0.8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 15px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, transform 0.15s;
}

.cobba-btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

/* Schedule Link */
.cobba-schedule-container {
    margin-bottom: 24px;
}

.cobba-schedule-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #a5bb9e;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
    background: none;
    border: none;
}

.cobba-schedule-link:hover {
    color: #ffffff;
}

.cobba-schedule-link svg {
    fill: currentColor;
}

/* Footnote */
.cobba-footnote {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.5;
}

/* --- Amortization Schedule Modal --- */
.cobba-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 18, 15, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
    padding: 20px;
}

.cobba-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.cobba-modal-content {
    background: #1a221b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    width: 100%;
    max-width: 780px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: #ffffff;
}

.cobba-modal.active .cobba-modal-content {
    transform: translateY(0) scale(1);
}

.cobba-modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cobba-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.cobba-modal-close {
    background: none;
    border: none;
    color: #9ab09f;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.cobba-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(90deg);
}

/* Modal Summary Header info */
.cobba-modal-summary-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cobba-modal-sum-item {
    display: flex;
    flex-direction: column;
}

.cobba-modal-sum-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #9ab09f;
    margin-bottom: 2px;
}

.cobba-modal-sum-val {
    font-size: 14px;
    font-weight: 700;
    color: #9cb497;
}

.cobba-modal-body {
    padding: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.cobba-modal-table-container {
    width: 100%;
}

.cobba-modal-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

.cobba-modal-table th {
    position: sticky;
    top: 0;
    background: #1a221b;
    z-index: 10;
    font-weight: 600;
    color: #a5bb9e;
    padding: 16px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cobba-modal-table td {
    padding: 12px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #e3e8e4;
}

.cobba-modal-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.cobba-modal-table tr.residual-payoff-row td {
    background: rgba(156, 180, 151, 0.06);
    border-top: 1px solid rgba(156, 180, 151, 0.15);
    border-bottom: 1px solid rgba(156, 180, 151, 0.15);
    color: #a5bb9e;
    font-weight: 700;
}

/* --- Responsive Layout Rules --- */
@media (max-width: 860px) {
    .cobba-calc-card {
        flex-direction: column;
        border-radius: 16px;
    }
    
    .cobba-calc-inputs {
        padding: 32px;
    }
    
    .cobba-calc-results {
        padding: 32px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .cobba-modal-summary-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px 20px;
    }
    
    .cobba-modal-table th, .cobba-modal-table td {
        padding: 12px 20px;
    }
    
    .cobba-modal-header {
        padding: 16px 20px;
    }
}

@media (max-width: 480px) {
    .cobba-calc-outer-container {
        margin: 1rem auto;
    }
    
    .cobba-calc-inputs, .cobba-calc-results {
        padding: 24px 16px;
    }
    
    .cobba-actions-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .cobba-btn-primary, .cobba-btn-secondary {
        width: 100%;
        padding: 14px 20px;
    }
    
    .cobba-results-grid {
        gap: 8px;
    }
    
    .cobba-grid-val {
        font-size: 15px;
    }
    
    .cobba-repayment-val {
        font-size: 52px;
    }
    
    .cobba-repayment-currency {
        font-size: 28px;
    }
}
