/**
 * Average Calculator Styles
 * 평균 계산기 전용 스타일
 *
 * @package Zipper
 */

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

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

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

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

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

#avgcCalculator .tool-layout-input,
#avgcCalculator .tool-layout-result {
    min-width: 0;
}

.avgc-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);
}

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

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

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

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

.avgc-live-pill,
.avgc-table-pill,
.avgc-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;
}

.avgc-live-pill,
.avgc-table-pill,
.avgc-status-badge.is-valid {
    background: rgba(212, 175, 55, 0.12);
    color: #8a6500;
}

.avgc-status-badge.is-error {
    background: rgba(220, 50, 50, 0.12);
    color: #a23131;
}

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

.avgc-textarea,
.avgc-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;
}

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

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

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

.avgc-textarea::placeholder {
    color: #c4c0bc;
    font-weight: 400;
}

.avgc-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.avgc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.avgc-field-hint,
.avgc-inline-card-help,
.avgc-note-text {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #7a756d;
}

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

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

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

.avgc-btn-group .tool-btn {
    flex: 1 1 0;
}

.avgc-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avgc-preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #fff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.avgc-tip-list,
.avgc-step-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
    color: #5f5a56;
    line-height: 1.6;
}

.avgc-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.avgc-result-hero {
    display: grid;
    gap: 10px;
    padding: 18px 20px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.09) 100%);
    box-shadow: 0 10px 22px rgba(212, 175, 55, 0.12);
}

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

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

.avgc-copy-btn:hover,
.avgc-copy-btn:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: #d4af37;
    box-shadow: 0 8px 16px rgba(212, 175, 55, 0.15);
}

.avgc-hero-label-top,
.avgc-hero-label,
.avgc-hero-summary {
    margin: 0;
}

.avgc-hero-label-top {
    font-size: 13px;
    font-weight: 700;
    color: #8a6500;
}

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

.avgc-hero-label {
    font-size: 15px;
    font-weight: 700;
    color: #5f5a56;
}

.avgc-hero-summary {
    font-size: 14px;
    line-height: 1.7;
    color: #5f5a56;
}

.avgc-formula-box {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(212, 175, 55, 0.18);
    font-size: 14px;
    font-weight: 700;
    color: #6f5411;
    line-height: 1.5;
}

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

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

.avgc-kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: #7a756d;
}

.avgc-kpi-value {
    font-size: 18px;
    font-weight: 800;
    color: #2d2a26;
    line-height: 1.45;
    word-break: break-word;
}

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

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

.avgc-table-wrap-compact {
    overflow-x: auto;
}

.avgc-summary-table,
.avgc-values-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.avgc-summary-table th,
.avgc-summary-table td,
.avgc-values-table th,
.avgc-values-table td {
    padding: 11px 10px;
    border-bottom: 1px solid #f0ece6;
    text-align: left;
    vertical-align: top;
}

.avgc-summary-table th,
.avgc-values-table th {
    font-weight: 700;
    color: #5f5a56;
    background: #fbfaf7;
}

.avgc-summary-table td,
.avgc-values-table td {
    color: #2d2a26;
}

.avgc-values-table td.is-positive {
    color: #0f7c44;
    font-weight: 700;
}

.avgc-values-table td.is-negative {
    color: #b24141;
    font-weight: 700;
}

.avgc-values-table td.is-zero {
    color: #8a6500;
    font-weight: 700;
}

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

.avgc-note-title::before {
    content: '•';
}

.avgc-waiting {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 240px;
    padding: 28px 22px;
    border: 1px dashed #dfd7ca;
    border-radius: 16px;
    background: #fbfaf7;
    color: #7a756d;
    text-align: center;
}

.avgc-waiting i {
    font-size: 28px;
}

.avgc-waiting p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}

.avgc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #faf9f7;
    color: #6b655f;
    font-size: 13px;
    line-height: 1.6;
}

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

    .avgc-support-grid {
        grid-template-columns: 1fr;
    }
}

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

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

    .avgc-hero-value {
        font-size: 34px;
    }

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

@media (max-width: 560px) {
    .avgc-field-grid,
    .avgc-kpi-grid {
        grid-template-columns: 1fr;
    }

    .avgc-preset-list {
        flex-direction: column;
    }

    .avgc-preset-btn {
        width: 100%;
    }

    .avgc-summary-table,
    .avgc-values-table {
        font-size: 13px;
    }
}
