/**
 * Unemployment Benefit Calculator Styles
 * 실업급여 계산기 전용 스타일
 *
 * @package Zipper
 */

/* ===== 2컬럼 자체 그리드 레이아웃 ===== */
.ubc-main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}

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

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

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

/* Rule 44: tab wrapper blocks gap → explicit margin */
.ubc-section + .ubc-section {
    margin-top: 14px;
}

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

.ubc-section-title i {
    color: #d4af37;
    font-size: 14px;
}

/* ===== 탭 (2개 → flex OK) ===== */
.ubc-tabs {
    display: flex;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 3px;
}

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

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

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

.ubc-tab-content {
    display: none;
}

.ubc-tab-content.active {
    display: block;
}

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

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

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

.ubc-input-label .ubc-label-hint {
    font-weight: 400;
    color: #9e9a96;
    margin-left: 4px;
}

.ubc-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;
}

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

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

.ubc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    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='%235f5a56' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

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

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

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

.ubc-hint {
    font-size: 11px;
    color: #9e9a96;
    margin-top: 4px;
}

/* ===== 입력 방식 라디오 ===== */
.ubc-radio-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ubc-radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.ubc-radio-option:hover {
    border-color: #d4af37;
    background: #fff;
}

.ubc-radio-option.active {
    border-color: #d4af37;
    background: rgba(212,175,55,0.08);
}

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

.ubc-radio-option > label {
    flex: 1;
    font-size: 13px;
    color: #2d2a26;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ubc-radio-option .ubc-radio-badge {
    font-size: 11px;
    font-weight: 600;
    color: #7a756d;
    background: rgba(122,117,109,0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== 버튼 ===== */
.ubc-btn-group {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.ubc-calculate-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37, #c9a030);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.ubc-calculate-btn:hover {
    background: linear-gradient(135deg, #c9a030, #b8922a);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(212,175,55,0.3);
}

.ubc-reset-btn {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    background: #f5f3f0;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ubc-reset-btn:hover {
    background: #eae7e3;
}

/* ===== 결과 - 대기 영역 ===== */
.ubc-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #9e9a96;
}

.ubc-waiting i {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
    color: #d4af37;
    opacity: 0.4;
}

.ubc-waiting p {
    font-size: 13px;
    margin: 0;
}

/* ===== 결과 - 요약 카드 ===== */
.ubc-result-summary {
    background: #fdfbf5;
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.ubc-summary-title {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 8px;
}

.ubc-summary-main {
    font-size: 36px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1.2;
    margin-bottom: 4px;
}

.ubc-summary-main .ubc-unit {
    font-size: 18px;
    font-weight: 600;
}

.ubc-summary-label {
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 16px;
}

.ubc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid #e8e4dc;
    font-size: 13px;
}

.ubc-summary-row-label {
    color: #7a756d;
}

.ubc-summary-row-value {
    font-weight: 600;
    color: #2d2a26;
}

/* ===== 상세 카드 ===== */
.ubc-detail-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

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

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

.ubc-detail-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ubc-detail-label i {
    color: #d4af37;
}

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

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

.ubc-detail-card.highlight {
    background: linear-gradient(135deg, rgba(212,175,55,0.08) 0%, rgba(212,175,55,0.02) 100%);
    border-color: rgba(212,175,55,0.35);
}

.ubc-detail-card.highlight .ubc-detail-label {
    color: #d4af37;
}

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

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

.ubc-donut-wrap {
    max-width: 220px;
    margin: 0 auto;
}

.ubc-chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
    font-size: 13px;
    color: #5a5650;
}

.ubc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ubc-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.ubc-dot-benefit {
    background: #d4af37;
}

.ubc-dot-loss {
    background: #e8e4dc;
}

/* ===== 수령 스케줄 ===== */
.ubc-schedule-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

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

.ubc-schedule-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ubc-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: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.ubc-schedule-toggle {
    font-size: 12px;
    color: #d4af37;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}

.ubc-schedule-toggle:hover {
    background: rgba(212,175,55,0.1);
}

.ubc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 400px;
    max-width: 100%;
}

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

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

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

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

.ubc-schedule-table td {
    color: #2d2a26;
}

.ubc-schedule-table .total-row td {
    border-bottom: none;
    font-weight: 600;
    background: rgba(212,175,55,0.08);
    color: #d4af37;
}

.ubc-schedule-table tr:hover:not(.total-row) {
    background: #faf9f7;
}

/* ===== 조기재취업수당 결과 ===== */
.ubc-early-status {
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.ubc-early-status i {
    font-size: 20px;
}

.ubc-early-status.ubc-eligible {
    background: linear-gradient(135deg, rgba(46,204,113,0.08), rgba(46,204,113,0.02));
    border: 1px solid rgba(46,204,113,0.3);
    color: #27ae60;
}

.ubc-early-status.ubc-ineligible {
    background: linear-gradient(135deg, rgba(231,76,60,0.08), rgba(231,76,60,0.02));
    border: 1px solid rgba(231,76,60,0.3);
    color: #e74c3c;
}

.ubc-early-summary {
    background: #fdfbf5;
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.ubc-early-main-label {
    font-size: 12px;
    color: #7a756d;
    margin-bottom: 8px;
}

.ubc-early-main-value {
    font-size: 36px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1.2;
    margin-bottom: 16px;
}

.ubc-early-main-value .ubc-unit {
    font-size: 18px;
    font-weight: 600;
}

.ubc-early-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid #e8e4dc;
    font-size: 13px;
}

.ubc-early-info-label {
    color: #7a756d;
}

.ubc-early-info-value {
    font-weight: 600;
    color: #2d2a26;
}

/* ===== 면책 조항 ===== */
.ubc-disclaimer {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-size: 11px;
    color: #9e9a96;
    line-height: 1.5;
}

.ubc-disclaimer i {
    color: #d4af37;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ===== 유틸리티 ===== */
.ubc-hidden {
    display: none !important;
}

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

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

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

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

    /* Rule 32: radio/checkbox excluded */
    .ubc-input-group input:not([type="radio"]):not([type="checkbox"]),
    .ubc-input-group select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .ubc-summary-main,
    .ubc-early-main-value {
        font-size: 28px;
    }
}

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

    .ubc-summary-main,
    .ubc-early-main-value {
        font-size: 28px;
    }

    .ubc-detail-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ubc-detail-card {
        padding: 14px 10px;
    }

    .ubc-detail-value {
        font-size: 20px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .tool-section,
    .tool-layout-split,
    .tool-layout-input,
    .tool-layout-result {
        max-width: 100%;
        overflow-x: hidden;
    }

    .ubc-section {
        padding: 12px;
    }

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

    .ubc-summary-main,
    .ubc-early-main-value {
        font-size: 24px;
    }

    .ubc-detail-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ubc-detail-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 14px;
    }

    .ubc-detail-label {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .ubc-detail-value {
        font-size: 22px;
    }

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

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

/* 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;
}

