/**
 * Foreign Dividend Tax Calculator Styles
 * 해외주식 배당세 계산기 전용 스타일
 * HTML 구조: fdt-main-layout > fdt-input-col + fdt-result-col
 *
 * @package Zipper
 */

/* ===== 2컬럼 레이아웃 ===== */
.fdt-main-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

/* ===== 입력 컬럼 ===== */
.fdt-input-col {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ===== 결과 컬럼 ===== */
.fdt-result-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== 공통 섹션 카드 ===== */
.fdt-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;
}

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

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

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

/* ===== 입력 그룹 ===== */
.fdt-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

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

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

.fdt-select,
.fdt-amount-input,
.fdt-number-input {
    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%;
    box-sizing: border-box;
}

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

.fdt-amount-input::placeholder,
.fdt-number-input::placeholder {
    color: #a09a94;
}

.fdt-input-with-unit {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.fdt-input-with-unit:focus-within {
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.fdt-input-with-unit .fdt-number-input {
    border: none;
    border-radius: 0;
    background: transparent;
    flex: 1;
    box-shadow: none;
}

.fdt-input-with-unit .fdt-number-input:focus {
    border: none;
    box-shadow: none;
    background: transparent;
}

.fdt-input-unit {
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #7a756d;
    background: rgba(122, 117, 109, 0.07);
    border-left: 1px solid #e8e4dc;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    min-height: 42px;
}

.fdt-hint {
    font-size: 11px;
    color: #a09a94;
    line-height: 1.4;
    margin-top: 4px;
}

/* 금액 한글 표시 */
.fdt-korean-amount {
    font-size: 12px;
    color: #d4af37;
    font-weight: 500;
    min-height: 18px;
}

/* ===== 선택적 입력 (종합과세) ===== */
.fdt-optional-label {
    font-size: 12px;
    color: #a09a94;
    font-weight: 400;
    margin-left: 4px;
}

/* ===== 버튼 그룹 ===== */
.fdt-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.fdt-reset-btn,
.fdt-share-btn {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.fdt-reset-btn {
    color: #7a756d;
    background: #fff;
    border: 1px solid #e8e4dc;
}

.fdt-reset-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.fdt-share-btn {
    color: #3498db;
    background: #fff;
    border: 1px solid #3498db;
}

.fdt-share-btn:hover {
    background: rgba(52, 152, 219, 0.08);
}

/* ===== 결과 영역 래퍼 ===== */
#fdtResultSection {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

/* ===== 대기 화면 ===== */
.fdt-waiting {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

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

.fdt-waiting-title {
    font-size: 15px;
    font-weight: 600;
    color: #2d2a26;
    margin: 0;
}

.fdt-waiting-desc {
    font-size: 13px;
    color: #a09a94;
    margin: 0;
}

.fdt-waiting-guide {
    text-align: left;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
    max-width: 420px;
    margin: 8px auto 0;
    width: 100%;
}

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

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

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

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

/* ===== 메인 결과 카드 (실수령 배당금) ===== */
.fdt-main-result {
    position: relative;
    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;
}

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

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

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

.fdt-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: 10px;
}

/* 복사 버튼 */
.fdt-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(184, 134, 11, 0.2);
    color: #b8860b;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fdt-copy-btn:hover {
    background: rgba(184, 134, 11, 0.3);
}

.fdt-copy-btn.copied {
    background: #27ae60;
    color: #fff;
}

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

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

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

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

.fdt-detail-label i {
    color: #d4af37;
    font-size: 13px;
}

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

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

.fdt-detail-card.tax-card .fdt-detail-label i {
    color: #e74c3c;
}

.fdt-detail-card.tax-card .fdt-detail-value {
    color: #e74c3c;
}

.fdt-detail-card.rate-card .fdt-detail-value {
    color: #5f5a56;
    font-size: 26px;
}

.fdt-detail-sub {
    font-size: 11px;
    color: #a09a94;
    margin-top: 4px;
}

/* ===== 종합과세 안내 ===== */
.fdt-comprehensive-notice {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.fdt-comprehensive-notice i {
    color: #e65100;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.fdt-comprehensive-notice-text {
    font-size: 13px;
    color: #5f5a56;
    line-height: 1.6;
}

.fdt-comprehensive-notice-text strong {
    color: #e65100;
}

/* ===== 도넛 차트 ===== */
.fdt-chart-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
}

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

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

.fdt-chart-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.fdt-donut-wrap {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.fdt-donut-wrap canvas {
    max-width: 180px;
    max-height: 180px;
}

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

.fdt-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5f5a56;
}

.fdt-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fdt-dot-net {
    background: #d4af37;
}

.fdt-dot-foreign {
    background: #e74c3c;
}

.fdt-dot-domestic {
    background: #f39c12;
}

/* ===== 국가별 세율 비교표 ===== */
.fdt-country-table-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
}

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

.fdt-country-table-title i {
    color: #d4af37;
}

.fdt-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

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

.fdt-country-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
    font-size: 12px;
    position: sticky;
    top: 0;
}

.fdt-country-table td {
    color: #2d2a26;
}

.fdt-country-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.fdt-country-table tr:last-child td {
    border-bottom: none;
}

.fdt-country-table tr:hover {
    background: #faf9f7;
}

.fdt-country-table tr.fdt-current-country {
    background: rgba(212, 175, 55, 0.08);
}

.fdt-country-table tr.fdt-current-country td {
    color: #b8860b;
    font-weight: 700;
}

.fdt-country-table tr.fdt-current-country td:first-child::after {
    content: ' ◀';
    color: #d4af37;
    font-size: 11px;
}

.fdt-tax-zero {
    color: #27ae60;
    font-weight: 700;
}

/* ===== 면책 조항 ===== */
.fdt-disclaimer {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border: 1px solid #e8dfc0;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

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

.fdt-disclaimer span {
    font-size: 12px;
    color: #7a756d;
    line-height: 1.6;
}

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

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

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

    .fdt-chart-wrap {
        flex-direction: column;
        align-items: center;
    }

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

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

    .fdt-main-value {
        font-size: 36px;
    }

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

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

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

    .fdt-detail-value {
        font-size: 18px;
    }

    .fdt-donut-wrap {
        width: 150px;
        height: 150px;
    }

    .fdt-donut-wrap canvas {
        max-width: 150px;
        max-height: 150px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .fdt-btn-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

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

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

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

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

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

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

    .fdt-country-table {
        font-size: 11px;
    }

    .fdt-country-table th,
    .fdt-country-table td {
        padding: 8px 6px;
    }
}
