/**
 * Proportion Calculator Styles
 * 비례식 계산기 전용 스타일
 *
 * @package Zipper
 */

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

.proportion-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e4dc;
}

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

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

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

.proportion-tab i {
    font-size: 16px;
}

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

.proportion-panel {
    display: none;
}

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

.proportion-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* ========================================
   공통 옵션 영역
   ======================================== */

.proportion-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
}

.proportion-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.proportion-option label {
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
}

.proportion-option select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
    cursor: pointer;
}

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

/* ========================================
   비례식 입력 영역
   ======================================== */

.proportion-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 24px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
}

.proportion-term {
    position: relative;
}

.proportion-term input {
    width: 100px;
    padding: 14px 12px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border: 2px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    color: #2d2a26;
    transition: all 0.2s;
}

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

.proportion-term input.unknown {
    border-color: #d4af37;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(184, 134, 11, 0.08) 100%);
}

.proportion-term input.unknown::placeholder {
    color: #d4af37;
}

.proportion-term-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: #5f5a56;
    background: #faf9f7;
    padding: 0 6px;
}

.proportion-symbol {
    font-size: 24px;
    font-weight: 700;
    color: #5f5a56;
}

/* 미지수 선택 버튼 그룹 */
.proportion-unknown-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.proportion-unknown-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.proportion-unknown-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.proportion-unknown-btn.active {
    background: #d4af37;
    border-color: #d4af37;
    color: #fff;
}

/* 역비례 미지수 선택 버튼 */
.proportion-inv-unknown-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.proportion-inv-unknown-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.proportion-inv-unknown-btn.active {
    background: #d4af37;
    border-color: #d4af37;
    color: #fff;
}

/* ========================================
   비례 배분 입력 영역
   ======================================== */

.proportion-distribution {
    margin-bottom: 24px;
    padding: 20px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
}

.proportion-dist-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.proportion-dist-input {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.proportion-dist-input input {
    width: 140px;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #fff;
    color: #2d2a26;
    text-align: right;
    transition: all 0.2s;
}

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

/* 비율 입력 그룹 */
.proportion-ratio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
}

.proportion-ratio-input {
    width: 70px;
    padding: 10px 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
    transition: all 0.2s;
}

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

.proportion-ratio-colon {
    font-size: 18px;
    font-weight: 700;
    color: #5f5a56;
}

.proportion-ratio-controls {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.proportion-ratio-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #5f5a56;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.proportion-ratio-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

.proportion-ratio-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   역비례 입력 영역
   ======================================== */

.proportion-inverse {
    margin-bottom: 24px;
}

.proportion-inverse-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 24px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
}

.proportion-inverse-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.proportion-inverse-input {
    width: 100px;
    padding: 14px 12px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border: 2px solid #e8e4dc;
    border-radius: 12px;
    background: #fff;
    color: #2d2a26;
    transition: all 0.2s;
}

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

.proportion-inverse-input.unknown {
    border-color: #d4af37;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(184, 134, 11, 0.08) 100%);
}

.proportion-inverse-symbol {
    font-size: 20px;
    font-weight: 700;
    color: #5f5a56;
}

/* ========================================
   연비례 입력 영역
   ======================================== */

.proportion-chain {
    margin-bottom: 24px;
}

.proportion-chain-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    margin-bottom: 12px;
}

.proportion-chain-row-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    width: 60px;
    flex-shrink: 0;
}

.proportion-chain-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.proportion-chain-input {
    width: 80px;
    padding: 10px 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #fff;
    color: #2d2a26;
    transition: all 0.2s;
}

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

.proportion-chain-input.unknown {
    border-color: #d4af37;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08) 0%, rgba(184, 134, 11, 0.08) 100%);
}

.proportion-chain-colon {
    font-size: 16px;
    font-weight: 700;
    color: #5f5a56;
}

.proportion-chain-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

/* 연비례 항 추가/제거 버튼 (텍스트 포함) */
.proportion-chain-controls .proportion-ratio-btn {
    width: auto;
    height: auto;
    padding: 8px 14px;
    font-size: 13px;
}

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

.proportion-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: 24px;
    margin-bottom: 20px;
}

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

.proportion-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #5f5a56;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.proportion-result-main {
    text-align: center;
    margin-bottom: 16px;
}

.proportion-result-value {
    font-size: 48px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    margin-bottom: 8px;
    word-break: break-all;
}

.proportion-result-value .unit {
    font-size: 24px;
    font-weight: 500;
    color: #5f5a56;
    margin-left: 4px;
}

.proportion-result-fraction {
    font-size: 16px;
    color: #5f5a56;
    margin-top: 8px;
}

.proportion-result-fraction span {
    font-weight: 600;
    color: #2d2a26;
}

/* 비례 배분 결과 */
.proportion-dist-results {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
    min-height: 60px;
}

.proportion-dist-results:empty {
    display: none;
    margin-bottom: 0;
}

.proportion-dist-result-item {
    background: #fff;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 16px 24px;
    text-align: center;
    min-width: 100px;
}

.proportion-dist-result-label {
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 6px;
}

.proportion-dist-result-value {
    font-size: 28px;
    font-weight: 700;
    color: #d4af37;
}

/* ========================================
   풀이 과정
   ======================================== */

.proportion-solution {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

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

.proportion-solution-title i {
    color: #d4af37;
}

.proportion-solution-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.proportion-solution-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
}

.proportion-step-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #d4af37;
    border-radius: 50%;
    flex-shrink: 0;
}

.proportion-step-content {
    flex: 1;
}

.proportion-step-desc {
    font-size: 13px;
    color: #5f5a56;
    margin-bottom: 6px;
}

.proportion-step-formula {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: #2d2a26;
    background: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e8e4dc;
}

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

.proportion-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ========================================
   시각화 영역
   ======================================== */

.proportion-visualization {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    display: none;
}

.proportion-visualization.show {
    display: block;
}

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

.proportion-viz-title i {
    color: #d4af37;
}

/* 비례 바 시각화 */
.proportion-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.proportion-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.proportion-bar-track {
    flex: 1;
    height: 28px;
    background: #e8e4dc;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.proportion-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-radius: 6px;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 40px;
}

.proportion-bar-value {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

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

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

    .proportion-tab {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1 1 auto;
        justify-content: center;
    }

    .proportion-tab span {
        display: none;
    }

    .proportion-tab i {
        margin: 0;
    }

    .proportion-options {
        flex-direction: column;
        gap: 12px;
    }

    .proportion-equation {
        padding: 16px;
        gap: 8px;
    }

    .proportion-term input {
        width: 70px;
        padding: 10px 8px;
        font-size: 16px;
    }

    .proportion-symbol {
        font-size: 18px;
    }

    .proportion-unknown-selector {
        flex-wrap: wrap;
    }

    .proportion-unknown-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .proportion-dist-row {
        flex-direction: column;
        align-items: stretch;
    }

    .proportion-dist-input {
        width: 100%;
    }

    .proportion-dist-input input {
        width: 100%;
    }

    .proportion-ratio-group {
        flex-direction: column;
        align-items: stretch;
    }

    .proportion-ratio-input {
        width: 100%;
    }

    .proportion-ratio-colon {
        text-align: center;
    }

    .proportion-ratio-controls {
        margin-left: 0;
        justify-content: center;
    }

    .proportion-inverse-equation {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .proportion-inverse-input {
        width: 100%;
    }

    .proportion-chain-row {
        flex-direction: column;
        align-items: stretch;
    }

    .proportion-chain-row-label {
        width: 100%;
        margin-bottom: 8px;
    }

    .proportion-chain-input {
        width: 60px;
    }

    .proportion-result-value {
        font-size: 36px;
    }

    .proportion-dist-results {
        flex-direction: column;
    }

    .proportion-dist-result-item {
        width: 100%;
    }

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

    .proportion-bar-label {
        width: 50px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .proportion-result {
        padding: 20px 16px;
    }

    .proportion-result-value {
        font-size: 32px;
    }

    .proportion-solution {
        padding: 16px;
    }

    .proportion-solution-step {
        padding: 10px;
    }

    .proportion-step-formula {
        font-size: 12px;
        padding: 6px 10px;
    }

    .proportion-term input {
        width: 60px;
        padding: 8px 6px;
        font-size: 14px;
    }
}
