/**
 * Brokerage Fee Calculator Styles
 * 중개수수료(복비) 계산기 전용 스타일
 * HTML 구조: tool-layout-split > tool-input-panel + tool-result-panel
 *
 * @package Zipper
 */

/* ===== 탭 네비게이션 ===== */
.bfc-tabs {
    display: flex;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 16px;
}

.bfc-tab-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #7a756d;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.bfc-tab-btn:hover {
    color: #2d2a26;
    background: rgba(255, 255, 255, 0.5);
}

.bfc-tab-btn.active {
    color: #fff;
    background: #d4af37;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

/* ===== 입력 섹션 ===== */
.bfc-input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bfc-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.bfc-input-group input,
.bfc-input-group select {
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

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

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

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

/* 월세 전용 행 */
.bfc-rent-row {
    display: none;
}

.bfc-rent-row.show {
    display: flex;
}

/* 부동산 유형 선택 */
.bfc-type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bfc-type-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.bfc-type-btn:hover {
    border-color: #d4af37;
    background: #fff;
}

.bfc-type-btn.active {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
    border-color: #d4af37;
    font-weight: 600;
}

/* 계산 버튼 */
.bfc-calc-btn {
    width: 100%;
    padding: 14px;
    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;
    margin-top: 4px;
}

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

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

/* 도움말 텍스트 */
.bfc-help-text {
    font-size: 11px;
    color: #a09a94;
    margin: 0;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.bfc-help-text i {
    flex-shrink: 0;
    margin-top: 1px;
}

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

/* ===== 대기 상태 ===== */
.bfc-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #a09a94;
}

.bfc-waiting > i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: #d4af37;
}

.bfc-waiting > p {
    font-size: 14px;
    margin-bottom: 16px;
}

.bfc-waiting-guide {
    text-align: left;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
}

.bfc-waiting-guide .guide-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bfc-waiting-guide .guide-title i {
    color: #d4af37;
}

.bfc-waiting-guide ul {
    margin: 0;
    padding-left: 18px;
}

.bfc-waiting-guide li {
    font-size: 12px;
    color: #5f5a56;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ===== 메인 결과 ===== */
.bfc-main-result {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}

.bfc-main-label {
    font-size: 14px;
    color: #7a756d;
    margin-bottom: 8px;
}

.bfc-main-value {
    font-size: 48px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    margin-bottom: 4px;
}

.bfc-main-value .unit {
    font-size: 22px;
    font-weight: 600;
    color: #b8860b;
    margin-left: 4px;
}

.bfc-rate-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #b8860b;
    background: rgba(212, 175, 55, 0.15);
    margin-top: 8px;
}

/* ===== 쌍방 합계 ===== */
.bfc-both-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.bfc-party-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

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

.bfc-party-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
}

.bfc-party-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d2a26;
}

.bfc-party-value .unit {
    font-size: 14px;
    font-weight: 500;
    color: #7a756d;
}

.bfc-total-card {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(52, 152, 219, 0.02) 100%);
    border: 1px solid rgba(52, 152, 219, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bfc-total-label {
    font-size: 14px;
    font-weight: 600;
    color: #3498db;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bfc-total-value {
    font-size: 22px;
    font-weight: 700;
    color: #3498db;
}

.bfc-total-value .unit {
    font-size: 14px;
    font-weight: 500;
}

/* ===== 계산 상세 ===== */
.bfc-detail-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

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

.bfc-detail-title i {
    color: #d4af37;
}

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

.bfc-detail-row:last-child {
    border-bottom: none;
}

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

.bfc-detail-label i {
    color: #a09a94;
    font-size: 12px;
}

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

.bfc-detail-value.highlight {
    color: #d4af37;
}

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

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

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

.bfc-pie-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.bfc-pie-chart {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.bfc-pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bfc-pie-center .value {
    font-size: 16px;
    font-weight: 700;
    color: #d4af37;
}

.bfc-pie-center .label {
    font-size: 10px;
    color: #7a756d;
}

.bfc-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

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

.bfc-legend-text {
    font-size: 12px;
    color: #5f5a56;
    flex: 1;
}

.bfc-legend-value {
    font-size: 12px;
    font-weight: 600;
    color: #2d2a26;
}

/* ===== 요율표 섹션 ===== */
.bfc-rate-table-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.bfc-rate-table-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.bfc-rate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bfc-rate-table th,
.bfc-rate-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid #f0ede8;
}

.bfc-rate-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
    font-size: 12px;
}

.bfc-rate-table td {
    color: #2d2a26;
}

.bfc-rate-table tr:last-child td {
    border-bottom: none;
}

.bfc-rate-table tr.current {
    background: rgba(212, 175, 55, 0.1);
}

.bfc-rate-table tr.current td {
    font-weight: 600;
    color: #d4af37;
}

.bfc-rate-table .range {
    text-align: left;
}

/* 협상 안내 */
.bfc-negotiation-section {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.02) 100%);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.bfc-negotiation-title {
    font-size: 13px;
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bfc-negotiation-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.bfc-negotiation-item {
    text-align: center;
    padding: 12px 8px;
    background: #fff;
    border-radius: 8px;
}

.bfc-negotiation-percent {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
    margin-bottom: 4px;
}

.bfc-negotiation-value {
    font-size: 16px;
    font-weight: 700;
    color: #2d2a26;
}

/* ===== 안내문 ===== */
.bfc-notice {
    text-align: center;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
}

.bfc-notice p {
    font-size: 12px;
    color: #a09a94;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bfc-notice i {
    color: #d4af37;
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .bfc-pie-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    .bfc-legend {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .bfc-negotiation-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 768px) {
    .bfc-main-result {
        padding: 20px 16px;
    }

    .bfc-main-value {
        font-size: 40px;
    }

    .bfc-main-value .unit {
        font-size: 18px;
    }

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

    .bfc-party-value {
        font-size: 20px;
    }

    .bfc-total-card {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

    .bfc-rate-table {
        font-size: 12px;
    }

    .bfc-rate-table th,
    .bfc-rate-table td {
        padding: 8px 4px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .bfc-tabs {
        flex-wrap: wrap;
    }

    .bfc-tab-btn {
        flex: 1 1 calc(33.33% - 3px);
        padding: 8px 10px;
        font-size: 13px;
    }

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

    .bfc-main-value {
        font-size: 34px;
    }

    .bfc-main-value .unit {
        font-size: 16px;
    }

    .bfc-both-result {
        grid-template-columns: 1fr;
    }

    .bfc-total-card {
        grid-column: span 1;
    }

    .bfc-type-btn {
        min-width: calc(50% - 4px);
        padding: 8px 10px;
        font-size: 12px;
    }

    .bfc-negotiation-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .bfc-negotiation-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 14px;
    }

    .bfc-negotiation-percent {
        margin-bottom: 0;
    }
}
