/**
 * ZeroServerTools.org - Color Tools Stylesheet
 * Styles for: Color Palette Generator & Color Grab tools
 * Load this file only on pages using these tools
 */

/* ============================================
   COLOR PALETTE GENERATOR STYLES
   ============================================ */
.color-count-control {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #F9FAFB;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.color-count-control label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.slider-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--color-border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    background: #0a7068;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: background var(--transition-fast);
}

.slider::-moz-range-thumb:hover {
    background: #0a7068;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slider-value {
    display: inline-block;
    min-width: 3rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}

.color-count-control small {
    display: block;
    color: var(--color-text-medium);
    font-size: 0.9rem;
}

.image-preview-container {
    margin: 2rem 0;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.color-swatch {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.color-swatch:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.color-swatch-label {
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: center;
    font-family: var(--font-mono);
}

.color-details-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.color-details-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.color-details-table thead {
    background: #F9FAFB;
    font-weight: 600;
}

.color-details-table th {
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text-dark);
}

.color-details-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.table-color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.color-details-table code {
    background: #F3F4F6;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--color-text-dark);
}

.palette-results {
    margin-top: 2rem;
}

.palette-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2rem 0;
    padding: 2rem;
    background: #F9FAFB;
    border-radius: 8px;
}

/* ============================================
   COLOR GRAB STYLES
   ============================================ */
.color-grab-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.color-grab-workspace {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.color-grab-canvas-wrap {
    flex: 1;
    min-width: 300px;
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #eee url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYNgvwMDww3zM2EwjhgxHDAA+Q3g5oG7AJg244Y1BqAEsQAw/zMcO68YNAwBfV4m+JkR1zAAAAABJRU5ErkJggg==');
    cursor: crosshair;
}

.color-grab-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.color-grab-palette {
    width: 350px;
    flex-shrink: 0;
    background: var(--color-bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .color-grab-palette {
        width: 100%;
    }
}

.swatch-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-top: 1rem;
}

.swatch-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: transform 0.2s;
    cursor: pointer;
}

.swatch-item:hover {
    transform: translateX(2px);
    border-color: var(--color-primary);
}

.swatch-color {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.swatch-info {
    flex: 1;
    font-size: 0.85rem;
    font-family: monospace;
    line-height: 1.4;
    color: var(--color-text-dark);
}

.swatch-hex {
    font-weight: bold;
    font-size: 1rem;
}
