/* Font face */
@font-face {
    font-family: 'ElectricBlue';
    src: url('ElectricBlue-VF.woff2') format('woff2-variations');

    font-style: normal;
}

/* Reset and base styles */
*, *:before, *:after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'ElectricBlue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: .875rem;
    font-weight: 400;
    user-select: none; /* Prevent text selection on all UI elements */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body {
    line-height: 1.4;
    color: #eeeeee;
    background: #808080;
    min-height: 100vh;
}

/* Override default heading bold styling */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
}

.container {
    max-width: 100vw;
    margin: 0 auto;
    padding: 1rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
}



/* Controls section */
.controls {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Make input groups flex to fit available space */
.input-row .input-group {
    flex: 1 1 auto;

}

/* Specific sizing for different input types */
.input-row .color-picker-trigger {
    flex: 0 0 160px; /* Fixed width for color picker */
}

.input-row .export-btn {
    flex: 0 0 auto; /* Buttons don't grow */
    margin-left: auto; /* Push buttons to right */
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .input-row {
        gap: 8px;
    }
    
    .input-row .input-group {
        min-width: 100px;
        max-width: 160px;
    }
}

@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-row .input-group,
    .input-row .color-picker-trigger {
        flex: 1 1 auto;
        max-width: none;
    }
    
    .input-row .export-btn {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

.tone-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5ch;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5ch;
    color: #eeeeee;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Prominent uniformity toggle styling */
.uniformity-control {
    flex: 0 0 auto !important; /* Don't grow/shrink */
    min-width: auto !important;
    max-width: none !important;
}

.uniformity-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 2lh;
    box-sizing: border-box;
    white-space: nowrap;
    color: #eeeeee;
}

.uniformity-label:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

#uniformityToggle:checked + .uniformity-label {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.6);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

#uniformityToggle:checked + .uniformity-label:hover {
    background: rgba(102, 126, 234, 0.35);
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

#uniformityToggle {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

/* P3/sRGB Toggle Switch */
.gamut-control {
    flex: 0 0 auto !important;
    min-width: auto !important;
    max-width: none !important;
}

.gamut-toggle-switch {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

#gamutToggle {
    display: none; /* Hide native checkbox */
}

.toggle-track {
    position: relative;
    width: 80px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    box-sizing: border-box;
}

.toggle-track:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
}

.toggle-option {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    transition: color 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.toggle-left {
    left: 8px;
}

.toggle-right {
    right: 8px;
}

.toggle-thumb {
    position: absolute;
    width: 36px;
    height: 26px;
    background: rgba(46, 204, 113, 0.9); /* P3 green default */
    border-radius: 13px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    left: 42px; /* Default P3 position (right) */
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.2);
}

/* sRGB state (unchecked) */
#gamutToggle:not(:checked) + .toggle-track .toggle-thumb {
    left: 2px; /* Move to left for sRGB */
    background: rgba(255, 99, 71, 0.9); /* sRGB orange */
}

#gamutToggle:not(:checked) + .toggle-track .toggle-left {
    color: rgba(255,255,255,0.9); /* Active text */
}

#gamutToggle:not(:checked) + .toggle-track .toggle-right {
    color: rgba(255,255,255,0.4); /* Inactive text */
}

/* P3 state (checked) */
#gamutToggle:checked + .toggle-track .toggle-left {
    color: rgba(255,255,255,0.4); /* Inactive text */
}

#gamutToggle:checked + .toggle-track .toggle-right {
    color: rgba(255,255,255,0.9); /* Active text */
}

/* Disabled state for non-P3 displays */
.gamut-toggle-switch.disabled .toggle-track {
    opacity: 0.5;
    cursor: not-allowed;
}

.gamut-toggle-switch.disabled .toggle-thumb {
    background: rgba(108, 117, 125, 0.7); /* Gray for disabled */
}

/* Deuteranopia hover hook */
.deuteranopia-hook {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    user-select: none;
}

.deuteranopia-hook:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    filter: saturate(0);
}

.input-with-preview {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

.input-group label {
    color: #eeeeee;
    line-height: 1.2;
}

.input-group input,
.input-group select,
.multiselect-trigger {
    height: 2lh; /* Use height instead of block-size for consistency */
    padding: 0.3rem 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #eeeeee;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    font-size: 0.85rem;
    box-sizing: border-box; /* Ensure consistent sizing */
    user-select: auto; /* Allow text selection in inputs */
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

/* Custom select styling for consistent caret */
.input-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23aaa' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2rem; /* Space for custom arrow */
}

.input-group input:focus,
.input-group select:focus,
.multiselect-trigger:hover {
    outline: none;
    border-color: #667eea;
    background: rgba(255,255,255,0.15);
}

.input-group input:hover,
.input-group select:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

input[type="range"] {
    padding: 0;
    background: transparent;
    cursor: pointer;
    height: 2rem;
    /* CSS custom properties for dynamic styling */
    --slider-gradient: linear-gradient(to right, #e1e5e9, #e1e5e9);
    --thumb-color: #667eea;
}

/* Enhanced gradient tracks */
input[type="range"]::-webkit-slider-track {
    background: var(--slider-gradient, #e1e5e9);
    height: 8px; /* Taller track for better gradient visibility */
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

input[type="range"]::-webkit-slider-thumb {
    background: var(--thumb-color, #667eea);
    height: 30px;
    width: 30px;
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

input[type="range"]::-moz-range-track {
    background: var(--slider-gradient, #e1e5e9);
    height: 8px; /* Match webkit track height */
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

input[type="range"]::-moz-range-thumb {
    background: var(--thumb-color, #667eea);
    height: 30px;
    width: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

input[type="color"] {
    inline-size: 2rem;
    block-size: 2rem;
    border: none;
    padding: 0;
    flex-shrink: 0;
    cursor: pointer;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
}

.input-with-preview input {
    flex: 1;
    margin: 0;
}

.export-btn {
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}





.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.export-btn:active {
    transform: translateY(0);
}

/* Results section */
.results {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.color-display {
    display: grid;
    gap: 1px;
    flex: 1;
    height: 100%;
    /* Grid rows will be set dynamically by JavaScript */
}

.hue-group {
    display: flex;
    flex-direction: column;
    height: 100%; /* Fill allocated grid row */
    /* 1px gap for visual separation between hue rows */
    /* Background will be set dynamically to base "color" variation */
}

.hue-colors {
    display: grid;
    grid-template-columns: repeat(8, 1fr); /* Default: all 8 columns, overridden by JS */
    grid-template-rows: 1fr; /* Single row that fills height */
    gap: 1px; /* 1px gap between swatches */
    flex: 1; /* Take all available height in hue group */
    height: 100%;
}

.color-swatch {
    min-width: 0; /* Allow shrinking */
    min-height: 3lh; /* Minimum usable height */
    height: 100%; /* Fill allocated grid space */
    position: relative;
    /* Width handled by grid 1fr, height fills parent */
    /* Background color set dynamically */
    /* 1px gaps provide subtle visual separation while maintaining color focus */
}

.color-swatch.editable-swatch {
    position: relative;
}

.edit-hue-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.color-swatch.editable-swatch:hover .edit-hue-btn {
    opacity: 1;
}

.edit-hue-btn:hover {
    background: rgba(0,0,0,0.8);
    border-color: rgba(255,255,255,0.5);
}

.reset-hue-btn {
    position: absolute;
    top: 0.5rem;
    right: 2rem; /* Position left of edit button */
    width: 24px;
    height: 24px;
    background: rgba(255,100,100,0.7); /* Red-ish for reset */
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.color-swatch.editable-swatch:hover .reset-hue-btn {
    opacity: 1;
}

.reset-hue-btn:hover {
    background: rgba(255,80,80,0.9);
    border-color: rgba(255,255,255,0.6);
}

.color-swatch.edited-swatch {
    position: relative;
}

.color-swatch.edited-swatch::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    /* Subtle white dot indicator for edited hues */
}

/* Gamut warning indicator - only visible on hover */
.gamut-warning {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 18px;
    line-height: 1;
    z-index: 10; /* High z-index to appear above all text content */
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: all;
    cursor: help;
    /* Color set dynamically to match accessible text color */
}

.color-swatch:hover .gamut-warning {
    opacity: 0.9;
}

/* Limit indicator for swatches that set column chroma limits */
.limit-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 12px;
    line-height: 1;
    z-index: 10; /* High z-index to appear above all text content */
    opacity: 0.8;
    transition: opacity 0.2s ease;
    pointer-events: all;
    cursor: help;
    /* Color set dynamically to match accessible text color */
}

.color-swatch.limiting-swatch:hover .limit-indicator {
    opacity: 1;
}

/* Hide limit indicators on mobile for cleaner interface */
@media (max-width: 768px) {
    .limit-indicator {
        display: none !important;
    }
}

/* Inline edit/reset buttons in content overlay */
.edit-buttons-inline {
    display: flex;
    gap: 0.2rem;
    flex-shrink: 0;
}

.edit-hue-btn-inline,
.reset-hue-btn-inline {
    background: none;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.1rem;
    transition: all 0.2s ease;
    z-index: 2;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    /* Color set dynamically to match accessible text color */
}

.edit-hue-btn-inline:hover,
.reset-hue-btn-inline:hover {
    background: rgba(0,0,0,0.2);
    transform: scale(1.15);
}

/* Hide inline buttons on mobile */
@media (max-width: 768px) {
    .edit-hue-btn-inline,
    .reset-hue-btn-inline {
        display: none !important;
    }
}

.color-content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    opacity: 0;
    transition: opacity 0.2s ease;
    user-select: auto; /* Allow selection of color values for copying */
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    /* Text color set dynamically to bright color for contrast */
}

.color-swatch:hover .color-content-overlay {
    opacity: 1;
}

.color-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.color-name {
    word-wrap: break-word;
    hyphens: auto;
    text-align: left;
    flex: 1;
    pointer-events: none;
}

.color-values {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1ch;
    justify-content: flex-start;
}

.color-value {
    cursor: pointer;
}

.color-value:hover {
    opacity: 0.8; /* Subtle hover effect */
}

.color-value.gamut-mapped {
    font-weight: 600;
    opacity: 0.9;
    /* Remove colored backgrounds - use bright color text with opacity */
}

.color-value.gamut-mapped:hover {
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 1024px) and (min-width: 769px) {
    .input-row {
        gap: 8px;
    }
    
    .hue-colors {
        grid-template-columns: repeat(6, 1fr); /* All equal width on medium screens */
        gap: 0;
    }
    
    .spectral-label {
    
    }
    
    .hue-name {
    
    }
    
    .hue-degree {

    }
}

@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }
    
    .input-row {
        gap: 10px;
    }
    
    .controls {
        padding: 0.25rem 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    .hue-colors {
        grid-template-columns: repeat(3, 1fr); /* Show dark, color, vivid on mobile */
        gap: 0;
    }
    
    /* Hide some variations on mobile for better layout */
    .hue-colors .color-swatch:nth-child(n+4) {
        display: none;
    }
    
    /* Hide all text overlays on mobile - pure color focus */
    .color-content-overlay {
        display: none !important;
    }
}

@media (max-width: 480px) {
   
    
    /* Hide all text overlays on very small screens too */
    .color-content-overlay,
    .spectral-label {
        display: none !important;
    }
    
    
}

/* Export Modal */
.export-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.export-modal-content {
    background: white;
    padding: 30px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.export-modal h3 {
    margin: 0 0 20px 0;
    color: #333;


}

.export-textarea {
    width: 100%;
    height: 400px;
    border: 2px solid #e1e5e9;
    padding: 15px;



    line-height: 1.4;
    resize: vertical;
}

.export-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.copy-css-btn, .close-modal-btn {
    padding: 10px 20px;
    border: none;



    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-css-btn {
    background: #007bff;
    color: white;
}

.copy-css-btn:hover {
    background: #0056b3;
}

.close-modal-btn {
    background: #6c757d;
    color: white;
}

.close-modal-btn:hover {
    background: #545b62;
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Color Picker Trigger */
.color-picker-trigger {
    min-width: 160px;
}

.color-controls-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-preview-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-preview-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.main-hex-input {
    font-family: 'Courier New', monospace;
    width: 80px;
    text-align: center;
    user-select: auto; /* Allow text selection in main hex input */
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    /* Other styles inherited from .input-group input */
}

/* Color Picker Modal */
.color-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.color-picker-modal.open {
    display: flex;
}

.color-picker-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.color-picker-content {
    position: relative;
    background: #2a2a2a;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
}

.color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.color-picker-header h3 {
    margin: 0;
    color: #eeeeee;
    font-size: 1.1rem;
}

.close-picker-btn {
    background: none;
    border: none;
    color: #eeeeee;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-picker-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.oklch-input-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.color-wheel-container {
    position: relative;
    width: 120px;
    height: 120px;
}

#colorWheel {
    border-radius: 50%;
    cursor: crosshair;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.wheel-indicator {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.3);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.oklch-sliders {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 140px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    position: relative;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 36px; /* Accommodate larger diamond thumbs */
}

.gradient-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    transform: translateY(-50%);
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    z-index: 1;
    /* Background set by JavaScript */
}

.enhanced-range-input {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.enhanced-range-input::-webkit-slider-track {
    background: transparent; /* Let gradient-track show through */
    height: 36px;
    border: none;
}

.enhanced-range-input::-webkit-slider-thumb {
    background: var(--thumb-color, #667eea);
    height: 30px;
    width: 30px;
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid rgba(255,255,255,0.95);
    outline: none;
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.4),
        0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    transform: scale(1);
    margin-top: 0;
}

.enhanced-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    border-color: rgba(255,255,255,1);
    box-shadow: 
        0 6px 20px rgba(0,0,0,0.5),
        0 3px 10px rgba(0,0,0,0.4);
}

.enhanced-range-input::-moz-range-track {
    background: transparent;
    height: 36px;
    border: none;
}

.enhanced-range-input::-moz-range-thumb {
    background: var(--thumb-color, #667eea);
    height: 30px;
    width: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.95);
    outline: none;
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.4),
        0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    transform: scale(1);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin-top: 0;
}

.enhanced-range-input::-moz-range-thumb:hover {
    transform: scale(1.1);
    border-color: rgba(255,255,255,1);
    box-shadow: 
        0 6px 20px rgba(0,0,0,0.5),
        0 3px 10px rgba(0,0,0,0.4);
}

.slider-group label {
    font-size: 0.8rem;
    color: #eeeeee;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.value-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #eeeeee;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    font-size: 0.75rem;
    width: 60px;
    text-align: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    user-select: auto; /* Allow text selection in number inputs */
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.value-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255,255,255,0.15);
}

.value-input:hover {
    background: rgba(255,255,255,0.15);
}

.unit {
    font-size: 0.75rem;
    color: #aaa;
    margin-left: -0.2rem;
}

.color-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hex-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.hex-input {
    width: 100px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    text-align: center;
    user-select: auto; /* Allow text selection in hex inputs */
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
}

.color-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.picker-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.confirm-btn {
    background: #667eea;
    color: white;
}

.confirm-btn:hover {
    background: #5a67d8;
}

.cancel-btn {
    background: rgba(255,255,255,0.1);
    color: #eeeeee;
}

.cancel-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Multiselect styles */
.multiselect-container {
    position: relative;
    min-width: 200px;
}

.multiselect-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    line-height: 1; /* Fix vertical spacing issue */
    /* Height inherited from common input styles */
}

.multiselect-trigger.open {
    border-color: #667eea;
    background: rgba(255,255,255,0.15);
}

.multiselect-value {
    color: #eeeeee;
    font-size: 0.85rem;
}

.multiselect-arrow {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.multiselect-arrow svg {
    width: 100%;
    height: 100%;
}

.multiselect-trigger.open .multiselect-arrow {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
    display: none;
}

.multiselect-dropdown.open {
    display: block;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.85rem;
    color: #eeeeee;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.multiselect-option:last-child {
    border-bottom: none;
}

.multiselect-option:hover {
    background: rgba(255,255,255,0.1);
}

.multiselect-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.multiselect-option input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.multiselect-option input[type="checkbox"]:disabled + text {
    color: rgba(238, 238, 238, 0.6);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Hide edit and reset buttons on mobile for cleaner interface */
    .edit-hue-btn,
    .reset-hue-btn {
        display: none !important;
    }
    
    /* Hide text overlays on mobile for pure color focus */
    .color-content-overlay {
        display: none !important;
    }
}


