/**
 * Youth Monthly Rent Support Calculator Styles
 * 청년월세지원 지급액/수급기간 계산기
 *
 * @package Zipper
 */

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

.yms-main-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.yms-input-col {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#ymsResultCol,
.yms-result-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 100%;
    box-sizing: border-box;
    visibility: visible;
}

.yms-section,
.yms-result-summary,
.yms-chart-section,
.yms-table-section,
.yms-criteria-section,
.yms-schedule-section,
.yms-apply-section,
.yms-waiting-card {
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    max-width: 100%;
    box-sizing: border-box;
    transition: box-shadow 0.2s ease;
}

.yms-section:hover,
.yms-result-summary:hover,
.yms-chart-section:hover,
.yms-table-section:hover,
.yms-criteria-section:hover,
.yms-schedule-section:hover,
.yms-apply-section:hover,
.yms-waiting-card:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

.yms-section-title,
.yms-block-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
}

.yms-section-title i,
.yms-block-title i {
    color: #d4af37;
}

.yms-input-group {
    margin-bottom: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

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

.yms-input-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.yms-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.yms-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    color: #5f5a56;
}

.yms-select,
.yms-input,
.yms-input-group input[type="number"],
.yms-input-group input[type="date"],
.yms-input-group input[type="text"],
.yms-input-group select,
#ymsYear,
#ymsBirthYear,
#ymsApplyDate,
#ymsDeposit,
#ymsMonthlyRent,
#ymsCurrentRoundReceived,
#ymsPriorRoundReceived {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    color: #2d2a26;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.yms-select,
.yms-input-group select,
#ymsYear,
#ymsBirthYear,
#ymsCurrentRoundReceived,
#ymsPriorRoundReceived {
    padding: 10px 34px 10px 12px;
    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='%236f6758' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.yms-input,
.yms-input-group input[type="number"],
.yms-input-group input[type="date"],
.yms-input-group input[type="text"],
#ymsApplyDate,
#ymsDeposit,
#ymsMonthlyRent {
    padding: 10px 12px;
}

.yms-input-wrap,
.yms-amount-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.yms-input-wrap .yms-input,
.yms-input-wrap input[type="number"],
.yms-input-wrap input[type="text"],
.yms-input-wrap #ymsDeposit,
.yms-input-wrap #ymsMonthlyRent,
.yms-amount-wrap .yms-input,
.yms-amount-wrap input[type="number"],
.yms-amount-wrap input[type="text"],
.yms-amount-wrap #ymsDeposit,
.yms-amount-wrap #ymsMonthlyRent {
    padding-right: 12px;
    text-align: right;
    font-weight: 600;
}

.yms-unit {
    position: static;
    pointer-events: none;
    font-size: 12px;
    color: #948d80;
    white-space: nowrap;
}

.yms-select:hover,
.yms-input:hover,
.yms-input-group input[type="number"]:hover,
.yms-input-group input[type="date"]:hover,
.yms-input-group input[type="text"]:hover,
.yms-input-group select:hover,
#ymsYear:hover,
#ymsBirthYear:hover,
#ymsApplyDate:hover,
#ymsDeposit:hover,
#ymsMonthlyRent:hover,
#ymsCurrentRoundReceived:hover,
#ymsPriorRoundReceived:hover {
    border-color: #d4c67a;
}

.yms-select:focus,
.yms-input:focus,
.yms-input-group input[type="number"]:focus,
.yms-input-group input[type="date"]:focus,
.yms-input-group input[type="text"]:focus,
.yms-input-group select:focus,
#ymsYear:focus,
#ymsBirthYear:focus,
#ymsApplyDate:focus,
#ymsDeposit:focus,
#ymsMonthlyRent:focus,
#ymsCurrentRoundReceived:focus,
#ymsPriorRoundReceived:focus {
    outline: none;
    border-color: #d4af37;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.yms-hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #7f786b;
}

.yms-radio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.yms-radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.yms-radio-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.yms-radio-inline label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    color: #5f5a56;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
}

.yms-radio-inline input[type="radio"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}

.yms-radio-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid #ddd7cb;
    border-radius: 8px;
    background: #fbfaf8;
    padding: 10px;
    min-height: 44px;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.45;
    color: #5f5a56;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: keep-all;
}

.yms-radio-label input[type="radio"] {
    margin-top: 2px;
    width: auto;
    flex-shrink: 0;
}

.yms-radio-label span {
    flex: 1;
    min-width: 0;
    display: block;
    white-space: normal;
}

.yms-radio-label.active {
    border-color: #d4af37;
    background: #fff9ea;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.08);
}

.yms-btn-group {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.yms-btn,
#ymsCalcBtn,
#ymsResetBtn {
    min-height: 44px;
    border-radius: 10px;
    padding: 11px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.yms-btn-primary,
#ymsCalcBtn {
    flex: 1;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #c49520 100%);
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.26);
}

.yms-btn-primary:hover,
#ymsCalcBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.34);
}

.yms-btn-ghost,
#ymsResetBtn {
    color: #5f5a56;
    border-color: #dfd8cb;
    background: #f5f3ef;
}

.yms-btn-ghost:hover,
#ymsResetBtn:hover {
    background: #fff;
    border-color: #d4c67a;
}

#ymsWaiting,
.yms-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 170px;
    text-align: center;
    color: #7f786b;
    font-size: 13px;
    line-height: 1.55;
}

#ymsWaiting i,
.yms-waiting i {
    font-size: 32px;
    color: #d4af37;
    opacity: 0.42;
}

#ymsWaitingText,
.yms-waiting-text {
    margin: 0;
}

#ymsWaiting.yms-hidden,
.yms-waiting.yms-hidden {
    display: none !important;
}

.yms-result-summary {
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.12);
}

#ymsSummaryBadge,
.yms-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.18);
    color: #7b6521;
    font-size: 12px;
    font-weight: 700;
}

#ymsSummaryTitle,
.yms-summary-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.45;
    font-weight: 700;
    color: #2d2a26;
}

#ymsMainValue,
.yms-main-value {
    margin: 8px 0;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #b58913;
}

#ymsSummaryNote,
.yms-summary-note {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.55;
    color: #6d665c;
}

.yms-summary-grid,
.yms-metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.yms-summary-card,
.yms-metric-item {
    border: 1px solid #e7ddc4;
    border-radius: 9px;
    background: #fff;
    padding: 11px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 88px;
}

.yms-summary-label,
.yms-metric-label {
    font-size: 12px;
    font-weight: 600;
    color: #7a7266;
}

.yms-summary-value,
.yms-metric-item strong,
#ymsMetricMonthly,
#ymsMetricMonths,
#ymsMetricTotal,
#ymsMetricStatus,
#ymsMetricCumulative,
#ymsMetricRemainingWindow {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #2d2a26;
}

.yms-summary-card.is-kpi .yms-summary-value,
.yms-metric-item.is-kpi strong {
    font-size: 22px;
    color: #b58913;
}

.yms-summary-card.is-pass,
.yms-metric-item.is-pass {
    border-color: #7bb489;
    background: #f2fbf4;
}

.yms-summary-card.is-fail,
.yms-metric-item.is-fail {
    border-color: #de9a9a;
    background: #fff4f4;
}

.yms-block-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.yms-block-sub {
    margin: 0;
    font-size: 11px;
    line-height: 1.45;
    color: #8f897f;
}

.yms-chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
    min-height: 260px;
}

#ymsChartCanvas,
.yms-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

#ymsChartFallback,
.yms-chart-fallback {
    margin-top: 10px;
    border: 1px dashed #d9cda8;
    border-radius: 8px;
    background: #fffdf3;
    color: #7f755f;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 12px;
}

.yms-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.yms-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
}

.yms-table th,
.yms-table td {
    border: 1px solid #ece7da;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #2d2a26;
    text-align: left;
    vertical-align: top;
}

.yms-table th {
    background: #f7f3e8;
    color: #5f584c;
    font-weight: 700;
}

.yms-table tbody tr:nth-child(even) td {
    background: #fcfaf4;
}

#ymsCriteriaTableBody tr td,
#ymsScheduleTableBody tr td {
    color: #3a352f;
}

.yms-empty-row td,
#ymsCriteriaTableBody tr.yms-empty-row td,
#ymsScheduleTableBody tr.yms-empty-row td {
    text-align: center;
    color: #7a7367;
    padding: 14px 10px;
    background: #fffdf8;
}

.yms-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 700;
}

.yms-pill-pass,
.yms-status-pass {
    color: #1f6f46;
    background: #edf8f1;
    border: 1px solid #b8ddc5;
    font-weight: 700;
}

.yms-pill-fail,
.yms-status-fail {
    color: #a94b2a;
    background: #fff2ee;
    border: 1px solid #efc6bb;
    font-weight: 700;
}

.yms-pill-warn,
.yms-status-info {
    color: #8a6a10;
    background: #fff8e7;
    border: 1px solid #ecd9a7;
    font-weight: 700;
}

.yms-table-note {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.45;
    color: #8f897f;
}

#ymsDownloadBtn,
.yms-download-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 10px;
}

#ymsDownloadBtn.tool-btn.tool-btn-excel,
.yms-download-btn.tool-btn.tool-btn-excel {
    color: #fff;
    background: linear-gradient(135deg, #59ab79 0%, #4f9f70 100%);
    border-color: #4f9f70;
    box-shadow: 0 2px 6px rgba(63, 153, 98, 0.28);
}

#ymsDownloadBtn.tool-btn.tool-btn-excel:hover,
.yms-download-btn.tool-btn.tool-btn-excel:hover {
    background: linear-gradient(135deg, #4f9f70 0%, #458b63 100%);
    border-color: #458b63;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(54, 137, 86, 0.34);
}

.yms-apply-links,
.yms-apply-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yms-apply-list {
    margin: 0;
    padding-left: 18px;
}

.yms-apply-link,
.yms-apply-list a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #8a6a10;
    text-decoration: none;
}

.yms-apply-link:hover,
.yms-apply-list a:hover {
    color: #6f530a;
    text-decoration: underline;
}

.yms-apply-hint,
#ymsApplyHint {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: #6d6659;
}

#ymsDisclaimer,
.yms-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid #eadfbf;
    border-radius: 12px;
    background: #fffdf6;
    padding: 12px 14px;
    color: #7c7057;
    font-size: 12px;
    line-height: 1.55;
}

#ymsDisclaimer i,
.yms-disclaimer i {
    margin-top: 1px;
    flex-shrink: 0;
    color: #d4af37;
    font-size: 14px;
}

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

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

    .yms-select,
    .yms-input,
    .yms-input-group input:not([type="radio"]):not([type="checkbox"]),
    .yms-input-group select {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .yms-section,
    .yms-result-summary,
    .yms-chart-section,
    .yms-table-section,
    .yms-criteria-section,
    .yms-schedule-section,
    .yms-apply-section,
    .yms-waiting-card {
        padding: 14px;
    }

    .yms-input-row,
    .yms-grid-2,
    .yms-summary-grid,
    .yms-metric-grid {
        grid-template-columns: 1fr;
    }

    .yms-block-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .yms-btn-group {
        flex-direction: column;
    }

    #ymsDownloadBtn,
    .yms-download-btn,
    .yms-btn,
    #ymsCalcBtn,
    #ymsResetBtn {
        width: 100%;
        justify-content: center;
    }

    #ymsMainValue,
    .yms-main-value {
        font-size: 30px;
    }

    .yms-chart-wrap {
        height: 250px;
        min-height: 240px;
    }
}

@media (max-width: 480px) {
    .yms-main-layout,
    .yms-input-col,
    #ymsResultCol,
    .yms-result-col,
    .yms-section,
    .yms-result-summary,
    .yms-chart-section,
    .yms-table-section,
    .yms-criteria-section,
    .yms-schedule-section,
    .yms-apply-section,
    .yms-waiting-card {
        max-width: 100%;
    }

    .yms-radio-grid {
        grid-template-columns: 1fr;
    }

    .yms-radio-inline {
        flex-direction: column;
    }

    .yms-radio-inline label {
        width: 100%;
    }

    #ymsSummaryTitle,
    .yms-summary-title {
        font-size: 16px;
    }

    #ymsMainValue,
    .yms-main-value {
        font-size: 27px;
    }

    .yms-summary-value,
    #ymsMetricMonthly,
    #ymsMetricMonths,
    #ymsMetricTotal,
    #ymsMetricStatus,
    #ymsMetricCumulative,
    #ymsMetricRemainingWindow {
        font-size: 16px;
    }

    .yms-summary-card.is-kpi .yms-summary-value {
        font-size: 19px;
    }

    .yms-table {
        min-width: 580px;
    }

    .yms-table th,
    .yms-table td {
        font-size: 11px;
        padding: 9px 10px;
    }

    .yms-chart-wrap {
        height: 220px;
        min-height: 210px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yms-section,
    .yms-result-summary,
    .yms-chart-section,
    .yms-table-section,
    .yms-criteria-section,
    .yms-schedule-section,
    .yms-apply-section,
    .yms-waiting-card,
    .yms-btn,
    #ymsCalcBtn,
    #ymsResetBtn,
    #ymsDownloadBtn,
    .yms-download-btn,
    .yms-select,
    .yms-input {
        transition: none !important;
    }

    .yms-btn-primary:hover,
    #ymsCalcBtn:hover,
    #ymsDownloadBtn.tool-btn.tool-btn-excel:hover,
    .yms-download-btn.tool-btn.tool-btn-excel:hover {
        transform: none;
    }
}
