/* Raspberry Color Tool CSS */

/* Custom slider styling */
input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: #f0f0f0;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E30B5C;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #E30B5C;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Hover effects for color palette */
.palette-color {
    transition: transform 0.2s;
    position: relative;
}

.palette-color:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.palette-color:active {
    transform: scale(0.98);
}

/* Color sample in table */
.color-sample {
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Copy button animations */
.copy-icon {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.copy-icon:hover {
    transform: scale(1.2);
}

.copy-icon:active {
    transform: scale(0.9);
}

/* Preset color buttons */
.preset-color {
    transition: all 0.2s;
    border: 2px solid transparent;
}

.preset-color:hover {
    transform: scale(1.15);
    border: 2px solid white;
}

.preset-color:active {
    transform: scale(0.95);
}

/* Current color display */
#currentColor {
    transition: background-color 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    #currentColor {
        height: 120px;
    }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #E30B5C;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8B0046;
}

/* Focus styles for accessibility */
a:focus, button:focus, input:focus, select:focus {
    outline: 2px solid #E30B5C;
    outline-offset: 2px;
}

/* Tooltip styling for preset colors */
.preset-color::after {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.preset-color:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Enhance text readability */
.text-black {
    color: #333;
}

/* Enhance table hover effect */
.hover\:bg-gray-50:hover {
    background-color: #fff5f8;
}

/* Custom styling for the palette type select */
#palette-type {
    transition: border-color 0.2s;
}

#palette-type:hover {
    border-color: #E30B5C;
}

/* Add a subtle raspberry pattern to the page background */
body.bg-gray-50 {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23E30B5C' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
}

/* Add a subtle hover effect to the "Explore Other Colors" buttons */
.grid-cols-2 a, .grid-cols-4 a {
    transition: all 0.3s;
}

.grid-cols-2 a:hover, .grid-cols-4 a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Header styling */
nav {
    border-bottom: 3px solid #E30B5C;
}

/* Footer link hover effect */
footer a:hover {
    color: #E30B5C !important;
}

/* Table header styling */
th.bg-gray-50 {
    background-color: #fff5f8;
    border-bottom: 2px solid #E30B5C;
}

/* Enhance mobile menu */
#mobile-menu {
    border-top: 1px solid rgba(227, 11, 92, 0.2);
}

/* Add subtle animation to copy success icon */
.fa-check {
    color: #8B0046;
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Style for the main heading */
h1.text-raspberry-DEFAULT {
    background: linear-gradient(to right, #E30B5C, #8B0046);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

/* Add subtle shadow to cards */
.shadow-sm {
    box-shadow: 0 2px 10px rgba(227, 11, 92, 0.05);
}

/* Add hover effect to color variants table rows */
.hover\:bg-gray-50:hover {
    background-color: rgba(227, 11, 92, 0.05);
}

/* Enhance select dropdown */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23E30B5C' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

/* Add subtle transition to color sample */
.color-sample {
    transition: transform 0.2s;
}

.color-sample:hover {
    transform: scale(1.1);
}

/* Style for code snippets in hex values */
.bg-gray-100 {
    background-color: #fff5f8;
    border: 1px solid rgba(227, 11, 92, 0.1);
}

/* Add subtle animation to page load */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container > * {
    animation: fadeIn 0.5s ease-out forwards;
}

.container > *:nth-child(2) {
    animation-delay: 0.1s;
}

.container > *:nth-child(3) {
    animation-delay: 0.2s;
}

.container > *:nth-child(4) {
    animation-delay: 0.3s;
}

.container > *:nth-child(5) {
    animation-delay: 0.4s;
}

/* Enhance accessibility for color contrast */
.text-gray-600 {
    color: #5a5a5a;
}

/* Add subtle texture to the current color display */
#currentColor {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.05) 75%, transparent 75%, transparent);
    background-size: 4px 4px;
}

/* Improve focus visibility for keyboard navigation */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid #B21E4B;
    outline-offset: 3px;
}

/* Print styles */
@media print {
    nav, footer, .copy-icon, #mobile-menu-button {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .shadow-sm {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .bg-white {
        background-color: #1a1a1a !important;
    }
    
    .text-black, .text-gray-800 {
        color: #e0e0e0 !important;
    }
    
    .text-gray-600, .text-gray-500 {
        color: #b0b0b0 !important;
    }
    
    .border-gray-200 {
        border-color: #333 !important;
    }
    
    .bg-gray-50 {
        background-color: #111 !important;
    }
    
    .bg-gray-100 {
        background-color: #222 !important;
    }
    
    input[type="range"] {
        background: #333 !important;
    }
    
    .shadow-sm {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
    }
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Add raspberry-themed selection color */
::selection {
    background-color: rgba(227, 11, 92, 0.3);
    color: inherit;
}

/* Enhance table responsiveness */
@media (max-width: 640px) {
    table {
        display: block;
        overflow-x: auto;
    }
    
    th, td {
        white-space: nowrap;
    }
}