/**
 * Percent Calculator Styles
 * 퍼센트 계산기 전용 스타일
 *
 * @package Zipper
 */

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

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

.percent-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;
}

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

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

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

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

.percent-panel {
    display: none;
}

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

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

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

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

.percent-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.percent-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.percent-input-group input {
    width: 120px;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: right;
}

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

.percent-input-group input.wide {
    width: 160px;
}

.percent-operator {
    font-size: 18px;
    font-weight: 600;
    color: #5f5a56;
    padding-top: 22px;
}

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

.percent-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;
}

.percent-result-main {
    text-align: center;
}

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

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

.percent-result-label {
    font-size: 14px;
    color: #5f5a56;
}

.percent-result-formula {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    font-size: 14px;
    color: #5f5a56;
    text-align: center;
}

.percent-result-formula code {
    background: rgba(212, 175, 55, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #2d2a26;
}

/* ========================================
   시각화 섹션
   ======================================== */

.percent-visualization {
    margin-top: 24px;
}

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

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

/* 비율 바 */
.percent-bar-container {
    background: #e8e4dc;
    border-radius: 10px;
    height: 32px;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

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

.percent-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.percent-bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #5f5a56;
}

/* 도넛 차트 */
.percent-donut-container {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.percent-donut {
    width: 160px;
    height: 160px;
    position: relative;
}

.percent-donut svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.percent-donut-bg {
    fill: none;
    stroke: #e8e4dc;
    stroke-width: 16;
}

.percent-donut-fill {
    fill: none;
    stroke: #d4af37;
    stroke-width: 16;
    stroke-linecap: round;
    transition: stroke-dasharray 0.4s ease;
}

.percent-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.percent-donut-value {
    font-size: 28px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
}

.percent-donut-label {
    font-size: 12px;
    color: #5f5a56;
    margin-top: 4px;
}

.percent-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.percent-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.percent-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.percent-legend-color.filled {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
}

.percent-legend-color.remaining {
    background: #e8e4dc;
}

.percent-legend-text {
    font-size: 14px;
    color: #2d2a26;
}

.percent-legend-value {
    font-weight: 600;
    color: #d4af37;
}

/* 비교 바 차트 */
.percent-compare-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.percent-compare-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.percent-compare-bar-wrap {
    flex: 1;
    background: #e8e4dc;
    border-radius: 6px;
    height: 24px;
    overflow: hidden;
    position: relative;
}

.percent-compare-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.4s ease;
    display: flex;
    align-items: center;
    padding: 0 10px;
    min-width: 50px;
}

.percent-compare-bar.original {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.percent-compare-bar.changed {
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
}

.percent-compare-bar.increase {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
}

.percent-compare-bar.decrease {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.percent-compare-value {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

/* ========================================
   증감 표시
   ======================================== */

.percent-change-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
}

.percent-change-indicator.increase {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.percent-change-indicator.decrease {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.percent-change-indicator.neutral {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* ========================================
   빠른 입력 버튼
   ======================================== */

.percent-quick-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.percent-quick-btn {
    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;
}

.percent-quick-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}

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

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

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

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

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

    .percent-tab span {
        display: none;
    }

    .percent-tab i {
        margin: 0;
    }

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

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

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

    .percent-input-group input.wide {
        width: 100%;
    }

    .percent-operator {
        text-align: center;
        padding: 8px 0;
    }

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

    .percent-donut-container {
        flex-direction: column;
    }

    .percent-compare-label {
        width: 60px;
        font-size: 12px;
    }

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

    .percent-quick-buttons {
        justify-content: center;
    }
}

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

    .percent-result-value {
        font-size: 28px;
    }

    .percent-result-value .unit {
        font-size: 18px;
    }

    .percent-donut {
        width: 140px;
        height: 140px;
    }

    .percent-donut-value {
        font-size: 24px;
    }

    .percent-bar-container {
        height: 28px;
    }
}
