/* styles.css */

canvas {
    border: 1px solid black;
    max-width: 100%;
}
.container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.controls {
    margin: 10px 0;
}
.histogram-bar {
    height: 20px;
    margin: 2px 0;
    padding: 0 5px;
    color: white;
    font-family: monospace;
}

.histogram-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    transition: background-color 0.2s ease-in-out;
}

.color-box {
    width: 30px;
    height: 30px;
    border: 1px solid #444;
    margin-right: 10px;
}

.color-info {
    font-size: 14px;
    color: #333;
}
.histogram-entry {
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    background-color: #f5f5f5;
    border-radius: 4px;
}
#thresholdSlider {
    -webkit-appearance: none;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}

#thresholdSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #666;
    border-radius: 50%;
    cursor: pointer;
}

.histogram-row.highlight {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.grimdark-label {
    position: relative;
    display: inline-block;
    font-family: "Arial Black", sans-serif;
    color: #8b0000;
    text-shadow: 0 0 10px #ff000040;
}
/* Basic Overlay Styles */
.overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Dim background */
    padding-top: 60px; /* Space from top */
}

.overlay-content {
    background-color: #fefefe;
    margin: 5% auto; /* Centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px; /* Adjusted max-width */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.overlay-content h2 {
    margin-top: 0;
    text-align: center;
}

/* Container for all brand sections */
.color-list {
    max-height: 400px; /* Or adjust */
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 15px;
    display: block; /* Ensure it's not grid */
}

.overlay-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap; /* Allow buttons to wrap */
}

/* Styling for each brand's section */
.brand-section {
    margin-bottom: 5px; /* Reduced margin */
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.brand-header {
    background-color: #e8e8e8; /* Slightly darker for brand */
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.brand-header::after {
    content: '−';
    font-size: 1.2em;
    font-weight: bold;
    transition: transform 0.2s ease-in-out;
}

.brand-header.collapsed::after {
    content: '+';
    transform: rotate(180deg); /* Optional: rotate plus */
}

/* Container holding all type sections within a brand */
.brand-types-container {
    padding-left: 15px; /* Indent type sections */
    border-top: 1px solid #eee;
}
.brand-types-container.collapsed {
    display: none;
}

/* Container for a single type section */
.type-section {
    margin-top: 5px;
    margin-bottom: 5px;
}

/* Header for a specific type (e.g., "Base", "Layer") */
.type-header {
    background-color: #f5f5f5; /* Lighter for type */
    padding: 6px 10px;
    cursor: pointer;
    font-weight: normal; /* Less emphasis than brand */
    font-style: italic;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-radius: 3px;
    border: 1px solid #f0f0f0;
}

.type-header::after {
    content: '−';
    font-size: 1.1em;
    transition: transform 0.2s ease-in-out;
}

.type-header.collapsed::after {
    content: '+';
    transform: rotate(180deg); /* Optional: rotate plus */
}

/* List of colors within a specific type */
.type-color-list {
    padding: 10px 0 5px 15px; /* Indent colors further */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    /* border-top: 1px dashed #eee; */ /* Optional separator */
}

.type-color-list.collapsed {
    display: none;
}

/* Individual color item styling */
.color-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.color-list-item:hover {
    background-color: #eee;
}
.color-list-item input[type="checkbox"] {
    margin-right: 5px;
}
.color-list-item .swatch {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Button styling */
.button-like-label {
    display: flex; /* Use flex to help center content */
    align-items: center; /* Vertical centering */
    justify-content: center; /* Horizontal centering */
    height: 40px; /* Explicit height */
    padding: 8px 15px;
    margin: 0; /* Reset margin */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f0f0f0;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 1em;
    text-align: center;
    line-height: 1; /* Adjust line height for better centering */
    box-sizing: border-box; /* Include padding/border in height */
    /* vertical-align: middle; */ /* Less effective with flex */
}

/* Ensure button inherits or has consistent line-height if needed */
button.button-like-label {
    /* line-height: normal; */ /* Or match the label's line-height */
    /* font-family and font-size are already set */
}

.button-like-label:hover {
    background-color: #e0e0e0;
}

.button-like-label:active {
    background-color: #d0d0d0;
}
