/**
 * Deposit & Savings Interest Calculator Styles
 * Prefix: dsic
 *
 * @package Zipper
 */

/* ===== Layout (Self-grid, Rule 51: no max-width/margin:auto) ===== */
.dsic-main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    width: 100%;
}

.dsic-input-col {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    overflow: hidden;
}

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

/* ===== Tabs (3 tabs - flex, Rule 25) ===== */
.dsic-tabs {
    display: flex;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 16px;
}

.dsic-tab {
    flex: 1;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #7a756d;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

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

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

.dsic-tab i {
    font-size: 16px;
}

/* ===== Tab Content ===== */
.dsic-tab-content {
    display: none;
}

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

/* ===== Sections (Rule 44: individual margin-top) ===== */
.dsic-section {
    margin-top: 16px;
}

.dsic-section:first-child {
    margin-top: 0;
}

/* ===== Input Groups ===== */
.dsic-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    max-width: 100%;
}

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

.dsic-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dsic-input-group label i {
    color: #d4af37;
    font-size: 14px;
}

.dsic-input-group input[type="text"],
.dsic-input-group input[type="number"] {
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

/* Amount input (Rule 20) */
.dsic-amount-input {
    font-weight: 600;
}

/* Korean amount display */
.dsic-korean-amount {
    font-size: 12px;
    color: #d4af37;
    font-weight: 500;
    min-height: 18px;
    padding-left: 2px;
}

/* ===== Quick Buttons ===== */
.dsic-quick-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
    max-width: 100%;
}

.dsic-quick-btn {
    padding: 8px 4px;
    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;
}

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

/* ===== Interest Toggle ===== */
.dsic-interest-toggle {
    display: flex;
    gap: 6px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
}

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

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

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

/* ===== Tax Options (Rule 32: radio excluded from width:100%) ===== */
.dsic-tax-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

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

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

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

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

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

/* ===== Goal Reversal ===== */
.dsic-goal-toggle-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #7a756d;
    background: #faf9f7;
    border: 1px dashed #e8e4dc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.dsic-goal-toggle-btn i {
    font-size: 14px;
}

.dsic-chevron {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 12px !important;
}

.dsic-goal-toggle-btn.open .dsic-chevron {
    transform: rotate(180deg);
}

.dsic-goal-panel {
    display: none;
    margin-top: 10px;
    padding: 14px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
}

.dsic-goal-panel.open {
    display: block;
}

.dsic-goal-calc-btn {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #3498db;
    background: rgba(52, 152, 219, 0.08);
    border: 1px solid rgba(52, 152, 219, 0.25);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.dsic-goal-calc-btn:hover {
    background: rgba(52, 152, 219, 0.15);
    border-color: #3498db;
}

.dsic-goal-result {
    margin-top: 10px;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #27ae60;
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 8px;
    display: none;
    text-align: center;
}

.dsic-goal-result.show {
    display: block;
}

/* ===== Action Buttons ===== */
.dsic-btn-group {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 20px;
}

.dsic-calculate-btn {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

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

.dsic-calculate-btn:active {
    transform: translateY(0);
}

.dsic-reset-btn {
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #7a756d;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* ===== Hidden Utility ===== */
.dsic-hidden {
    display: none !important;
}

/* ===== Waiting State (Rule 52) ===== */
.dsic-waiting {
    text-align: center;
    padding: 60px 20px;
    color: #a09a94;
}

.dsic-waiting > i {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
    color: #d4af37;
    opacity: 0.6;
}

.dsic-waiting > p {
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
    color: #a09a94;
}

/* ===== Result Summary (Rule 49: border-radius:12px, gold) ===== */
.dsic-result-summary {
    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;
}

.dsic-result-label {
    font-size: 14px;
    color: #7a756d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dsic-result-label i {
    color: #d4af37;
}

.dsic-result-value {
    font-size: 42px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1.1;
}

.dsic-unit {
    font-size: 18px;
    font-weight: 600;
    color: #b8860b;
    margin-left: 2px;
}

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

/* ===== Detail Cards ===== */
.dsic-detail-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

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

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

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

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

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

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

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

/* Highlight card (green) */
.dsic-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);
}

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

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

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

/* ===== Schedule / Table Section ===== */
.dsic-schedule-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

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

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

.dsic-schedule-title i {
    color: #d4af37;
}

.dsic-download-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #27ae60;
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dsic-download-btn:hover {
    background: rgba(46, 204, 113, 0.15);
    border-color: #27ae60;
}

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

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

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

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

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

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

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

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

/* ===== Compare Summary ===== */
.dsic-compare-summary {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
}

.dsic-compare-summary-title {
    font-size: 15px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.dsic-compare-summary-title i {
    color: #d4af37;
}

.dsic-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dsic-compare-card {
    text-align: center;
    padding: 20px 16px;
    border-radius: 12px;
    border: 1px solid #e8e4dc;
    background: #faf9f7;
}

.dsic-deposit-card {
    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.3);
}

.dsic-savings-card {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(52, 152, 219, 0.02) 100%);
    border-color: rgba(52, 152, 219, 0.3);
}

.dsic-compare-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.dsic-deposit-card .dsic-compare-card-icon {
    color: #d4af37;
}

.dsic-savings-card .dsic-compare-card-icon {
    color: #3498db;
}

.dsic-compare-card-type {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dsic-deposit-card .dsic-compare-card-type {
    color: #b8860b;
}

.dsic-savings-card .dsic-compare-card-type {
    color: #2980b9;
}

.dsic-compare-card-label {
    font-size: 12px;
    color: #a09a94;
    margin-bottom: 4px;
}

.dsic-compare-card-amount {
    font-size: 22px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 6px;
}

.dsic-deposit-card .dsic-compare-card-amount {
    color: #d4af37;
}

.dsic-savings-card .dsic-compare-card-amount {
    color: #3498db;
}

.dsic-compare-card-sub {
    font-size: 12px;
    color: #7a756d;
}

/* ===== Chart Section (Rule 45: responsive) ===== */
.dsic-chart-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
}

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

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

.dsic-chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dsic-chart-item {
    text-align: center;
}

.dsic-chart-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 10px;
}

.dsic-chart-wrap {
    position: relative;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

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

/* ===== Conclusion ===== */
.dsic-conclusion-section {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    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;
}

.dsic-conclusion-icon {
    font-size: 24px;
    color: #27ae60;
    flex-shrink: 0;
    line-height: 1;
}

.dsic-conclusion-text {
    font-size: 14px;
    font-weight: 500;
    color: #2d2a26;
    line-height: 1.6;
}

/* ===== Rule 72 ===== */
.dsic-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;
}

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

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

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

/* ===== Disclaimer ===== */
.dsic-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    background: #faf9f7;
    border-radius: 8px;
    font-size: 12px;
    color: #a09a94;
    line-height: 1.5;
}

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

/* ===== Responsive: Tablet (900px) ===== */
@media (max-width: 900px) {
    .dsic-main-layout {
        grid-template-columns: 1fr;
    }

    .dsic-result-col {
        margin-top: 8px;
    }
}

/* ===== Responsive: Mobile (768px) ===== */
@media (max-width: 768px) {
    .dsic-main-layout {
        gap: 16px;
    }

    .dsic-result-value {
        font-size: 36px;
    }

    .dsic-unit {
        font-size: 16px;
    }

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

    .dsic-compare-card-amount {
        font-size: 18px;
    }

    .dsic-compare-card {
        padding: 14px 10px;
    }

    .dsic-chart-wrap {
        max-width: 160px;
    }
}

/* ===== Responsive: Small Mobile (480px) ===== */
@media (max-width: 480px) {
    .dsic-tabs {
        border-radius: 8px;
        padding: 3px;
    }

    .dsic-tab {
        padding: 10px 4px;
        font-size: 13px;
        gap: 4px;
    }

    .dsic-quick-btns {
        grid-template-columns: repeat(2, 1fr);
    }

    .dsic-result-summary {
        padding: 18px 14px;
    }

    .dsic-result-value {
        font-size: 30px;
    }

    .dsic-unit {
        font-size: 14px;
    }

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

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

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

    .dsic-compare-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dsic-chart-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dsic-chart-wrap {
        max-width: 180px;
    }

    .dsic-btn-group {
        grid-template-columns: 1fr;
    }

    .dsic-table {
        font-size: 11px;
    }

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

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .dsic-tab,
    .dsic-toggle-btn,
    .dsic-quick-btn,
    .dsic-tax-option,
    .dsic-calculate-btn,
    .dsic-reset-btn,
    .dsic-detail-card,
    .dsic-goal-toggle-btn,
    .dsic-goal-calc-btn,
    .dsic-download-btn,
    .dsic-chevron {
        transition: none;
    }

    .dsic-calculate-btn:hover {
        transform: none;
    }
}

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

