/* Color Picker Tool - Main Styles */
.color-picker-tool-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 800px;
    margin: 2rem auto;
    padding: 0;
    box-sizing: border-box;
}

.color-picker-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

/* Color Preview Section */
.color-preview-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.color-preview-header {
    margin-bottom: 1rem;
}

.color-preview-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.color-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.current-color-preview {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.color-preview-info {
    flex: 1;
}

.current-color-text {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.color-type-label {
    font-size: 0.875rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Color Picker Section */
.color-picker-section {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.color-picker-header {
    margin-bottom: 1.5rem;
}

.color-picker-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.color-picker-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .color-picker-area {
        grid-template-columns: 1fr 1fr;
    }
}

/* Color Palette */
.color-palette {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.color-spectrum {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    touch-action: none;
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}

.spectrum-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, #000 100%);
}

.spectrum-selector {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.color-sliders {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-container label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.hue-slider {
    background: linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}

.alpha-slider {
    background: linear-gradient(to right, transparent 0%, currentColor 100%);
    color: #4f46e5;
}

/* Color Inputs */
.color-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.color-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-family: 'Courier New', monospace;
    color: #2d3748;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.color-input:focus {
    outline: none;
    border-color: #4f46e5;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.color-input:invalid {
    border-color: #f56565;
    background: #fff5f5;
}

.copy-btn {
    padding: 0.75rem 1rem;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.copy-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

/* Action Buttons */
.action-buttons-section {
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e1e5e9;
}

.action-buttons {
    display: flex;
    justify-content: center;
}

.action-btn {
    padding: 0.875rem 1.75rem;
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
    transform: translateY(0);
}

.reset-btn svg {
    width: 16px;
    height: 16px;
}

/* Notification Area */
.notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.notification {
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.success {
    background: #48bb78;
    color: white;
}

.notification.error {
    background: #f56565;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .color-picker-tool-wrapper {
        margin: 1rem;
        border-radius: 8px;
    }
    
    .color-preview-section,
    .color-picker-section,
    .action-buttons-section {
        padding: 1rem;
    }
    
    .color-spectrum {
        height: 180px;
    }
    
    .current-color-text {
        font-size: 1.25rem;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .color-input {
        border-width: 3px;
    }
    
    .copy-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .color-input,
    .copy-btn,
    .action-btn,
    .notification {
        transition: none;
        animation: none;
    }
}

/* Focus Visible for Accessibility */
.color-input:focus-visible,
.copy-btn:focus-visible,
.action-btn:focus-visible,
input[type="range"]:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 2px;
}

/* Loading State */
.color-picker-container.loading * {
    pointer-events: none;
    opacity: 0.7;
}

/* Error State */
.input-error {
    border-color: #f56565;
    background: #fff5f5;
}

.error-message {
    color: #f56565;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

.input-error + .error-message {
    display: block;
}