/**
 * Rent Conversion Calculator Styles
 * 전월세 전환 계산기 전용 스타일 (2컬럼 레이아웃)
 *
 * @package Zipper
 */

/* ===== 2컬럼 레이아웃 (데스크탑) ===== */
.rcc-main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}

.rcc-input-col {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rcc-result-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== 탭 네비게이션 ===== */
.rcc-tabs {
    display: flex;
    gap: 4px;
    background: #faf9f7;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid #e8e4dc;
}

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

.rcc-tab-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
}

.rcc-tab-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

/* ===== 공통 섹션 ===== */
.rcc-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
}

.rcc-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.rcc-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-section-title i {
    color: #d4af37;
    font-size: 15px;
}

/* ===== 입력 섹션 (탭 패널) ===== */
.rcc-tab-panel {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.rcc-tab-panel.active {
    display: flex;
}

/* 탭 내부 섹션 간격 (Rule 44) */
.rcc-tab-panel .rcc-section + .rcc-section {
    margin-top: 14px;
}

.rcc-tab-panel .rcc-btn-group {
    margin-top: 14px;
}

/* ===== 입력 그룹 ===== */
.rcc-input-group {
    margin-bottom: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

.rcc-input-group:last-child {
    margin-bottom: 0;
}

.rcc-input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rcc-input-label .unit {
    font-weight: 400;
    color: #a09a94;
}

.rcc-amount-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rcc-amount-input:hover {
    border-color: #d4c67a;
}

.rcc-amount-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.rcc-amount-input::placeholder {
    color: #a09a94;
    font-weight: 400;
}

.rcc-korean-amount {
    font-size: 11px;
    color: #d4af37;
    margin-top: 4px;
    min-height: 16px;
    text-align: right;
}

/* 전환율 입력 */
.rcc-rate-section {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 12px;
}

.rcc-rate-title {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-rate-title i {
    color: #d4af37;
}

.rcc-rate-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rcc-rate-input-wrap input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rcc-rate-input-wrap input:hover {
    border-color: #d4c67a;
}

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

.rcc-rate-input-wrap .unit {
    font-size: 14px;
    font-weight: 600;
    color: #5f5a56;
}

.rcc-legal-limit {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #5f5a56;
    padding: 6px 8px;
    background: rgba(39, 174, 96, 0.08);
    border-radius: 4px;
}

.rcc-legal-limit i {
    color: #27ae60;
    font-size: 12px;
}

.rcc-legal-limit strong {
    color: #27ae60;
}

/* ===== 5% 상한 체크박스 ===== */
.rcc-cap-check {
    margin-top: 12px;
}

.rcc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #2d2a26;
}

.rcc-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
    cursor: pointer;
    flex-shrink: 0;
}

.rcc-checkbox-text {
    font-weight: 600;
}

.rcc-cap-hint {
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 11px;
    color: #5f5a56;
    line-height: 1.5;
    background: rgba(52, 152, 219, 0.06);
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.rcc-cap-hint i {
    color: #3498db;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ===== 계산 버튼 ===== */
.rcc-calc-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.rcc-calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
}

.rcc-calc-btn i {
    font-size: 16px;
}

/* ===== 대기 상태 ===== */
.rcc-waiting {
    text-align: center;
    padding: 60px 20px;
    color: #a09a94;
    background: #faf9f7;
    border: 1px dashed #e8e4dc;
    border-radius: 12px;
}

.rcc-waiting i {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
}

.rcc-waiting p {
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 결과 요약 카드 ===== */
.rcc-result-summary {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

.rcc-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.rcc-summary-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-summary-title i {
    color: #d4af37;
}

.rcc-total-box {
    text-align: center;
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
}

.rcc-total-label {
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 8px;
}

.rcc-total-value {
    font-size: 42px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    letter-spacing: -0.02em;
}

.rcc-total-value .unit {
    font-size: 18px;
    font-weight: 500;
    color: #b8860b;
}

.rcc-total-sub {
    font-size: 12px;
    color: #5f5a56;
    margin-top: 6px;
}

/* 결과 상세 그리드 */
.rcc-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.rcc-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
}

.rcc-detail-item.full-width {
    grid-column: span 2;
}

.rcc-detail-label {
    font-size: 12px;
    color: #5f5a56;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-detail-label i {
    color: #d4af37;
    font-size: 14px;
}

.rcc-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
}

/* ===== 5% 상한 결과 ===== */
.rcc-cap-result {
    margin-top: 14px;
    padding: 14px;
    background: rgba(231, 76, 60, 0.06);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 8px;
}

.rcc-cap-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #c0392b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-cap-result-title i {
    color: #e74c3c;
    font-size: 14px;
}

.rcc-cap-result-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rcc-cap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.rcc-cap-label {
    font-size: 12px;
    color: #5f5a56;
}

.rcc-cap-value {
    font-size: 14px;
    font-weight: 700;
    color: #c0392b;
}

.rcc-cap-diff {
    font-size: 14px;
    font-weight: 700;
    color: #27ae60;
}

/* ===== 경고 메시지 (법정 상한 초과) ===== */
.rcc-warning {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 8px;
}

.rcc-warning.show {
    display: flex;
}

.rcc-warning i {
    color: #e74c3c;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.rcc-warning-text {
    font-size: 13px;
    color: #c0392b;
    line-height: 1.5;
}

.rcc-warning-text strong {
    color: #e74c3c;
}

/* ===== 변경 후 조건 카드 ===== */
.rcc-after-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
}

.rcc-after-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.rcc-after-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-after-title i {
    color: #27ae60;
}

.rcc-after-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.rcc-after-item {
    text-align: center;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
}

.rcc-after-item .type {
    font-size: 11px;
    font-weight: 500;
    color: #5f5a56;
    margin-bottom: 4px;
}

.rcc-after-item .amount {
    font-size: 18px;
    font-weight: 700;
    color: #27ae60;
}

.rcc-after-item .amount .unit {
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
}

/* ===== 차트 섹션 ===== */
.rcc-chart-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
}

.rcc-chart-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.rcc-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-chart-title i {
    color: #d4af37;
}

.rcc-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: center;
}

.rcc-donut-wrap {
    position: relative;
    width: 100%;
    max-width: 200px;
    height: 200px;
    margin: 0 auto;
}

.rcc-donut-wrap canvas {
    max-height: 200px;
}

.rcc-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.rcc-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.rcc-legend-label {
    font-size: 12px;
    color: #5f5a56;
}

.rcc-legend-value {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-left: auto;
}

/* ===== 시뮬레이션 섹션 ===== */
.rcc-sim-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease;
}

.rcc-sim-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

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

.rcc-sim-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-sim-title i {
    color: #3498db;
}

/* 엑셀 다운로드 버튼 */
.rcc-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background: #217346;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* ===== 시뮬레이션 범위 입력 ===== */
.rcc-sim-range {
    margin-bottom: 12px;
    padding: 10px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
}

.rcc-sim-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rcc-sim-range-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rcc-sim-range-input:hover {
    border-color: #d4c67a;
}

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

.rcc-sim-range-input::placeholder {
    color: #a09a94;
    font-weight: 400;
}

.rcc-sim-range-sep {
    font-size: 14px;
    font-weight: 600;
    color: #5f5a56;
    flex-shrink: 0;
}

.rcc-sim-range-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.rcc-sim-range-btn:hover {
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* 시뮬레이션 테이블 래퍼 */
.rcc-sim-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 시뮬레이션 테이블 */
.rcc-sim-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.rcc-sim-table thead th {
    padding: 8px 10px;
    background: #faf9f7;
    color: #5f5a56;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #e8e4dc;
    white-space: nowrap;
}

.rcc-sim-table tbody td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #f0ede8;
    color: #2d2a26;
}

.rcc-sim-table tbody tr:hover {
    background: rgba(212, 175, 55, 0.04);
}

.rcc-sim-table tbody tr.current {
    background: rgba(212, 175, 55, 0.1);
    font-weight: 600;
}

.rcc-sim-table tbody tr.current td {
    color: #b8860b;
}

/* 바 차트 래퍼 */
.rcc-bar-wrap {
    position: relative;
    width: 100%;
    height: 250px;
    margin-top: 12px;
}

.rcc-bar-wrap canvas {
    max-height: 250px;
}

/* ===== 팁 섹션 ===== */
.rcc-tips-section {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(52, 152, 219, 0.03) 100%);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.rcc-tips-title {
    font-size: 13px;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rcc-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rcc-tips-list li {
    font-size: 12px;
    color: #5f5a56;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    border-bottom: 1px solid rgba(52, 152, 219, 0.15);
}

.rcc-tips-list li:last-child {
    border-bottom: none;
}

.rcc-tips-list li::before {
    content: '\f26a';
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 0;
    color: #3498db;
    font-size: 10px;
}

/* ===== 면책조항 ===== */
.rcc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: rgba(108, 117, 125, 0.08);
    border-radius: 8px;
}

.rcc-disclaimer i {
    color: #6c757d;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.rcc-disclaimer-text {
    font-size: 12px;
    color: #5f5a56;
    line-height: 1.5;
}

.rcc-disclaimer-text strong {
    color: #2d2a26;
}

/* ===== 숨김 ===== */
.rcc-hidden {
    display: none !important;
}

/* ===== prefers-reduced-motion (Rule 49) ===== */
@media (prefers-reduced-motion: reduce) {
    .rcc-section, .rcc-amount-input, .rcc-calc-btn, .rcc-tips-section,
    .rcc-result-summary, .rcc-after-section, .rcc-chart-section, .rcc-sim-section,
    .rcc-sim-range-input, .rcc-sim-range-btn {
        transition: none !important;
    }
    .rcc-section:hover, .rcc-tips-section:hover, .rcc-calc-btn:hover {
        transform: none !important;
    }
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .rcc-main-layout {
        grid-template-columns: 320px 1fr;
        gap: 16px;
    }

    .rcc-chart-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rcc-donut-wrap {
        max-width: 180px;
    }

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

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 768px) {
    .rcc-main-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .rcc-input-col {
        position: static;
        width: 100%;
    }

    .rcc-result-col {
        width: 100%;
    }

    .rcc-total-value {
        font-size: 36px;
    }

    .rcc-detail-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rcc-detail-item.full-width {
        grid-column: span 1;
    }

    .rcc-after-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .rcc-after-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .rcc-after-item .type {
        margin-bottom: 0;
    }

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

    .rcc-sim-table {
        font-size: 11px;
    }

    .rcc-sim-table thead th,
    .rcc-sim-table tbody td {
        padding: 6px 6px;
    }

    .rcc-result-summary {
        padding: 16px;
    }

    .rcc-bar-wrap {
        height: 200px;
    }

    .rcc-bar-wrap canvas {
        max-height: 200px;
    }

    .rcc-sim-range-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .rcc-sim-range-input {
        flex: 1 1 calc(50% - 20px);
        min-width: 80px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .rcc-total-value {
        font-size: 32px;
    }

    .rcc-total-value .unit {
        font-size: 14px;
    }

    .rcc-summary-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .rcc-sim-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .rcc-sim-range-row {
        flex-direction: column;
    }

    .rcc-sim-range-input {
        width: 100%;
        flex: none;
    }

    .rcc-sim-range-sep {
        display: none;
    }

    .rcc-sim-range-btn {
        width: 100%;
    }
}

/* Excel button guard */
.tool-btn-excel {
  background: #59ab79;
  border-color: #59ab79;
}

.tool-btn-excel:hover,
.tool-btn-excel:focus-visible {
  background: #4f9f70;
  border-color: #4f9f70;
}

