/* Custom CSS for Smart Colors */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom font family */
.font-\[\'Inter\'\] {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Color wheel styles */
#color-wheel {
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

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

#saturation-square {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

#saturation-square:hover {
    transform: scale(1.05);
}

/* Color swatches */
.color-swatch {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.color-swatch:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-swatch.active {
    border-color: #3b82f6;
    border-width: 3px;
}

.color-swatch-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
}

/* Preview components */
.preview-component {
    transition: all 0.3s ease;
}

.preview-component:hover {
    transform: translateY(-1px);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Copy buttons */
.copy-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.color-value:hover .copy-btn {
    opacity: 1;
}

/* FAQ accordion */
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-content.show {
    max-height: 200px;
}

.faq-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
}

.faq-toggle.active .fa-chevron-down,
.faq-toggle .fa-chevron-down.rotate-180 {
    transform: rotate(180deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lg\:col-span-1, .lg\:col-span-2, .lg\:col-span-3 {
        grid-column: span 1;
    }
    
    #color-wheel, #saturation-square {
        width: 150px !important;
        height: 150px !important;
    }
    
    .color-swatch {
        height: 50px;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        text-align: center;
    }
}

/* Dark mode specific styles */
.dark-mode {
    background-color: #1f2937;
    color: #f9fafb;
}

.dark-mode .bg-white {
    background-color: #374151;
}

.dark-mode .text-gray-900 {
    color: #f9fafb;
}

.dark-mode .text-gray-700 {
    color: #d1d5db;
}

.dark-mode .text-gray-600 {
    color: #9ca3af;
}

.dark-mode .border-gray-200 {
    border-color: #4b5563;
}

/* Gradient Generator Styles */
.gradient-type-btn.active {
    background-color: #2563eb;
    color: white;
}

.gradient-type-btn:not(.active):hover {
    background-color: #d1d5db;
}

.color-stop-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.color-stop-item input[type="color"] {
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.color-stop-item input[type="range"] {
    flex: 1;
    margin: 0 1rem;
}

.color-stop-item .remove-btn {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s;
}

.color-stop-item .remove-btn:hover {
    color: #dc2626;
}

.gradient-presets button {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.gradient-presets button:hover {
    opacity: 0.9;
}

#gradient-preview {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#gradient-css-output {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

.dark-mode .border-gray-300 {
    border-color: #6b7280;
}

.dark-mode .bg-gray-50 {
    background-color: #4b5563;
}

.dark-mode .bg-gray-100 {
    background-color: #6b7280;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .color-swatch {
        border-width: 3px;
    }
    
    button {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    header,
    footer,
    .toast,
    .copy-btn {
        display: none;
    }
    
    .color-swatch {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}