/**
 * Coefficient of Variation Calculator Styles
 * Coefficient of Variation Calculator styles
 *
 * @package Zipper
 */

.cvc-hidden,
.cvc-waiting[hidden] {
    display: none !important;
}

.cvc-intro {
    display: grid;
    gap: 10px;
}

.cvc-lead {
    margin: 0 0 4px;
    font-size: 15px;
    line-height: 1.7;
    color: #5f5a56;
}

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

#cvcCalculator .tool-layout-input {
    max-width: 360px;
}

#cvcCalculator .tool-layout-input,
#cvcCalculator .tool-layout-result,
.cvc-support-grid,
.cvc-kpi-grid,
.cvc-table-wrap,
.cvc-band-section,
.cvc-band-wrap,
.cvc-input-grid,
.cvc-field-grid,
.cvc-amount-row,
.cvc-inline-card {
    min-width: 0;
}

.cvc-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #e8e4dc;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.cvc-preset-section,
.cvc-tip-section {
    background: #fffdf9;
}

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

.cvc-section-title,
.cvc-note-title,
.cvc-inline-card-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: #2d2a26;
}

.cvc-section-title i,
.cvc-live-pill i,
.cvc-waiting i,
.cvc-disclaimer i,
.cvc-note-title::before {
    color: #d4af37;
}

.cvc-live-pill,
.cvc-unit-chip,
.cvc-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.cvc-live-pill,
.cvc-unit-chip {
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
}

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

.cvc-mode-tab,
.cvc-preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cvc-preset-btn {
    width: auto;
    min-height: 38px;
    padding: 9px 14px;
    background: #fff;
}

.cvc-mode-tab:hover,
.cvc-mode-tab:focus,
.cvc-preset-btn:hover,
.cvc-preset-btn:focus {
    outline: none;
    border-color: #d4af37;
    color: #8a6500;
    background: rgba(212, 175, 55, 0.12);
}

.cvc-mode-tab.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(212, 175, 55, 0.18);
}

.cvc-mode-help,
.cvc-input-hint,
.cvc-inline-card-help,
.cvc-note-text,
.cvc-band-note,
.cvc-hero-summary {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #7a756d;
}

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

.cvc-textarea,
.cvc-input,
.cvc-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    color: #2d2a26;
    font-size: 15px;
    font-weight: 500;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cvc-textarea {
    min-height: 188px;
    resize: vertical;
    line-height: 1.6;
}

.cvc-textarea:hover,
.cvc-input:hover,
.cvc-select:hover {
    border-color: #d4c67a;
}

.cvc-textarea:focus,
.cvc-input:focus,
.cvc-select:focus,
.cvc-copy-btn:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.cvc-textarea::placeholder,
.cvc-input::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

.cvc-input-grid,
.cvc-field-grid,
.cvc-kpi-grid,
.cvc-support-grid {
    display: grid;
    gap: 12px;
}

.cvc-input-grid,
.cvc-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cvc-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cvc-support-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cvc-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

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

.cvc-select-row .cvc-select {
    min-width: 0;
}

.cvc-inline-card {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid #eadfb8;
    border-radius: 12px;
    background: linear-gradient(135deg, #fffaf0 0%, #fffdf8 100%);
}

.cvc-inline-card-value {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    color: #8a6500;
}

#cvcCalculator .cvc-btn-row.is-realtime {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

#cvcCalculator .cvc-btn-row.is-realtime .tool-btn {
    width: 100%;
}

.cvc-preset-list,
.cvc-tip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

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

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

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

.cvc-status-badge.is-valid {
    background: rgba(212, 175, 55, 0.18);
    color: #8a6500;
}

.cvc-status-badge.is-warning {
    background: rgba(211, 92, 57, 0.12);
    color: #b14622;
}

.cvc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cvc-copy-btn:hover,
.cvc-copy-btn:focus {
    border-color: #d4af37;
    color: #8a6500;
    background: rgba(212, 175, 55, 0.12);
}

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

.cvc-hero-label {
    font-size: 15px;
    font-weight: 700;
    color: #8a6500;
}

.cvc-formula-box {
    padding: 12px 14px;
    border: 1px dashed #d9c98b;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    line-height: 1.6;
    color: #5f5a56;
}

.cvc-kpi-card,
.cvc-band-section,
.cvc-note-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.05);
}

.cvc-kpi-card {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 16px;
}

.cvc-kpi-label,
.cvc-band-scale,
.cvc-summary-table th,
.cvc-step-list,
.cvc-disclaimer {
    font-size: 12px;
    color: #7a756d;
}

.cvc-kpi-value {
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: #2d2a26;
    word-break: break-word;
}

.cvc-band-section {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.cvc-band-track {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.08) 0%, rgba(212, 175, 55, 0.24) 100%);
    overflow: hidden;
}

.cvc-band-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #eedeb0 0%, #d4af37 100%);
    transition: width 0.3s ease;
}

.cvc-band-marker {
    position: absolute;
    top: 50%;
    left: 0;
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #8a6500;
    box-shadow: 0 2px 10px rgba(45, 42, 38, 0.18);
    transform: translate(-50%, -50%);
    transition: left 0.3s ease;
}

.cvc-band-scale {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-weight: 700;
}

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

.cvc-summary-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
}

.cvc-summary-table tr + tr {
    border-top: 1px solid #f0ece5;
}

.cvc-summary-table th,
.cvc-summary-table td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}

.cvc-summary-table th {
    width: 36%;
    font-weight: 700;
}

.cvc-summary-table td {
    font-size: 14px;
    color: #2d2a26;
}

.cvc-step-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 18px;
    margin: 0;
    line-height: 1.7;
}

.cvc-note-card {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fffdf8 0%, #fffaf0 100%);
    border-color: #eadfb8;
}

.cvc-note-title::before {
    content: '•';
    font-size: 16px;
}

.cvc-waiting {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 32px 20px;
    border: 1px dashed #eadfb8;
    border-radius: 14px;
    background: #fffdf9;
    color: #9e9a96;
}

.cvc-waiting i {
    display: block;
    font-size: 32px;
    margin-bottom: 4px;
    opacity: 0.42;
}

.cvc-waiting.is-error {
    border-color: rgba(211, 92, 57, 0.25);
    background: rgba(255, 245, 242, 0.8);
}

.cvc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    line-height: 1.6;
}

@media (max-width: 1080px) {
    .cvc-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    #cvcCalculator .tool-layout-input {
        max-width: 100%;
        overflow: hidden;
    }

    .cvc-input, .cvc-select {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    #cvcCalculator .tool-layout-split,
    .cvc-support-grid,
    .cvc-input-grid,
    .cvc-field-grid,
    .cvc-kpi-grid,
    .cvc-mode-tabs,
    .cvc-btn-row.is-realtime {
        grid-template-columns: 1fr;
    }

    .cvc-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cvc-hero-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .cvc-status-badge {
        max-width: 100%;
        white-space: normal;
    }
}

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

    .cvc-section,
    .cvc-band-section,
    .cvc-result-hero,
    .cvc-kpi-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    .cvc-kpi-grid {
        grid-template-columns: 1fr;
    }

    .cvc-summary-table th,
    .cvc-summary-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }

    .cvc-summary-table th {
        padding-bottom: 4px;
    }

    .cvc-summary-table td {
        padding-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cvc-section,
    .cvc-mode-tab,
    .cvc-preset-btn,
    .cvc-copy-btn,
    .cvc-band-fill,
    .cvc-band-marker,
    .cvc-textarea,
    .cvc-input,
    .cvc-select {
        transition: none !important;
    }
}
