/**
 * Long-term Care Calculator (장기요양비용 계산기)
 * 2026년 기준 수가 적용
 *
 * @package Zipper
 */

/* ==========================================================================
   Layout
   ========================================================================== */

.ltc-main-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

/* ==========================================================================
   Input Column
   ========================================================================== */

.ltc-input-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 20px;
    align-self: start;
}

@media (max-width: 900px) {
    .ltc-input-col {
        position: static;
    }
}

/* Tabs */
.ltc-tabs {
    display: flex;
    background: #f5f0e1;
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

.ltc-tab-btn {
    flex: 1;
    padding: 9px 10px;
    border: none;
    background: transparent;
    color: #8b8475;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.ltc-tab-btn i {
    font-size: 13px;
}

.ltc-tab-btn.active {
    background: #fff;
    color: #5c5647;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.ltc-tab-btn:hover:not(.active) {
    color: #5c5647;
    background: rgba(255, 255, 255, 0.4);
}

/* Tab Panels */
.ltc-tab-panel {
    display: none;
}

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

/* Section */
.ltc-section {
    background: #fffdf5;
    border: 1px solid #e8e0c8;
    border-radius: 12px;
    padding: 14px;
}

.ltc-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #5c5647;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* Input Group */
.ltc-input-group {
    margin-bottom: 10px;
}

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

.ltc-input-label {
    font-size: 13px;
    color: #6b6459;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ltc-input-label .unit {
    font-size: 11px;
    color: #8b8475;
}

/* Select */
.ltc-select {
    width: 100%;
    padding: 9px 32px 9px 10px;
    border: 1px solid #d4cbb8;
    border-radius: 8px;
    background: #fff;
    color: #2d2a26;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    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 fill='%238b8475' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

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

/* Grade Info */
.ltc-grade-info {
    margin-top: 6px;
    padding: 8px 10px;
    background: #f9f6ef;
    border: 1px solid #e8e0c8;
    border-radius: 8px;
    font-size: 12px;
    color: #6b6459;
    line-height: 1.5;
    display: none;
}

.ltc-grade-info.show {
    display: block;
}

.ltc-grade-info .ltc-grade-score {
    color: #d4af37;
    font-weight: 600;
}

.ltc-grade-info .ltc-grade-limit {
    color: #5c5647;
    font-weight: 600;
}

/* Radio Group */
.ltc-radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ltc-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e8e0c8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #5c5647;
}

.ltc-radio-label:hover {
    border-color: #d4af37;
    background: #fffdf5;
}

.ltc-radio-label input[type="radio"] {
    accent-color: #d4af37;
    margin: 0;
}

.ltc-radio-desc {
    font-size: 11px;
    color: #8b8475;
    margin-left: auto;
}

/* Checkbox Group */
.ltc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ltc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e8e0c8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #5c5647;
}

.ltc-checkbox-label:hover {
    border-color: #d4af37;
    background: #fffdf5;
}

.ltc-checkbox-label input[type="checkbox"] {
    accent-color: #d4af37;
    margin-top: 2px;
    flex-shrink: 0;
}

.ltc-checkbox-label.checked {
    border-color: #d4af37;
    background: #fffdf5;
}

.ltc-checkbox-text {
    flex: 1;
}

.ltc-checkbox-text .ltc-cb-name {
    font-weight: 500;
}

.ltc-checkbox-text .ltc-cb-desc {
    font-size: 11px;
    color: #8b8475;
    display: block;
    margin-top: 2px;
}

/* Service Options (sub-options under checkbox) */
.ltc-service-options {
    display: none;
    padding: 10px;
    margin-top: 8px;
    background: #f9f6ef;
    border: 1px solid #e8e0c8;
    border-radius: 8px;
}

.ltc-service-options.show {
    display: block;
    margin-bottom: 4px;
}

.ltc-service-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ltc-service-row:last-child {
    margin-bottom: 0;
}

.ltc-service-row label {
    font-size: 12px;
    color: #6b6459;
    min-width: 60px;
}

.ltc-service-row select,
.ltc-service-row input[type="number"] {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #d4cbb8;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    color: #2d2a26;
    box-sizing: border-box;
    max-width: 120px;
}

.ltc-service-row select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%238b8475' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 22px;
    max-width: 140px;
}

.ltc-service-row .ltc-row-unit {
    font-size: 12px;
    color: #8b8475;
    white-space: nowrap;
}

/* Amount Input */
.ltc-amount-input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d4cbb8;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: #2d2a26;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.ltc-amount-input::placeholder {
    color: #b8b0a0;
}

.ltc-korean-amount {
    font-size: 11px;
    color: #d4af37;
    font-weight: 500;
    margin-top: 3px;
    min-height: 16px;
}

/* Non-covered items */
.ltc-noncovered-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ltc-noncovered-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #e8e0c8;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #5c5647;
    transition: all 0.2s ease;
}

.ltc-noncovered-label:hover {
    border-color: #d4af37;
}

.ltc-noncovered-label input[type="checkbox"] {
    accent-color: #d4af37;
    margin: 0;
    flex-shrink: 0;
}

.ltc-noncovered-label .ltc-nc-cost {
    margin-left: auto;
    font-size: 11px;
    color: #8b8475;
    font-family: 'Roboto Mono', monospace;
}

/* Button Row */
.ltc-btn-group {
    display: flex;
    gap: 8px;
}

.ltc-calc-btn {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 16px;
    background: linear-gradient(135deg, #d4af37 0%, #c9a227 100%);
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.ltc-calc-btn i {
    font-size: 15px;
}

.ltc-reset-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px;
    border: 1px solid #d4cbb8;
    background: #fff;
    color: #6b6459;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ltc-reset-btn:hover {
    border-color: #d4af37;
    color: #5c5647;
}

/* ==========================================================================
   Result Column
   ========================================================================== */

.ltc-result-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Waiting */
.ltc-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: #fffdf5;
    border: 1px solid #e8e0c8;
    border-radius: 12px;
    gap: 8px;
}

.ltc-waiting i {
    font-size: 48px;
    color: #d4cbb8;
    margin-bottom: 8px;
}

.ltc-waiting .ltc-tips-list {
    margin-top: 8px;
}

.ltc-waiting p {
    font-size: 14px;
    color: #8b8475;
    line-height: 1.6;
    margin: 0;
}

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

/* Result Summary */
.ltc-result-section {
    background: #fffdf5;
    border: 1px solid #e8e0c8;
    border-radius: 12px;
    padding: 18px;
}

.ltc-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #5c5647;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ltc-result-title i {
    color: #d4af37;
}

/* Total Card */
.ltc-total-card {
    background: linear-gradient(135deg, #d4af37 0%, #c9a227 100%);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.ltc-total-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.ltc-total-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ltc-total-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.ltc-total-value {
    font-size: 30px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.ltc-total-unit {
    font-size: 15px;
    opacity: 0.9;
}

.ltc-total-sub {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

/* Limit Bar */
.ltc-limit-section {
    margin-bottom: 14px;
}

.ltc-limit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6b6459;
    margin-bottom: 6px;
}

.ltc-limit-value {
    font-weight: 600;
    color: #5c5647;
    font-family: 'Roboto Mono', monospace;
}

.ltc-limit-bar-wrap {
    background: #f5f0e1;
    border-radius: 8px;
    height: 20px;
    overflow: hidden;
    position: relative;
}

.ltc-limit-bar {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #d4af37, #e8c547);
    transition: width 0.5s ease;
    min-width: 2px;
}

.ltc-limit-bar.over {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.ltc-limit-percent {
    font-size: 11px;
    font-weight: 600;
    color: #5c5647;
    text-align: right;
    margin-top: 4px;
}

/* Over Limit Warning */
.ltc-over-warning {
    display: none;
    padding: 10px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #991b1b;
    line-height: 1.5;
}

.ltc-over-warning.show {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ltc-over-warning i {
    color: #ef4444;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Detail Grid */
.ltc-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ltc-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e8e0c8;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.ltc-detail-item:hover {
    border-color: #d4af37;
}

.ltc-detail-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ltc-detail-name {
    font-size: 13px;
    font-weight: 500;
    color: #5c5647;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ltc-detail-name i {
    font-size: 13px;
    color: #d4af37;
}

.ltc-detail-desc {
    font-size: 11px;
    color: #8b8475;
}

.ltc-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: #2d2a26;
    font-family: 'Roboto Mono', monospace;
    white-space: nowrap;
}

.ltc-detail-unit {
    font-size: 12px;
    color: #8b8475;
    font-weight: 400;
}

/* Yearly Summary */
.ltc-yearly-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e8e0c8;
}

.ltc-yearly-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9f6ef;
    border-radius: 8px;
}

.ltc-yearly-label {
    font-size: 13px;
    color: #6b6459;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ltc-yearly-label i {
    color: #d4af37;
    font-size: 13px;
}

.ltc-yearly-value {
    font-size: 15px;
    font-weight: 600;
    color: #5c5647;
    font-family: 'Roboto Mono', monospace;
}

/* ==========================================================================
   Chart Section
   ========================================================================== */

.ltc-chart-section {
    background: #fffdf5;
    border: 1px solid #e8e0c8;
    border-radius: 12px;
    padding: 18px;
}

.ltc-chart-title {
    font-size: 15px;
    font-weight: 600;
    color: #5c5647;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.ltc-chart-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

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

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

.ltc-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.ltc-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.ltc-legend-label {
    color: #6b6459;
    flex: 1;
}

.ltc-legend-value {
    font-weight: 600;
    color: #5c5647;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
}

@media (max-width: 480px) {
    .ltc-chart-row {
        flex-direction: column;
    }

    .ltc-donut-wrap {
        width: 160px;
        height: 160px;
    }
}

/* ==========================================================================
   Breakdown Table (Excel download section)
   ========================================================================== */

.ltc-breakdown-section {
    background: #fffdf5;
    border: 1px solid #e8e0c8;
    border-radius: 12px;
    padding: 18px;
}

.ltc-breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.ltc-breakdown-title {
    font-size: 15px;
    font-weight: 600;
    color: #5c5647;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ltc-breakdown-title i {
    color: #d4af37;
}

.ltc-download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #16a34a;
    background: #f0fdf4;
    color: #16a34a;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ltc-download-btn:hover {
    background: #16a34a;
    color: #fff;
}

.ltc-download-btn i {
    font-size: 13px;
}

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

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

.ltc-breakdown-table thead th {
    background: #f5f0e1;
    color: #5c5647;
    font-weight: 600;
    padding: 10px 12px;
    text-align: right;
    border-bottom: 2px solid #d4cbb8;
    white-space: nowrap;
}

.ltc-breakdown-table thead th:first-child {
    text-align: left;
    border-radius: 8px 0 0 0;
}

.ltc-breakdown-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.ltc-breakdown-table tbody td {
    padding: 9px 12px;
    text-align: right;
    border-bottom: 1px solid #e8e0c8;
    color: #2d2a26;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
}

.ltc-breakdown-table tbody td:first-child {
    text-align: left;
    font-weight: 500;
    font-family: inherit;
}

.ltc-breakdown-table tbody tr:hover {
    background: #fffbeb;
}

.ltc-breakdown-table tbody tr.ltc-row-total {
    background: #fef3c7;
    font-weight: 600;
}

/* ==========================================================================
   Tips Section
   ========================================================================== */

.ltc-tips-section {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 14px;
}

.ltc-tips-title {
    font-size: 13px;
    font-weight: 600;
    color: #0369a1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ltc-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ltc-tips-list li {
    font-size: 12px;
    color: #0c4a6e;
    line-height: 1.5;
    padding-left: 16px;
    position: relative;
}

.ltc-tips-list li::before {
    content: '\2022';
    position: absolute;
    left: 4px;
    color: #0284c7;
}

/* ==========================================================================
   Disclaimer
   ========================================================================== */

.ltc-disclaimer {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 12px;
}

.ltc-disclaimer i {
    color: #d97706;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.ltc-disclaimer-text {
    font-size: 12px;
    color: #92400e;
    line-height: 1.6;
}

.ltc-disclaimer-text strong {
    color: #78350f;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
    .ltc-total-value {
        font-size: 24px;
    }

    .ltc-detail-value {
        font-size: 13px;
    }

    .ltc-tab-btn {
        font-size: 12px;
        padding: 8px 6px;
    }

    .ltc-service-row {
        flex-wrap: wrap;
    }

    .ltc-service-row select,
    .ltc-service-row input[type="number"] {
        max-width: 100%;
    }

    .ltc-breakdown-table {
        font-size: 11px;
    }

    .ltc-breakdown-table thead th,
    .ltc-breakdown-table tbody td {
        padding: 8px 6px;
    }
}

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

