/**
 * Factorial Calculator Styles
 * 팩토리얼 계산기 전용 스타일
 *
 * @package Zipper
 */

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

.factc-intro {
    display: grid;
    gap: 8px;
}

#factcCalculator .tool-layout-split {
    grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

#factcCalculator .tool-layout-input {
    max-width: 350px;
}

.factc-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #5f5a56;
}

.factc-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.factc-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.factc-section-title,
.factc-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
}

.factc-section-title i,
.factc-subtitle i,
.factc-live-pill i,
.factc-disclaimer i {
    color: #d4af37;
}

.factc-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.factc-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
    box-sizing: border-box;
}

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

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

.factc-amount-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 46px;
    padding: 11px 13px;
    font-size: 15px;
    font-weight: 500;
    color: #2d2a26;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.factc-amount-input:hover {
    border-color: #d4c67a;
}

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

.factc-amount-input::placeholder {
    color: #c4c0bc;
}

.factc-unit-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 9px;
    border: 1px solid #e8e4dc;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.factc-input-hint {
    font-size: 12px;
    line-height: 1.5;
    color: #7a756d;
}

.factc-preset-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.factc-preset-btn {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #fff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.factc-preset-btn:hover,
.factc-preset-btn.is-active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
}

.factc-btn-group {
    display: grid;
    gap: 8px;
}

.factc-btn-group .tool-btn {
    width: 100%;
}

.factc-tip-section {
    gap: 12px;
}

.factc-tip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding-left: 18px;
    color: #5f5a56;
    font-size: 14px;
    line-height: 1.6;
}

.factc-waiting {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 16px;
    border: 1px solid #f1d6bf;
    border-radius: 12px;
    background: #fff8f1;
    color: #9e6f46;
    text-align: center;
}

.factc-waiting i {
    font-size: 28px;
    opacity: 0.72;
}

.factc-waiting p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.factc-result-hero {
    display: grid;
    gap: 10px;
    background: linear-gradient(135deg, #fdfbf5 0%, #faf6ec 100%);
    border: 1px solid #eadfb8;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(212, 175, 55, 0.14);
}

.factc-result-hero.is-large {
    border-color: rgba(93, 112, 175, 0.28);
    box-shadow: 0 10px 24px rgba(93, 112, 175, 0.12);
}

.factc-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.factc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.14);
    color: #8a6500;
    font-size: 12px;
    font-weight: 700;
}

.factc-status-badge.is-example {
    background: rgba(212, 175, 55, 0.14);
    color: #8a6500;
}

.factc-status-badge.is-valid {
    background: rgba(66, 138, 92, 0.14);
    color: #2d7a4e;
}

.factc-status-badge.is-large {
    background: rgba(93, 112, 175, 0.16);
    color: #4054a8;
}

.factc-status-badge.is-warning {
    background: rgba(220, 80, 80, 0.12);
    color: #b34242;
}

.factc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 10px;
    background: #fff;
    color: #8a6500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.factc-copy-btn:hover {
    transform: translateY(-1px);
    border-color: #d4af37;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.16);
}

.factc-hero-expression {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    font-weight: 700;
    color: #8a6500;
}

.factc-hero-value {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.08;
    font-weight: 800;
    color: #1f1a15;
    word-break: break-all;
}

.factc-hero-label {
    font-size: 13px;
    font-weight: 700;
    color: #8a7a48;
    letter-spacing: 0.02em;
}

.factc-hero-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: #5f5a56;
}

.factc-formula-box {
    padding: 12px 14px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #4a4338;
    word-break: break-all;
}

.factc-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.factc-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ebe4d3;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 600;
}

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

.factc-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 14px 15px;
    border-radius: 12px;
    border: 1px solid #ece7db;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.05);
}

.factc-kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: #8a7a48;
}

.factc-kpi-value {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: #2d2a26;
    word-break: break-word;
}

.factc-kpi-value-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 16px;
}

.factc-result-dual {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.factc-exact-value,
.factc-expansion-box {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid #ebe4d3;
    border-radius: 12px;
    background: #faf9f7;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.65;
    color: #2d2a26;
}

.factc-exact-value {
    max-height: 240px;
    overflow: auto;
    word-break: break-all;
}

.factc-expansion-box {
    word-break: break-word;
}

.factc-section-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #7a756d;
}

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

.factc-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    background: #fff;
}

.factc-table th,
.factc-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #eee7dc;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.55;
    color: #3b342c;
}

.factc-table th {
    font-weight: 700;
    color: #8a7a48;
    background: #faf7f1;
}

.factc-table tbody tr:last-child td {
    border-bottom: 0;
}

.factc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 13px 14px;
    border-radius: 12px;
    background: #f7f4ed;
    color: #6f665b;
    font-size: 12px;
    line-height: 1.6;
}

.factc-disclaimer span {
    min-width: 0;
}

@media (max-width: 1080px) {
    #factcCalculator .tool-layout-split,
    .factc-result-dual {
        grid-template-columns: 1fr;
    }

    #factcCalculator .tool-layout-input {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .factc-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .factc-preset-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .factc-amount-input:not([type="radio"]):not([type="checkbox"]) {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .factc-hero-top {
        flex-wrap: wrap;
    }

    .factc-hero-value {
        font-size: 30px;
    }

    .factc-section,
    .factc-result-hero {
        padding: 16px;
    }

    .factc-table {
        min-width: 360px;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .tool-layout-split,
    .tool-layout-input,
    .tool-layout-result {
        max-width: 100%;
        overflow-x: hidden;
    }

    .factc-preset-list,
    .factc-kpi-grid {
        grid-template-columns: 1fr;
    }

    .factc-table {
        min-width: 320px;
    }

    .factc-exact-value {
        max-height: 200px;
    }
}
