/**
 * Color Mixer (색상 혼합기)
 * 두 가지 이상의 색상을 섞어 새로운 색상 생성
 *
 * @package Zipper
 */

/* === 메인 컨테이너 === */
.mixer-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* === 색상 입력 영역 === */
.mixer-input-section {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 1.5rem;
}

.mixer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.mixer-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d2a26;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mixer-title i {
    color: #d4af37;
}

/* 색상 개수 선택 */
.mixer-color-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mixer-color-count label {
    font-size: 0.875rem;
    color: #5f5a56;
}

.mixer-count-select {
    padding: 8px 12px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #fff;
    font-size: 0.9375rem;
    color: #2d2a26;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

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

/* 색상 목록 */
.mixer-colors-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mixer-color-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mixer-color-item:hover {
    border-color: #d4af37;
}

/* 색상 피커 */
.mixer-color-picker-wrap {
    position: relative;
    flex-shrink: 0;
}

.mixer-color-picker {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid #e8e4dc;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.mixer-color-picker:hover {
    border-color: #d4af37;
}

.mixer-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.mixer-color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

.mixer-color-picker::-moz-color-swatch {
    border: none;
    border-radius: 8px;
}

/* HEX 입력 */
.mixer-hex-input {
    width: 100px;
    padding: 10px 12px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    background: #faf9f7;
    color: #2d2a26;
    transition: all 0.2s ease;
}

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

/* 비율 슬라이더 */
.mixer-ratio-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mixer-ratio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mixer-ratio-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #5f5a56;
}

.mixer-ratio-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #d4af37;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.mixer-ratio-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e8e4dc;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.mixer-ratio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
    transition: transform 0.2s ease;
}

.mixer-ratio-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.mixer-ratio-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
}

/* 삭제 버튼 */
.mixer-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    color: #8c8579;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mixer-remove-btn:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.mixer-remove-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === 결과 영역 === */
.mixer-result-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.mixer-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e8e4dc;
    background: #faf9f7;
}

.mixer-result-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d2a26;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.mixer-result-actions {
    display: flex;
    gap: 8px;
}

/* 결과 미리보기 */
.mixer-result-preview {
    display: flex;
    min-height: 200px;
}

.mixer-result-color {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: #e8e4dc;
    transition: background-color 0.3s ease;
}

.mixer-result-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    backdrop-filter: blur(4px);
    text-align: center;
}

.mixer-result-hex {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d2a26;
    text-transform: uppercase;
}

.mixer-result-rgb {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.875rem;
    color: #5f5a56;
}

/* === 공통 섹션 스타일 === */
.mixer-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.mixer-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d2a26;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mixer-section-title i {
    color: #d4af37;
}

/* === 그라데이션 미리보기 === */
.mixer-gradient-section {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 1.5rem;
}

.mixer-gradient-preview {
    height: 60px;
    border-radius: 12px;
    border: 1px solid #e8e4dc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: linear-gradient(to right, #e8e4dc, #e8e4dc);
}

/* === 중간 색상 생성 === */
.mixer-intermediate-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 1.5rem;
}

.mixer-intermediate-options {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mixer-intermediate-options label {
    font-size: 0.875rem;
    color: #5f5a56;
}

.mixer-intermediate-colors {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mixer-intermediate-color {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.mixer-intermediate-swatch {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid #e8e4dc;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.mixer-intermediate-color:hover .mixer-intermediate-swatch {
    transform: scale(1.1);
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mixer-intermediate-hex {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.6875rem;
    color: #5f5a56;
    text-transform: uppercase;
}

.mixer-intermediate-empty {
    padding: 24px;
    text-align: center;
    color: #8c8579;
    font-size: 0.875rem;
    width: 100%;
}

/* === 색상 조화 추천 === */
.mixer-harmony-section {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 1.5rem;
}

.mixer-harmony-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.mixer-harmony-tab {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.mixer-harmony-tab.active {
    background: #d4af37;
    border-color: #d4af37;
    color: #fff;
}

/* 조화 콘텐츠 */
.mixer-harmony-contents {
    margin-top: 16px;
}

.mixer-harmony-content {
    display: none;
}

.mixer-harmony-content.active {
    display: block;
}

.mixer-harmony-desc {
    margin-top: 12px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #5f5a56;
    line-height: 1.6;
}

.mixer-harmony-colors {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mixer-harmony-color {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.mixer-harmony-swatch {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 2px solid #e8e4dc;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mixer-harmony-color:hover .mixer-harmony-swatch {
    transform: scale(1.1);
    border-color: #d4af37;
}

.mixer-harmony-hex {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.75rem;
    color: #5f5a56;
    text-transform: uppercase;
}

/* === 히스토리 섹션 === */
.mixer-history-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 1.5rem;
}

.mixer-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mixer-history-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.mixer-history-swatch {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid #e8e4dc;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.mixer-history-item:hover .mixer-history-swatch {
    transform: scale(1.1);
    border-color: #d4af37;
}

.mixer-history-hex {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.625rem;
    color: #8c8579;
    text-transform: uppercase;
}

.mixer-history-empty {
    width: 100%;
    padding: 24px;
    text-align: center;
    color: #8c8579;
    font-size: 0.875rem;
}

/* === 토스트 메시지 === */
.mixer-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: #2d2a26;
    color: #fff;
    border-radius: 8px;
    font-size: 0.9375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.mixer-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mixer-toast.success {
    background: #28a745;
}

/* === 반응형 === */
@media (max-width: 768px) {
    .mixer-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .mixer-color-count {
        justify-content: flex-end;
    }

    .mixer-color-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .mixer-ratio-wrap {
        width: 100%;
        order: 3;
    }

    .mixer-hex-input {
        flex: 1;
        min-width: 80px;
    }

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

    .mixer-actions .tool-btn {
        width: 100%;
    }

    .mixer-result-preview {
        min-height: 160px;
    }

    .mixer-result-hex {
        font-size: 1.25rem;
    }

    .mixer-result-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .mixer-result-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .mixer-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .mixer-intermediate-options {
        justify-content: flex-end;
    }

    .mixer-intermediate-swatch {
        width: 44px;
        height: 44px;
    }

    .mixer-harmony-tabs {
        width: 100%;
    }

    .mixer-harmony-tab {
        flex: 1;
        text-align: center;
    }

    .mixer-harmony-swatch {
        width: 50px;
        height: 50px;
    }

    .mixer-gradient-preview {
        height: 48px;
    }
}

@media (max-width: 480px) {
    .mixer-color-picker {
        width: 42px;
        height: 42px;
    }

    .mixer-hex-input {
        width: 85px;
        padding: 8px 10px;
        font-size: 0.875rem;
    }

    .mixer-ratio-slider {
        height: 6px;
    }

    .mixer-ratio-slider::-webkit-slider-thumb {
        width: 18px;
        height: 18px;
    }

    .mixer-result-hex {
        font-size: 1.125rem;
    }

    .mixer-intermediate-swatch {
        width: 40px;
        height: 40px;
    }

    .mixer-intermediate-hex {
        font-size: 0.5625rem;
    }

    .mixer-harmony-swatch {
        width: 44px;
        height: 44px;
    }

    .mixer-harmony-hex {
        font-size: 0.625rem;
    }

    .mixer-history-swatch {
        width: 38px;
        height: 38px;
    }
}
