/**
 * Gravel Calculator Styles
 * 자갈 계산기 전용 스타일
 *
 * @package Zipper
 */

.grvc-hidden,
.grvc-waiting[hidden],
.grvc-panel[hidden],
.grvc-field[hidden] {
    display: none !important;
}

#grvcCalculator,
#grvcCalculator .tool-layout-input,
#grvcCalculator .tool-layout-result,
#grvcCalculator .grvc-section,
#grvcCalculator .grvc-result-primary,
#grvcCalculator .grvc-kpi-grid,
#grvcCalculator .grvc-summary-table {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.grvc-intro {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grvc-lead {
    margin: 0 0 2px;
    font-size: 14px;
    line-height: 1.55;
    color: #5f5a56;
}

.grvc-section,
.grvc-result-primary,
.grvc-disclaimer {
    border: 1px solid #e8e4dc;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.grvc-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    overflow: hidden;
}

.grvc-section-compact {
    gap: 8px;
    padding: 12px;
}

.grvc-preset-section {
    background: #fffdf9;
}

.grvc-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
}

.grvc-section-title i,
.grvc-disclaimer i {
    color: #d4af37;
}

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

.grvc-toggle-btn {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 10px;
    background: #ffffff;
    color: #5f5a56;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grvc-toggle-btn:hover,
.grvc-toggle-btn:focus,
.grvc-preset-btn:hover,
.grvc-preset-btn:focus {
    outline: none;
    border-color: #d4af37;
    color: #8a6500;
}

.grvc-toggle-btn.is-active {
    border-color: transparent;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(212, 175, 55, 0.16);
}

.grvc-mode-help,
.grvc-field-hint,
.grvc-primary-meta {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #7a756d;
}

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

.grvc-field-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

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

.grvc-label,
.grvc-kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: #5f5a56;
}

.grvc-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.grvc-input-wrap-select {
    grid-template-columns: minmax(0, 1fr);
}

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

.grvc-select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #8a6500 50%), linear-gradient(135deg, #8a6500 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 11px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}

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

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

.grvc-input[aria-invalid="true"],
.grvc-select[aria-invalid="true"] {
    border-color: #c65b49;
    box-shadow: 0 0 0 3px rgba(198, 91, 73, 0.12);
    background: #fff7f5;
}

.grvc-input-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #e8e4dc;
    border-radius: 9px;
    background: #faf9f7;
    color: #5f5a56;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.grvc-btn-group,
.grvc-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.grvc-preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 999px;
    background: #ffffff;
    color: #5f5a56;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.grvc-waiting {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid #f1d6bf;
    border-radius: 12px;
    background: #fff8f1;
    color: #8a5a3b;
    font-size: 13px;
    line-height: 1.45;
}

.grvc-waiting i {
    font-size: 18px;
    color: #d28b53;
}

.grvc-waiting p {
    margin: 0;
}

.grvc-result-primary {
    display: grid;
    gap: 10px;
    padding: 14px;
    border-color: #eadfb8;
    background: linear-gradient(135deg, #fff8ef 0%, #f7f1df 100%);
    box-shadow: 0 10px 22px rgba(212, 175, 55, 0.14);
}

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

.grvc-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.grvc-status-badge.is-neutral {
    background: rgba(138, 101, 0, 0.09);
    color: #8a6500;
}

.grvc-status-badge.is-live {
    background: rgba(62, 137, 91, 0.12);
    color: #2f7a49;
}

.grvc-status-badge.is-warning {
    background: rgba(198, 91, 73, 0.14);
    color: #a53d2c;
}

.grvc-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e6d8b0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.86);
    color: #8a6500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grvc-copy-btn:hover,
.grvc-copy-btn:focus {
    outline: none;
    border-color: #d4af37;
    background: #ffffff;
}

.grvc-primary-title {
    font-size: 12px;
    font-weight: 700;
    color: #7a6d4d;
}

.grvc-primary-display {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.grvc-primary-value {
    font-size: 34px;
    line-height: 1;
    font-weight: 800;
    color: #2d2a26;
    letter-spacing: -0.03em;
}

.grvc-primary-unit {
    font-size: 16px;
    font-weight: 700;
    color: #7a6d4d;
}

.grvc-primary-summary,
.grvc-formula-box {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.grvc-primary-summary {
    color: #4f4942;
    font-weight: 600;
}

.grvc-formula-box {
    padding: 8px 10px;
    border: 1px solid #eadfb8;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.76);
    color: #6f654c;
}

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

.grvc-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ece7de;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(45, 42, 38, 0.04);
}

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

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

.grvc-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.grvc-summary-table th,
.grvc-summary-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f0ebe3;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.45;
}

.grvc-summary-table th {
    width: 38%;
    padding-right: 10px;
    color: #6b655f;
    font-weight: 700;
}

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

.grvc-summary-table tr:last-child th,
.grvc-summary-table tr:last-child td {
    border-bottom: 0;
}

.grvc-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.45;
    color: #5f5a56;
    background: #faf9f7;
}

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

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

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

@media (max-width: 640px) {
    .grvc-field-grid,
    .grvc-kpi-grid,
    .grvc-toggle-group {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .grvc-primary-value {
        font-size: 30px;
    }
}

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

    .grvc-section,
    .grvc-result-primary,
    .grvc-kpi-card,
    .grvc-disclaimer {
        padding-left: 12px;
        padding-right: 12px;
    }
}
