.filters-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap; /* keep items on one line on wide screens */
    margin: 12px 0 20px;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    padding: 10px 12px;
}

.search-container {
    flex: 1 1 260px;
    min-width: 220px;
}

#webColorsSearchInput {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    height: 40px; /* consistent control height */
}

#hueSliderContainer {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* keep label, slider, value together */
    flex: 0 0 auto; /* act as a single block */
}

#hueSlider {
    width: 180px;
    margin: 0; /* align with input vertically */
}

/* Keep the whole hue group aligned with the search input and push it to the right */
.filters-container > #hueSliderContainer {
    margin-left: auto;
}

#hueSliderContainer label,
#hueSliderContainer #hueValue {
    display: inline-flex;
    align-items: center;
}

.web-colors-header h1 {
    font-weight: 600;
    font-size: 1.8rem;
    margin: 20px 0 8px; /* 20px space above heading */
}

.web-colors-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: box-shadow .2s, transform .05s;
}
.icon-button:hover { box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.icon-button:active { transform: translateY(1px); }

@media (max-width: 640px) {
    #hueSlider { width: 140px; }
}

/* Optional: allow wrap only on very small screens if needed */
@media (max-width: 640px) {
    .filters-container { flex-wrap: wrap; }
}

/* Web Colors header layout tweaks */
.web-colors-header h1 { text-align: center; }
.web-colors-header { flex-direction: column; align-items: center; justify-content: center; }
.web-colors-header .filters-container { justify-content: center; width: 100%; }

#web-colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* better space utilization */
    gap: 20px;
}

/* New styles for color-card */
.color-card {
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 300px; /* Fixed height */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative; /* Needed for absolute positioning of info-btn */
}

.color-swatch {
    width: 100%;
    height: 100px; /* Fixed height for swatch */
    border-radius: 5px 5px 0 0;
    position: relative; /* Added for info-btn positioning */
}

.color-details {
    background-color: white;
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.color-name {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center; /* Center align color name */
}

.color-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 8px; /* subtle horizontal margin */
    padding: 2px 0;
}

.code-label {
    font-weight: 400; /* lighter for a minimal look */
    margin-right: 2px;
    flex-shrink: 0;
    font-size: 0.8em;
    color: #666;
    width: 44px; /* align labels vertically */
}

.code-value {
    flex: 1 1 auto;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82em;
    color: #222;
}

.copy-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 0.85em;
    padding: 0 4px;
    flex-shrink: 0;
    opacity: 0.4; /* reduce visual weight */
    transition: color 0.2s ease, opacity 0.2s ease;
}

.color-code-row:hover .copy-button {
    color: #333;
    opacity: 1;
}

/* Info Button Styles */
.color-swatch .info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 1.1em;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
    z-index: 10;
}

.color-swatch:hover .info-btn {
    opacity: 1; /* Show on hover */
}

/* Override NoN335 width for color-swatch */
.color-card .color-swatch.NoN335 {
    width: 100% !important;
}

/* Existing styles */
.web-colors-page .main-content {
    margin-top: 140px !important;
}

.web-colors-page .right-sidebar {
    padding-top: calc(100px + 2.5em) !important;
}

.web-colors-page .left-sidebar {
    padding-top: calc(100px + 2.5em) !important;
}

.web-colors-page .page-container {
    margin-top: 0px !important;
}
