/**
 * Z-score Calculator Styles
 * Standardized score calculator styling for ToolZipper.
 *
 * @package Zipper
 */

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

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

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

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

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

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

.zsc-section:hover {
    box-shadow: 0 2px 8px rgba(45, 42, 38, 0.1);
}

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

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

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

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

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

.zsc-mode-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #fff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.zsc-input-grid-secondary {
    align-items: start;
}

.zsc-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

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

.zsc-select-row {
    align-items: center;
}

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

.zsc-amount-input:hover,
.zsc-select:hover {
    border-color: #d4c67a;
}

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

.zsc-amount-input::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

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

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

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

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

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

.zsc-btn-group {
    display: flex;
    gap: 8px;
}

.zsc-btn-group.is-realtime {
    display: grid;
}

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

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

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

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

.zsc-waiting.is-error {
    border-color: #f3c9c1;
    background: #fff6f4;
    color: #a0524d;
}

.zsc-waiting i {
    font-size: 28px;
    opacity: 0.75;
}

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

.zsc-result-hero {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 248, 228, 0.95), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.12);
}

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

.zsc-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.zsc-status-badge.is-example {
    background: rgba(95, 90, 86, 0.08);
    color: #5f5a56;
}

.zsc-status-badge.is-live {
    background: rgba(52, 131, 250, 0.12);
    color: #1e63c5;
}

.zsc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    color: #8a6500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zsc-copy-btn:hover {
    border-color: #d4af37;
    background: #fff;
    transform: translateY(-1px);
}

.zsc-hero-value {
    font-size: clamp(34px, 5vw, 48px);
    font-weight: 800;
    line-height: 1;
    color: #2d2a26;
    letter-spacing: -0.03em;
}

.zsc-hero-value .unit {
    margin-left: 4px;
    font-size: 0.36em;
    color: #8a6500;
    vertical-align: middle;
}

.zsc-hero-label {
    font-size: 13px;
    font-weight: 700;
    color: #8a6500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.zsc-hero-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #4f4b45;
}

.zsc-formula-box {
    padding: 10px 12px;
    border: 1px dashed rgba(212, 175, 55, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    color: #5f5a56;
    font-size: 13px;
    line-height: 1.6;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.zsc-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

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

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

.zsc-kpi-value {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: #2d2a26;
}

.zsc-scale-wrap {
    display: grid;
    gap: 10px;
}

.zsc-scale-track {
    position: relative;
    height: 16px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(90deg, #f1d6bf 0%, #f8e4b4 32%, #fff3d8 50%, #e3f0ff 68%, #cddffb 100%);
    border: 1px solid #e8e4dc;
}

.zsc-scale-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.7), rgba(52, 131, 250, 0.55));
}

.zsc-scale-marker {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #2d2a26;
    box-shadow: 0 3px 10px rgba(45, 42, 38, 0.18);
    transform: translate(-50%, -50%);
}

.zsc-scale-labels {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    font-size: 11px;
    color: #7a756d;
    text-align: center;
}

.zsc-scale-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #5f5a56;
}

.zsc-band-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}

.zsc-band-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ece7dd;
    background: #fff;
}

.zsc-band-card.is-current {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.18);
}

.zsc-band-z {
    font-size: 12px;
    font-weight: 700;
    color: #8a6500;
}

.zsc-band-score {
    font-size: 16px;
    font-weight: 700;
    color: #2d2a26;
}

.zsc-band-percentile {
    font-size: 12px;
    line-height: 1.4;
    color: #7a756d;
}

.zsc-table-wrap {
    overflow-x: auto;
}

.zsc-summary-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}

.zsc-summary-table th,
.zsc-summary-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee7dd;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.zsc-summary-table th {
    width: 34%;
    font-weight: 700;
    color: #5f5a56;
    background: #fcfaf7;
}

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

.zsc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    background: #fffdf7;
    color: #6c665f;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 960px) {
    #zscCalculator .tool-layout-split {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .zsc-mode-tabs,
    .zsc-preset-list,
    .zsc-kpi-grid {
        grid-template-columns: 1fr;
    }

    .zsc-section,
    .zsc-result-hero {
        padding: 14px;
    }

    .zsc-scale-labels {
        font-size: 10px;
    }

    .zsc-summary-table {
        min-width: 0;
    }
}
