/**
 * Housing Benefit Calculator Styles
 * 주거급여 계산기 (임차급여/수선유지급여)
 *
 * @package Zipper
 */

.hbc-hidden {
    display: none !important;
}

.hbc-main-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: start;
}

.hbc-input-col {
    position: sticky;
    top: 20px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.hbc-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid #e5ddca;
    border-radius: 12px;
    background: #f5f1e6;
}

.hbc-tab-btn {
    flex: 1;
    border: none;
    border-radius: 9px;
    padding: 10px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    color: #7c7465;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hbc-tab-btn:hover {
    color: #5f584c;
    background: rgba(255, 255, 255, 0.45);
}

.hbc-tab-btn.active {
    color: #433d34;
    background: #fff;
    box-shadow: 0 1px 5px rgba(45, 42, 38, 0.1);
}

.hbc-tab-panel {
    display: none;
}

.hbc-tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hbc-section,
.hbc-result-summary,
.hbc-chart-section,
.hbc-table-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

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

.hbc-section-title i,
.hbc-block-title i {
    color: #d4af37;
}

.hbc-input-group {
    margin-bottom: 12px;
}

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

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

.hbc-select,
.hbc-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    color: #2d2a26;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hbc-select {
    padding: 10px 32px 10px 12px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236f6758' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.hbc-input {
    padding: 10px 12px;
    text-align: right;
    font-weight: 600;
}

.hbc-input::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

.hbc-select:hover,
.hbc-input:hover {
    border-color: #d4c67a;
}

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

.hbc-amount-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.hbc-amount-wrap .hbc-input {
    min-width: 0;
    padding-right: 12px;
}

.hbc-unit {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 0 12px;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #9a9488;
    background: #fbfaf8;
    white-space: nowrap;
    pointer-events: none;
}

.hbc-amount-wrap .hbc-input:hover + .hbc-unit {
    background: #fff;
    border-color: #d4c67a;
}

.hbc-amount-wrap .hbc-input:focus + .hbc-unit {
    background: #fff;
    border-color: #d4af37;
}

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

.hbc-hint {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.45;
    color: #8f897f;
}

.hbc-btn-group {
    display: flex;
    gap: 8px;
}

.hbc-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hbc-btn-primary {
    flex: 1;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #c49520 100%);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.26);
}

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

.hbc-btn-ghost {
    color: #5f5a56;
    border: 1px solid #dfd8cb;
    background: #f5f3ef;
}

.hbc-btn-ghost:hover {
    background: #fff;
    border-color: #d4c67a;
}

.hbc-waiting {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 52px;
    color: #7f755f;
    font-size: 13px;
    line-height: 1.5;
}

.hbc-waiting i {
    color: #d4af37;
    font-size: 18px;
    flex-shrink: 0;
}

.hbc-waiting p {
    margin: 0;
}

.hbc-result-summary {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
}

.hbc-summary-badge {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.18);
    color: #7b6521;
    font-size: 12px;
    font-weight: 700;
}

.hbc-summary-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
}

.hbc-main-value {
    margin-top: 8px;
    margin-bottom: 10px;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #b58913;
}

.hbc-summary-note {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #7f786b;
}

.hbc-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hbc-summary-item {
    border: 1px solid #e7ddc4;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
}

.hbc-summary-label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    color: #867f71;
}

.hbc-summary-value {
    display: block;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: #2f2b24;
}

.hbc-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.hbc-block-sub {
    font-size: 12px;
    color: #8f897f;
}

.hbc-chart-wrap {
    position: relative;
    width: 100%;
    min-height: 260px;
    height: 260px;
}

.hbc-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.hbc-chart-fallback {
    margin-top: 10px;
    border: 1px dashed #d9ceaf;
    border-radius: 8px;
    background: #fffdf6;
    color: #7f755f;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
}

#hbcDownloadBtn.tool-btn.tool-btn-excel,
.hbc-download-btn.tool-btn.tool-btn-excel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid #4f9f70;
    border-radius: 6px;
    min-height: 0;
    padding: 6px 12px;
    background: linear-gradient(135deg, #59ab79 0%, #4f9f70 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(63, 153, 98, 0.28);
}

#hbcDownloadBtn.tool-btn.tool-btn-excel:hover,
.hbc-download-btn.tool-btn.tool-btn-excel:hover {
    background: linear-gradient(135deg, #4f9f70 0%, #458b63 100%);
    border-color: #458b63;
    box-shadow: 0 4px 12px rgba(54, 137, 86, 0.34);
    transform: translateY(-1px);
}

.hbc-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.hbc-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.hbc-table th,
.hbc-table td {
    border: 1px solid #ece7da;
    padding: 10px 12px;
    font-size: 13px;
    color: #2d2a26;
    text-align: right;
    vertical-align: middle;
}

.hbc-table th {
    background: #f7f3e8;
    color: #5f584c;
    font-weight: 700;
}

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

.hbc-table tbody tr:nth-child(even) td {
    background: #fcfaf4;
}

.hbc-empty-row td {
    text-align: center !important;
    color: #8f897f;
}

.hbc-pass {
    color: #2f855a;
    font-weight: 700;
}

.hbc-fail {
    color: #c56c38;
    font-weight: 700;
}

.hbc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid #eadfbf;
    border-radius: 12px;
    background: #fffdf6;
    padding: 12px 14px;
    color: #7c7057;
    font-size: 12px;
    line-height: 1.55;
}

.hbc-disclaimer i {
    margin-top: 1px;
    flex-shrink: 0;
    color: #d4af37;
    font-size: 14px;
}

@media (max-width: 900px) {
    .hbc-main-layout {
        grid-template-columns: 1fr;
    }

    .hbc-input-col {
        position: static;
    }
}

@media (max-width: 768px) {
    .hbc-section,
    .hbc-result-summary,
    .hbc-chart-section,
    .hbc-table-section {
        padding: 14px;
    }

    .hbc-tab-btn {
        font-size: 12px;
        padding: 9px 6px;
    }

    .hbc-btn-group {
        flex-direction: column;
    }

    .hbc-main-value {
        font-size: 30px;
    }

    .hbc-summary-grid {
        grid-template-columns: 1fr;
    }

    .hbc-block-head {
        flex-direction: column;
        align-items: flex-start;
    }

    #hbcDownloadBtn.tool-btn.tool-btn-excel,
    .hbc-download-btn.tool-btn.tool-btn-excel {
        width: 100%;
    }

    .hbc-amount-wrap {
        gap: 6px;
    }

    .hbc-unit {
        min-width: 34px;
        padding: 0 10px;
    }
}

@media (max-width: 480px) {
    .hbc-tabs {
        gap: 2px;
        padding: 3px;
    }

    .hbc-tab-btn {
        font-size: 11px;
        gap: 4px;
        padding: 8px 4px;
    }

    .hbc-main-value {
        font-size: 27px;
    }

    .hbc-table {
        min-width: 460px;
    }

    .hbc-table th,
    .hbc-table td {
        font-size: 12px;
        padding: 9px 10px;
    }

    .hbc-amount-wrap {
        gap: 5px;
    }

    .hbc-unit {
        min-width: 32px;
        padding: 0 8px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hbc-tab-btn,
    .hbc-btn,
    .hbc-select,
    .hbc-input {
        transition: none;
    }
}
