/**
 * Pyeong Calculator Styles
 * 평수계산기 전용면적 전용 스타일
 *
 * @package Zipper
 */

/* ========================================
   탭 네비게이션
   ======================================== */

.pyeong-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e4dc;
}

.pyeong-tab {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pyeong-tab:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.pyeong-tab.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-color: transparent;
    color: #fff;
}

.pyeong-tab i {
    font-size: 14px;
}

/* ========================================
   계산기 패널
   ======================================== */

.pyeong-panel {
    display: none;
}

.pyeong-panel.active {
    display: block;
}

.pyeong-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pyeong-panel-title i {
    color: #d4af37;
}

/* ========================================
   입력 영역
   ======================================== */

.pyeong-input-section {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}

.pyeong-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pyeong-input-row:last-child {
    margin-bottom: 0;
}

.pyeong-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 120px;
}

.pyeong-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
}

.pyeong-input-group input {
    padding: 10px 12px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: right;
}

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

.pyeong-input-group select {
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.pyeong-unit {
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    padding-bottom: 12px;
    white-space: nowrap;
}

.pyeong-operator {
    font-size: 18px;
    font-weight: 700;
    color: #d4af37;
    padding-bottom: 10px;
}

/* ========================================
   프리셋 버튼
   ======================================== */

.pyeong-presets {
    margin-bottom: 12px;
}

.pyeong-presets-label {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
}

.pyeong-preset-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pyeong-preset-btn {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.pyeong-preset-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.pyeong-preset-btn.active {
    background: #d4af37;
    border-color: #d4af37;
    color: #fff;
}

/* 주거 유형 프리셋 */
.pyeong-type-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pyeong-type-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pyeong-type-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.pyeong-type-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-color: transparent;
    color: #fff;
}

.pyeong-type-btn i {
    font-size: 12px;
}

/* ========================================
   결과 영역
   ======================================== */

.pyeong-result {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(184, 134, 11, 0.08) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
}

.pyeong-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pyeong-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pyeong-result-title i {
    color: #d4af37;
}

.pyeong-result-main {
    text-align: center;
    margin-bottom: 10px;
}

.pyeong-result-value {
    font-size: 36px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    margin-bottom: 2px;
}

.pyeong-result-value .unit {
    font-size: 18px;
    font-weight: 500;
    color: #5f5a56;
    margin-left: 2px;
}

.pyeong-result-sub {
    font-size: 14px;
    color: #5f5a56;
}

.pyeong-result-sub span {
    font-weight: 600;
    color: #2d2a26;
}

/* 결과 그리드 */
.pyeong-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.pyeong-result-item {
    background: #fff;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.pyeong-result-item.highlight {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.pyeong-result-item-label {
    font-size: 11px;
    color: #5f5a56;
    margin-bottom: 4px;
}

.pyeong-result-item-value {
    font-size: 18px;
    font-weight: 700;
    color: #2d2a26;
}

.pyeong-result-item-value.gold {
    color: #d4af37;
}

.pyeong-result-item-value .unit {
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
}

.pyeong-result-item-sub {
    font-size: 11px;
    color: #5f5a56;
    margin-top: 2px;
}

/* ========================================
   공식/설명 영역
   ======================================== */

.pyeong-formula {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.pyeong-formula-title {
    font-size: 12px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pyeong-formula-title i {
    color: #d4af37;
    font-size: 12px;
}

.pyeong-formula-content {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    color: #2d2a26;
    background: #faf9f7;
    padding: 8px 12px;
    border-radius: 4px;
    line-height: 1.5;
}

.pyeong-formula-content code {
    display: block;
    margin-bottom: 2px;
}

.pyeong-formula-content code:last-child {
    margin-bottom: 0;
}

/* ========================================
   시각화 (면적 비교 바)
   ======================================== */

.pyeong-visualization {
    margin-top: 12px;
}

.pyeong-viz-title {
    font-size: 12px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pyeong-viz-title i {
    color: #d4af37;
    font-size: 12px;
}

.pyeong-area-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pyeong-area-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pyeong-area-bar-label {
    width: 60px;
    font-size: 11px;
    font-weight: 500;
    color: #5f5a56;
    text-align: right;
    flex-shrink: 0;
}

.pyeong-area-bar-track {
    flex: 1;
    height: 22px;
    background: #e8e4dc;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.pyeong-area-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 50px;
}

.pyeong-area-bar-fill.exclusive {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
}

.pyeong-area-bar-fill.supply {
    background: linear-gradient(135deg, #5b9bd5 0%, #2e75b6 100%);
}

.pyeong-area-bar-fill.contract {
    background: linear-gradient(135deg, #70ad47 0%, #548235 100%);
}

.pyeong-area-bar-value {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

/* ========================================
   면적 종류 설명 카드
   ======================================== */

.pyeong-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.pyeong-info-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 12px;
}

.pyeong-info-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pyeong-info-card-title i {
    color: #d4af37;
    font-size: 14px;
}

.pyeong-info-card-desc {
    font-size: 12px;
    color: #5f5a56;
    line-height: 1.4;
}

/* ========================================
   50:50 분할 레이아웃 (패널 1)
   ======================================== */

.pyeong-split-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.pyeong-convert-box {
    flex: 1;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pyeong-convert-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    text-align: center;
}

.pyeong-convert-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pyeong-convert-input input {
    flex: 1;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
    text-align: right;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.pyeong-convert-unit {
    font-size: 14px;
    font-weight: 500;
    color: #5f5a56;
    white-space: nowrap;
}

.pyeong-convert-result {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    padding-top: 6px;
    border-top: 1px dashed #e8e4dc;
}

.pyeong-convert-value {
    font-size: 28px;
    font-weight: 700;
    color: #d4af37;
}

.pyeong-convert-result-unit {
    font-size: 16px;
    font-weight: 500;
    color: #5f5a56;
}

/* ========================================
   50:50 분할 레이아웃 (패널 2, 3)
   ======================================== */

.pyeong-calc-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.pyeong-calc-box {
    flex: 1;
}

.pyeong-calc-box .pyeong-input-section,
.pyeong-calc-box .pyeong-result {
    margin-bottom: 0;
    height: 100%;
}

/* ========================================
   액션 버튼
   ======================================== */

.pyeong-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

/* ========================================
   반응형
   ======================================== */

@media (max-width: 768px) {
    .pyeong-tabs {
        gap: 4px;
    }

    .pyeong-tab {
        padding: 6px 10px;
        font-size: 12px;
        flex: 1 1 auto;
        justify-content: center;
    }

    .pyeong-tab span {
        display: none;
    }

    .pyeong-tab i {
        margin: 0;
    }

    /* 50:50 레이아웃 → 모바일에서 세로 배치 */
    .pyeong-split-row,
    .pyeong-calc-row {
        flex-direction: column;
    }

    .pyeong-convert-box,
    .pyeong-calc-box {
        width: 100%;
    }

    .pyeong-convert-value {
        font-size: 24px;
    }

    .pyeong-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pyeong-input-group {
        width: 100%;
        min-width: auto;
    }

    .pyeong-input-group input {
        width: 100%;
    }

    .pyeong-unit,
    .pyeong-operator {
        text-align: center;
        padding: 6px 0;
    }

    .pyeong-preset-buttons {
        justify-content: center;
    }

    .pyeong-type-presets {
        justify-content: center;
    }

    .pyeong-result-value {
        font-size: 30px;
    }

    .pyeong-result-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pyeong-result-item-value {
        font-size: 16px;
    }

    .pyeong-area-bar-label {
        width: 50px;
        font-size: 10px;
    }

    .pyeong-actions {
        flex-direction: column;
    }

    .pyeong-info-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .pyeong-result {
        padding: 12px;
    }

    .pyeong-result-value {
        font-size: 26px;
    }

    .pyeong-result-value .unit {
        font-size: 14px;
    }

    .pyeong-result-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .pyeong-result-item {
        padding: 10px;
    }

    .pyeong-result-item-value {
        font-size: 14px;
    }

    .pyeong-formula-content {
        font-size: 11px;
        padding: 6px 10px;
    }
}
