/**
 * HSL Adjuster Styles
 * HSL 조절기 전용 스타일
 *
 * @package Zipper
 */

/* ===== 2컬럼 레이아웃 ===== */
.hsl-main-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

.hsl-input-col {
    position: sticky;
    top: 20px;
}

.hsl-result-col {
    min-width: 0;
}

/* ===== 입력 섹션 ===== */
.hsl-input-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
}

.hsl-input-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8e4dc;
}

.hsl-input-title i {
    color: #d4af37;
}

/* 초기 색상 입력 */
.hsl-color-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.hsl-color-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.hsl-color-picker-wrap {
    flex-shrink: 0;
}

.hsl-color-picker {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

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

.hsl-color-picker::-webkit-color-swatch {
    border: 2px solid #e8e4dc;
    border-radius: 8px;
}

.hsl-color-picker::-moz-color-swatch {
    border: 2px solid #e8e4dc;
    border-radius: 8px;
}

.hsl-hex-input-wrap {
    flex: 1;
    position: relative;
}

.hsl-hex-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #8c8579;
    font-family: 'Consolas', 'Monaco', monospace;
}

.hsl-hex-input {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 28px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    background: #faf9f7;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.hsl-apply-btn {
    flex-shrink: 0;
    padding: 0 16px;
    height: 44px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.hsl-apply-btn:hover {
    background: linear-gradient(135deg, #e5c04a 0%, #c99a1c 100%);
}

/* HSL 슬라이더 */
.hsl-sliders-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hsl-slider-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.hsl-slider-label {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hsl-slider-label span {
    color: #8c8579;
    font-weight: 400;
    font-size: 12px;
}

.hsl-slider-value {
    font-size: 14px;
    font-weight: 700;
    color: #d4af37;
    font-family: 'Consolas', 'Monaco', monospace;
    min-width: 50px;
    text-align: right;
}

.hsl-slider-track {
    position: relative;
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
}

.hsl-slider-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
}

/* 색조 슬라이더 배경 - 무지개 그라데이션 */
.hsl-slider-bg.hue {
    background: linear-gradient(to right,
        hsl(0, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(360, 100%, 50%)
    );
}

/* 채도/밝기 슬라이더는 JS에서 동적 설정 */

.hsl-slider {
    position: relative;
    width: 100%;
    height: 32px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
}

.hsl-slider::-webkit-slider-runnable-track {
    height: 32px;
    border-radius: 8px;
    background: transparent;
}

.hsl-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 32px;
    background: #fff;
    border: 3px solid #2d2a26;
    border-radius: 6px;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

.hsl-slider::-webkit-slider-thumb:hover {
    transform: scaleY(1.1);
}

.hsl-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.hsl-slider::-moz-range-track {
    height: 32px;
    border-radius: 8px;
    background: transparent;
}

.hsl-slider::-moz-range-thumb {
    width: 24px;
    height: 32px;
    background: #fff;
    border: 3px solid #2d2a26;
    border-radius: 6px;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 액션 버튼 */
.hsl-actions {
    display: flex;
    gap: 8px;
}

.hsl-action-btn {
    flex: 1;
    padding: 10px 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.hsl-action-btn:hover {
    background: #fff;
    border-color: #d4af37;
    color: #d4af37;
}

.hsl-action-btn i {
    font-size: 14px;
}

/* ===== 결과 섹션 ===== */
.hsl-result-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 색상 비교 영역 */
.hsl-compare-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hsl-compare-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    overflow: hidden;
}

.hsl-compare-header {
    padding: 10px 14px;
    background: #faf9f7;
    border-bottom: 1px solid #e8e4dc;
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hsl-compare-header i {
    color: #d4af37;
}

.hsl-compare-preview {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hsl-compare-hex {
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* 코드 출력 섹션 */
.hsl-codes-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

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

.hsl-codes-title i {
    color: #d4af37;
}

.hsl-codes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.hsl-code-item {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.hsl-code-label {
    font-size: 11px;
    font-weight: 700;
    color: #8c8579;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hsl-code-value {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    flex: 1;
    word-break: break-all;
}

.hsl-code-copy {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #e8e4dc;
    border-radius: 4px;
    font-size: 11px;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hsl-code-copy:hover {
    background: #fff;
    border-color: #d4af37;
    color: #d4af37;
}

/* CSS 코드 전체 */
.hsl-css-code {
    grid-column: 1 / -1;
    background: #2d2a26;
    border: none;
    padding: 12px 14px;
}

.hsl-css-code .hsl-code-label {
    color: #8c8579;
}

.hsl-css-code .hsl-code-value {
    color: #faf9f7;
}

.hsl-css-code .hsl-code-copy {
    background: transparent;
    border-color: #5f5a56;
    color: #faf9f7;
}

.hsl-css-code .hsl-code-copy:hover {
    border-color: #d4af37;
    color: #d4af37;
}

/* 히스토리 & 즐겨찾기 섹션 */
.hsl-storage-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hsl-storage-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 14px;
}

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

.hsl-storage-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hsl-storage-title i {
    color: #d4af37;
    font-size: 14px;
}

.hsl-storage-clear {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #e8e4dc;
    border-radius: 4px;
    font-size: 11px;
    color: #5f5a56;
    cursor: pointer;
    transition: all 0.2s;
}

.hsl-storage-clear:hover {
    background: #fff;
    border-color: #dc3232;
    color: #dc3232;
}

.hsl-storage-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 36px;
}

.hsl-storage-item {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #e8e4dc;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.hsl-storage-item:hover {
    transform: scale(1.15);
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.hsl-storage-item::after {
    content: attr(data-hex);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #2d2a26;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    font-family: 'Consolas', 'Monaco', monospace;
}

.hsl-storage-item:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 즐겨찾기 추가 버튼 */
.hsl-add-favorite {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px dashed #e8e4dc;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8c8579;
    font-size: 16px;
    transition: all 0.2s;
}

.hsl-add-favorite:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: #faf9f7;
}

.hsl-storage-empty {
    width: 100%;
    padding: 10px;
    text-align: center;
    color: #8c8579;
    font-size: 12px;
}

/* ===== 반응형 ===== */
@media (max-width: 900px) {
    .hsl-main-layout {
        grid-template-columns: 280px 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .hsl-main-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hsl-input-col {
        position: static;
    }

    .hsl-compare-section {
        grid-template-columns: 1fr 1fr;
    }

    .hsl-storage-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hsl-input-section {
        padding: 14px;
    }

    .hsl-color-input-row {
        flex-wrap: wrap;
    }

    .hsl-color-picker-wrap {
        order: 1;
    }

    .hsl-hex-input-wrap {
        order: 2;
        flex: 1;
        min-width: 120px;
    }

    .hsl-apply-btn {
        order: 3;
        width: 100%;
        margin-top: 4px;
    }

    .hsl-compare-section {
        grid-template-columns: 1fr;
    }

    .hsl-compare-preview {
        height: 80px;
    }

    .hsl-codes-grid {
        grid-template-columns: 1fr;
    }

    .hsl-slider-track {
        height: 28px;
    }

    .hsl-slider {
        height: 28px;
    }

    .hsl-slider::-webkit-slider-thumb {
        height: 28px;
        width: 20px;
    }

    .hsl-slider::-moz-range-thumb {
        height: 28px;
        width: 20px;
    }
}

/* ===== 면책조항 ===== */
.hsl-disclaimer {
    margin-top: 20px;
    padding: 12px 16px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    font-size: 12px;
    color: #8c8579;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.hsl-disclaimer i {
    color: #d4af37;
    flex-shrink: 0;
    margin-top: 1px;
}
