/**
 * Savings Interest Calculator Styles
 * 적금 이자 계산기 전용 스타일
 * HTML 구조: tool-layout-split > tool-input-panel + tool-result-panel
 *
 * @package Zipper
 */

/* ===== 레이아웃 오버라이드 ===== */
.tool-section:has(.sav-input-section) .tool-layout-split {
    grid-template-columns: 280px 1fr;
}

@media (max-width: 900px) {
    .tool-section:has(.sav-input-section) .tool-layout-split {
        grid-template-columns: 1fr;
    }
}

/* ===== 입력 섹션 ===== */
.sav-input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    overflow: hidden;
}

.sav-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
}

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

.sav-input-group input,
.sav-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%;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

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

/* 간편 버튼 그룹 */
.sav-quick-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-width: 100%;
}

.sav-quick-btn {
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.sav-quick-btn:hover {
    border-color: #d4af37;
    background: #fff;
    color: #d4af37;
}

/* 이자 방식 토글 */
.sav-interest-toggle {
    display: flex;
    gap: 6px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
}

.sav-toggle-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;
}

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

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

/* 세금 옵션 */
.sav-tax-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sav-tax-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;
}

.sav-tax-option:hover {
    border-color: #d4af37;
    background: #fff;
}

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

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

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

.sav-tax-option .tax-rate {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
    background: rgba(122, 117, 109, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 계산 버튼 */
.sav-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;
}

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

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

/* 초기화/공유 버튼 */
.sav-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    max-width: 100%;
}

.sav-reset-btn,
.sav-share-btn {
    padding: 12px 16px;
    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;
}

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

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

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

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

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

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

/* 금액 읽기 표시 */
.sav-amount-display {
    font-size: 12px;
    color: #d4af37;
    font-weight: 500;
    margin-top: 4px;
    min-height: 18px;
}

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

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

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

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

/* 대기 상태 가이드 박스 */
.sav-waiting-guide {
    text-align: left;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
    max-width: 400px;
    margin: 0 auto;
}

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

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

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

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

/* ===== 메인 결과 (만기 수령액) ===== */
.sav-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;
    margin-bottom: 16px;
}

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

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

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

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

/* 복사 버튼 */
.sav-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;
}

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

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

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

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

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

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

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

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

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

.sav-detail-card.highlight {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08) 0%, rgba(46, 204, 113, 0.02) 100%);
    border-color: rgba(46, 204, 113, 0.35);
}

.sav-detail-card.highlight .sav-detail-label {
    color: #27ae60;
}

.sav-detail-card.highlight .sav-detail-label i {
    color: #27ae60;
}

.sav-detail-card.highlight .sav-detail-value {
    color: #27ae60;
}

/* ===== 예금 vs 적금 비교 ===== */
.sav-comparison-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.sav-comparison-title i {
    color: #d4af37;
}

.sav-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sav-comparison-item {
    text-align: center;
    padding: 14px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
}

.sav-comparison-item.current {
    background: rgba(212, 175, 55, 0.08);
    border-color: #d4af37;
}

.sav-comparison-type {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
    margin-bottom: 6px;
}

.sav-comparison-item.current .sav-comparison-type {
    color: #d4af37;
}

.sav-comparison-amount {
    font-size: 20px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 4px;
}

.sav-comparison-item.current .sav-comparison-amount {
    color: #d4af37;
}

.sav-comparison-detail {
    font-size: 11px;
    color: #a09a94;
}

/* ===== 72법칙 정보 카드 ===== */
.sav-rule72-section {
    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: 16px;
    margin-bottom: 16px;
}

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

.sav-rule72-content {
    font-size: 13px;
    color: #5f5a56;
    line-height: 1.6;
}

.sav-rule72-content strong {
    color: #3498db;
    font-weight: 700;
}


/* ===== 이자 방식 비교 ===== */
.sav-interest-comparison {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.sav-interest-comparison-title i {
    color: #d4af37;
}

.sav-interest-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sav-interest-type {
    text-align: center;
    padding: 14px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
}

.sav-interest-type.active {
    background: rgba(212, 175, 55, 0.08);
    border-color: #d4af37;
}

.sav-interest-type-label {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
    margin-bottom: 6px;
}

.sav-interest-type.active .sav-interest-type-label {
    color: #d4af37;
}

.sav-interest-type-value {
    font-size: 20px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 4px;
}

.sav-interest-type.active .sav-interest-type-value {
    color: #d4af37;
}

.sav-interest-type-detail {
    font-size: 11px;
    color: #a09a94;
}

/* ===== 월별 상세표 ===== */
.sav-monthly-table-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.sav-monthly-table-title i {
    color: #d4af37;
}

.sav-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

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

.sav-monthly-table th,
.sav-monthly-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #f0ede8;
}

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

.sav-monthly-table th:first-child,
.sav-monthly-table td:first-child {
    text-align: center;
}

.sav-monthly-table td {
    color: #2d2a26;
}

.sav-monthly-table tr:last-child td {
    border-bottom: none;
    font-weight: 600;
    background: rgba(212, 175, 55, 0.08);
    color: #d4af37;
}

.sav-monthly-table tr:hover:not(:last-child) {
    background: #faf9f7;
}

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

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

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

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .sav-detail-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .sav-comparison-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .sav-interest-types {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

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

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

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

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

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

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

    .sav-comparison-amount {
        font-size: 18px;
    }

    .sav-interest-type-value {
        font-size: 18px;
    }

    .sav-chart-container {
        height: 200px;
    }

    .sav-chart-container canvas {
        max-height: 200px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    .sav-input-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sav-quick-btns {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

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

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

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

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

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

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

    .sav-comparison-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sav-interest-types {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .sav-chart-container {
        height: 180px;
    }

    .sav-chart-container canvas {
        max-height: 180px;
    }

    .sav-monthly-table {
        font-size: 11px;
    }

    .sav-monthly-table th,
    .sav-monthly-table td {
        padding: 8px 4px;
    }
}
