.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.color-box {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.color-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-color: #007bff;
}

.color-swatch {
    width: 100%;
    height: 50px;
    border: 1px solid #ccc;
    margin-bottom: 10px;
}

.color-info {
    font-family: monospace;
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Highlight effect for the target color when returning from detail page */
.color-box.highlighted {
    outline: 3px solid #007bff;
    outline-offset: 2px;
    animation: highlight-pulse 0.5s ease-in-out;
}

@keyframes highlight-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Search container and input styling */
.search-container {
    position: sticky;
    top: 0;
    z-index: 999;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    transition: box-shadow 0.3s ease;
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    align-items: center;
    gap: 20px;
}

/* Mobile responsive layout - stack header and search vertically */
@media (max-width: 768px) {
    .search-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 15px;
        padding: 15px;
    }

    .search-input {
        justify-self: stretch;
        width: 100%;
        order: 2; /* Move search input below header */
    }

    .site-header {
        order: 1; /* Keep header at top */
        justify-self: center;
    }
}

.search-container.sticky {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
}

.search-input {
    justify-self: center;
    width: 80%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input::placeholder {
    color: #6c757d;
}

/* Hidden class for filtered out colors */
.color-box.hidden {
    display: none;
}
