/* Theme System CSS - Dynamic Color Variables and Styling */

:root {
    --theme-primary: #3b82f6;
    --theme-primary-dark: #2563eb;
    --theme-primary-light: #60a5fa;
    --theme-primary-alpha: rgba(59, 130, 246, 0.1);
}

/* Apply theme colors to common elements */
.theme-primary {
    color: var(--theme-primary) !important;
}

.theme-primary-bg {
    background-color: var(--theme-primary) !important;
}

.theme-primary-border {
    border-color: var(--theme-primary) !important;
}

/* Enhanced Color Wheel Styling */
#color-wheel {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

#color-wheel:hover {
    transform: scale(1.02);
}

#color-wheel-pointer {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    z-index: 10;
}

/* Custom Range Slider Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
    background: linear-gradient(90deg, #333, #666, #999);
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--theme-primary);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

input[type="range"]::-moz-range-track {
    background: linear-gradient(90deg, #333, #666, #999);
    height: 8px;
    border-radius: 4px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: var(--theme-primary);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Brightness slider specific gradient */
#brightness-slider::-webkit-slider-track {
    background: linear-gradient(90deg, #000, #666, #fff);
}

#brightness-slider::-moz-range-track {
    background: linear-gradient(90deg, #000, #666, #fff);
}

/* Saturation slider specific gradient */
#saturation-slider::-webkit-slider-track {
    background: linear-gradient(90deg, #888, var(--theme-primary));
}

#saturation-slider::-moz-range-track {
    background: linear-gradient(90deg, #888, var(--theme-primary));
}

/* Color display enhancements */
#selected-color-display {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#selected-color-display::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

#selected-color-display:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Hex input styling */
#hex-input {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

#hex-input:focus {
    box-shadow: 0 0 0 2px var(--theme-primary);
    transform: scale(1.02);
}

/* Preset color button enhancements */
.preset-color {
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.preset-color:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.preset-color:active {
    transform: scale(0.95) !important;
}

.preset-color i {
    transition: all 0.2s ease;
}

/* Theme toggle switch styling */
#theme-enabled {
    position: relative;
    width: 2.25rem;
    height: 1.25rem;
    background-color: #374151;
    border-radius: 9999px;
    transition: background-color 0.2s;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#theme-enabled::after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1rem;
    height: 1rem;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#theme-enabled:checked {
    background-color: var(--theme-primary);
}

#theme-enabled:checked::after {
    transform: translateX(1rem);
}

/* Preview section styling */
.preview-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #333;
}

/* Animation for color changes */
@keyframes colorPulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.7; 
        transform: scale(1.02); 
    }
}

.color-transition {
    animation: colorPulse 0.5s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #color-wheel {
        width: 150px;
        height: 150px;
    }
    
    #selected-color-display {
        width: 80px;
        height: 80px;
    }
    
    .preset-color {
        width: 32px;
        height: 32px;
    }
}

/* Theme application classes for site-wide theming */
.theme-link {
    color: var(--theme-primary) !important;
    transition: color 0.2s ease;
}

.theme-link:hover {
    color: var(--theme-primary-light) !important;
}

.theme-button {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.theme-button:hover {
    background-color: var(--theme-primary-dark) !important;
    border-color: var(--theme-primary-dark) !important;
}

.theme-button-outline {
    border-color: var(--theme-primary) !important;
    color: var(--theme-primary) !important;
}

.theme-button-outline:hover {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

.theme-badge {
    background-color: var(--theme-primary) !important;
    color: white !important;
}

.theme-highlight {
    background-color: var(--theme-primary-alpha) !important;
    color: var(--theme-primary) !important;
}

/* Focus states */
.theme-focus:focus {
    box-shadow: 0 0 0 2px var(--theme-primary-alpha), 0 0 0 4px var(--theme-primary) !important;
}

/* Loading states */
.theme-loading {
    background: linear-gradient(90deg, var(--theme-primary-alpha), var(--theme-primary), var(--theme-primary-alpha));
    background-size: 200% 100%;
    animation: themeLoading 1.5s infinite;
}

@keyframes themeLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Success/Error states with theme colors */
.theme-success {
    color: #10b981 !important;
}

.theme-error {
    color: #ef4444 !important;
}

.theme-warning {
    color: #f59e0b !important;
}

/* Dark mode compatibility */
@media (prefers-color-scheme: dark) {
    :root {
        --theme-primary-alpha: rgba(59, 130, 246, 0.15);
    }
}