﻿/* Color Picker Tool - Standardized Styles */

:root {
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

/* Tool Page Layout */
.tool-page {
    padding: 2rem 0;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tool-description {
    font-size: 1.1rem;
    color: var(--text-color-secondary);
    margin: 0 auto;
    max-width: 600px;
}

/* Two-column layout: tool content + sidebar */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-bottom: 3rem;
}

.tool-main {
    display: flex;
    flex-direction: column;
}

.tool-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Tool Options */
.tool-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--hover-color);
    border-color: var(--primary-color);
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.action-btn.success {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.action-btn.success:hover {
    background: #059669;
    border-color: #059669;
}

/* Error Message */
.error-msg {
    display: none;
    padding: 1rem;
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--error-color);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.error-msg.show {
    display: block;
}

/* Tool Content Columns */
.tool-content-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-column,
.output-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Sections */
.section {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.section h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 600;
}

.section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
}

/* RGB Sliders */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#colorInput {
    width: 150px;
    height: 150px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.color-preview {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Eyedropper Section */
.eyedropper-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Eyedropper Button */
.eyedropper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.eyedropper-btn svg {
    width: 24px;
    height: 24px;
}

.eyedropper-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.eyedropper-btn:active {
    transform: scale(0.95);
}

.eyedropper-btn:disabled {
    background: var(--text-color-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

.eyedropper-text {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    line-height: 1.5;
}

.eyedropper-hint {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin: 0.75rem 0 0 0;
    font-style: italic;
    padding: 0 1rem;
    line-height: 1.4;
}

/* RGB Sliders */
.rgb-slider-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.slider-control {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.slider-control label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slider-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--input-bg);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.slider-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider-control input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.slider-control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.slider-value {
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

/* Manual Color Input Fields */
.input-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-field label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.input-field input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text-color);
    transition: border-color 0.2s;
}

.input-field input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Color Formats */
.color-formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.format-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.format-group label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.format-group input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text-color);
}

.format-group .copy-btn {
    padding: 0.5rem 1rem;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.format-group .copy-btn:hover {
    background: #059669;
}

/* Shades & Tints */
.shades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.shade-color {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shade-color:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.shade-swatch {
    width: 100%;
    height: 60px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.shade-label {
    font-size: 0.8rem;
    color: var(--text-color);
    font-weight: 500;
    text-transform: capitalize;
}

.shade-value {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* Color Harmony */
.harmony-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

/* Generic color swatch for clickable colors */
.color-swatch {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 8px;
}

.color-swatch:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.harmony-color {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.harmony-color:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.harmony-color-swatch {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.harmony-color-label {
    font-size: 0.85rem;
    color: var(--text-color);
    font-weight: 500;
    text-transform: capitalize;
}

.harmony-color-value {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 600;
}

/* Contrast Checker */
.contrast-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.contrast-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contrast-input label {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.contrast-input input {
    width: 150px;
    height: 100px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.contrast-result {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contrast-ratio,
.wcag-level {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
}

.ratio-label,
.level-label {
    font-weight: 500;
    color: var(--text-color);
}

.ratio-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.level-value {
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.level-value.pass {
    background: #4caf50;
    color: white;
}

.level-value.fail {
    background: #f44336;
    color: white;
}

/* Contrast Preview */
.contrast-preview {
    margin-top: 1.5rem;
    padding: 2rem;
    border-radius: var(--radius-sm);
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    transition: all 0.3s ease;
}

.contrast-preview p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.5;
    word-break: break-word;
}

/* Sidebar */
.tool-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.related-tools,
.tool-tips {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.related-tools h4,
.tool-tips h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1rem;
}

.related-tools ul,
.tool-tips ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-tools li,
.tool-tips li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
}

.related-tools li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.tool-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.related-tools a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.related-tools a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.related-tools li:last-child,
.tool-tips li:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .tool-content-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .color-picker-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    #colorInput,
    .color-preview {
        width: 120px;
        height: 120px;
    }

    .color-formats-grid {
        grid-template-columns: 1fr;
    }

    .harmony-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .shades-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }

    .input-fields-grid {
        grid-template-columns: 1fr;
    }

    .contrast-inputs {
        grid-template-columns: 1fr;
    }

    .tool-sidebar {
        flex-direction: column;
        gap: 1.5rem;
    }

    .use-case-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-options {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .section {
        padding: 1rem;
    }

    #colorInput,
    .color-preview {
        width: 100px;
        height: 100px;
    }
}    }
}
