/**
 * Credit Loan Interest Calculator Styles (EN)
 * Personal Loan Calculator - US Market
 *
 * Prefix: clc- (credit-loan-calculator)
 * Colors:
 * - Primary Gold: #d4af37
 * - Dark Gold: #b8860b
 * - Background: #faf9f7
 * - Border: #e8e4dc
 * - Text: #2d2a26
 * - Label: #5f5a56
 * - Muted: #7a756d
 * - Placeholder: #a09a94
 */

/* ===========================
   Layout Override
   =========================== */
.tool-section:has(.clc-input-section) .tool-layout-split {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}

/* ===========================
   Tabs (2 tabs - grid)
   =========================== */
.clc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
}

.clc-tab {
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border: none;
    background: transparent;
    color: #5f5a56;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clc-tab:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #b8860b;
}

.clc-tab.active {
    background: #d4af37;
    color: white;
}

/* ===========================
   Input Section
   =========================== */
.clc-input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.clc-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
    box-sizing: border-box;
}

.clc-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
}

.clc-input-group input,
.clc-input-group select {
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.clc-input-group input:focus,
.clc-input-group select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.clc-input-group input::placeholder {
    color: #a09a94;
}

.clc-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ===========================
   Quick Buttons
   =========================== */
.clc-quick-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.clc-quick-btn {
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clc-quick-btn:hover {
    border-color: #d4af37;
    color: #b8860b;
    background: rgba(212, 175, 55, 0.08);
}

/* ===========================
   Amount Display
   =========================== */
.clc-amount-display {
    font-size: 12px;
    color: #d4af37;
    min-height: 18px;
}

/* ===========================
   Hidden Class
   =========================== */
.clc-hidden {
    display: none !important;
}

/* ===========================
   Disclaimer
   =========================== */
.clc-disclaimer {
    font-size: 12px;
    color: #a09a94;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.clc-disclaimer i {
    color: #d4af37;
}

/* ===========================
   Waiting Section
   =========================== */
.clc-waiting-section {
    text-align: center;
    padding: 40px 20px;
    color: #a09a94;
}

.clc-waiting-icon {
    font-size: 48px;
    color: #d4af37;
    margin-bottom: 12px;
}

.clc-waiting-text {
    font-size: 14px;
}

/* ===========================
   Result Section
   =========================== */
.clc-result-section {
    /* Container only, no special styling */
}

.clc-result-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===========================
   Summary Cards (2x2 Grid)
   =========================== */
.clc-summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.clc-summary-card {
    background: white;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.clc-summary-card:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
}

.clc-summary-card.clc-highlight {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.05));
    border-color: rgba(212, 175, 55, 0.35);
}

.clc-summary-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    display: block;
    margin-bottom: 6px;
}

.clc-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d2a26;
    display: block;
}

.clc-summary-card.clc-highlight .clc-summary-value {
    color: #d4af37;
}

/* ===========================
   Condition Summary
   =========================== */
.clc-condition-summary {
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 16px;
    text-align: center;
}

/* ===========================
   Origination Fee Info
   =========================== */
.clc-origination-info {
    padding: 10px 12px;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clc-origination-info .clc-origination-label {
    font-weight: 600;
}

.clc-origination-info .clc-origination-value {
    font-weight: 700;
    color: #d4af37;
}

/* ===========================
   Schedule Section
   =========================== */
.clc-schedule-section {
    background: white;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.clc-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.clc-schedule-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    gap: 6px;
    align-items: center;
}

.clc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #217346;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clc-download-btn:hover {
    background: #1a5c38;
}

.clc-download-btn i {
    font-size: 14px;
}

.clc-schedule-body {
    /* Container only */
}

.clc-table-wrapper {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.clc-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.clc-schedule-table th,
.clc-schedule-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #f0ede8;
}

.clc-schedule-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
    position: sticky;
    top: 0;
    z-index: 1;
}

.clc-schedule-table th:first-child,
.clc-schedule-table td:first-child {
    text-align: center;
}

.clc-schedule-table tr:last-child td {
    font-weight: 700;
    background: rgba(212, 175, 55, 0.08);
    color: #d4af37;
}

.clc-schedule-table tr:hover:not(:last-child) {
    background: #faf9f7;
}

/* ===========================
   Grade Info
   =========================== */
.clc-grade-info {
    padding: 12px;
    background: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.25);
    border-radius: 8px;
    font-size: 13px;
    color: #3498db;
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===========================
   Comparison Grid (3 Cards)
   =========================== */
.clc-comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.clc-comparison-card {
    background: white;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.clc-comparison-card:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
}

.clc-card-header {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    gap: 8px;
    align-items: center;
}

.clc-card-creditunion .clc-card-header {
    background: rgba(52, 152, 219, 0.08);
    color: #2980b9;
}

.clc-card-bank .clc-card-header {
    background: rgba(155, 89, 182, 0.08);
    color: #8e44ad;
}

.clc-card-online .clc-card-header {
    background: rgba(230, 126, 34, 0.08);
    color: #d35400;
}

.clc-card-body {
    padding: 16px;
}

.clc-rate-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0ede8;
}

.clc-rate-row:last-child {
    border-bottom: none;
}

.clc-rate-label {
    font-size: 12px;
    color: #7a756d;
}

.clc-rate-value {
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
}

.clc-monthly-value {
    font-size: 14px;
    font-weight: 600;
}

.clc-interest-value {
    font-size: 13px;
    color: #e74c3c;
}

.clc-card-unavailable {
    opacity: 0.5;
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #a09a94;
}

/* ===========================
   Detail Comparison Table
   =========================== */
.clc-detail-comparison {
    background: white;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.clc-detail-comparison h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    gap: 6px;
}

.clc-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.clc-compare-table th,
.clc-compare-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #f0ede8;
}

.clc-compare-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
}

.clc-compare-table th:first-child,
.clc-compare-table td:first-child {
    text-align: left;
}

.clc-compare-table .best-value {
    color: #27ae60;
    font-weight: 600;
}

/* ===========================
   Grade Table
   =========================== */
.clc-grade-table-section {
    background: white;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    padding: 16px;
}

.clc-grade-table-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.clc-grade-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.clc-grade-table th,
.clc-grade-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #f0ede8;
}

.clc-grade-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
}

.clc-grade-table th:first-child,
.clc-grade-table td:first-child {
    text-align: left;
}

.clc-grade-table .current-grade {
    background: rgba(212, 175, 55, 0.08);
    font-weight: 600;
}

/* ===========================
   Responsive - Tablet (900px)
   =========================== */
@media (max-width: 900px) {
    .tool-section:has(.clc-input-section) .tool-layout-split {
        grid-template-columns: 1fr;
    }

    .tool-layout-input {
        max-width: 100%;
        overflow: hidden;
    }

    .clc-input-group input:not([type="radio"]):not([type="checkbox"]),
    .clc-input-group select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .clc-comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Responsive - Mobile (768px)
   =========================== */
@media (max-width: 768px) {
    .clc-summary-cards {
        grid-template-columns: 1fr;
    }

    .clc-summary-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .clc-summary-label {
        margin-bottom: 0;
    }

    .clc-summary-value {
        font-size: 20px;
    }

    .clc-comparison-card {
        margin-bottom: 12px;
    }

    .clc-card-body {
        padding: 12px;
    }

    .clc-rate-value {
        font-size: 14px;
    }

    .clc-monthly-value {
        font-size: 13px;
    }
}

/* ===========================
   Responsive - Small Mobile (480px)
   =========================== */
@media (max-width: 480px) {
    .tool-section,
    .tool-layout-split,
    .tool-layout-input,
    .tool-layout-result {
        max-width: 100%;
        overflow-x: hidden;
    }

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

    .clc-quick-btns {
        grid-template-columns: repeat(2, 1fr);
    }

    .clc-schedule-table {
        font-size: 11px;
    }

    .clc-schedule-table th,
    .clc-schedule-table td {
        padding: 8px 4px;
    }

    .clc-table-wrapper {
        overflow-x: auto;
    }

    .clc-compare-table,
    .clc-grade-table {
        font-size: 11px;
    }

    .clc-compare-table th,
    .clc-compare-table td,
    .clc-grade-table th,
    .clc-grade-table td {
        padding: 8px 4px;
    }
}
