/* Color Picker Tool Styles */

/* Tool Container - Full Page Layout */
.color-picker-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(34, 33, 33);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tool-header h1 i {
    color: #329269;
    font-size: 1.8rem;
}

.tool-description {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.6;
}

/* Picker Interface */
.picker-interface {
    margin-bottom: 3rem;
}

.picker-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

/* Input Methods */
.input-methods {
    flex: 1;
}

.method-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #f3f4f6;
    overflow-x: auto;
}

.method-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.method-tab:hover {
    color: #329269;
}

.method-tab.active {
    color: #329269;
    border-bottom-color: #329269;
}

.input-method {
    display: none;
}

.input-method.active {
    display: block;
}

/* Color Wheel Method */
.color-wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg,
        rgba(248, 250, 252, 0.8) 0%,
        rgba(241, 245, 249, 0.9) 50%,
        rgba(248, 250, 252, 0.8) 100%
    );
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}

.color-wheel-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
        rgba(50, 146, 109, 0.03) 0%,
        rgba(50, 146, 109, 0.01) 50%,
        transparent 70%
    );
    z-index: 0;
    animation: subtleRotate 20s linear infinite;
}

@keyframes subtleRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.color-wheel {
    position: relative;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    cursor: crosshair;
    background: conic-gradient(
        hsl(0, 100%, 50%),
        hsl(30, 100%, 50%),
        hsl(60, 100%, 50%),
        hsl(90, 100%, 50%),
        hsl(120, 100%, 50%),
        hsl(150, 100%, 50%),
        hsl(180, 100%, 50%),
        hsl(210, 100%, 50%),
        hsl(240, 100%, 50%),
        hsl(270, 100%, 50%),
        hsl(300, 100%, 50%),
        hsl(330, 100%, 50%),
        hsl(360, 100%, 50%)
    );
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, 0.9),
        0 0 0 12px rgba(0, 0, 0, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: 2;

    /* Touch optimization */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.color-wheel:hover {
    transform: scale(1.02);
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, 0.95),
        0 0 0 12px rgba(0, 0, 0, 0.15),
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(50, 146, 109, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

#wheelCanvas {
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;

    /* Touch optimization */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.wheel-pointer {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.2),
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 15;
    transition: all 0.2s ease;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);

    /* Touch optimization */
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.wheel-pointer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #329269;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.wheel-pointer.active {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.3),
        0 6px 16px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.brightness-slider-container {
    width: 100%;
    max-width: 320px;
    position: relative;
    z-index: 2;
}

.brightness-slider {
    width: 100%;
    height: 12px;
    border-radius: 20px;
    background: linear-gradient(to right,
        #000000 0%,
        #333333 25%,
        #666666 50%,
        #999999 75%,
        #ffffff 100%
    );
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.brightness-slider:hover {
    transform: translateY(-1px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.brightness-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 3px solid white;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.brightness-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.4);
}

.brightness-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 3px solid white;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Color Wheel Enhancements */
.color-wheel::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: linear-gradient(45deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.2) 25%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        rgba(255, 255, 255, 0.8) 100%
    );
    z-index: -1;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.color-wheel:hover::before {
    opacity: 0.8;
}

.color-wheel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 15%;
    height: 15%;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(240, 240, 240, 0.9) 70%,
        rgba(200, 200, 200, 0.8) 100%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 5;
}

/* Brightness Slider Label */
.brightness-slider-container::before {
    content: 'Brightness';
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Add glow effect to active elements */
.color-wheel.active {
    box-shadow:
        0 0 0 8px rgba(255, 255, 255, 0.95),
        0 0 0 12px rgba(0, 0, 0, 0.15),
        0 12px 40px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(50, 146, 109, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* Animated color wheel rotation on hover */
@keyframes wheelGlow {
    0% {
        filter: brightness(1) saturate(1);
    }
    50% {
        filter: brightness(1.05) saturate(1.1);
    }
    100% {
        filter: brightness(1) saturate(1);
    }
}

.color-wheel:hover {
    animation: wheelGlow 2s ease-in-out infinite;
}

/* Enhanced pointer animations */
@keyframes pointerPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 0 2px rgba(0, 0, 0, 0.2),
            0 4px 12px rgba(0, 0, 0, 0.3),
            inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow:
            0 0 0 3px rgba(0, 0, 0, 0.3),
            0 6px 16px rgba(0, 0, 0, 0.4),
            inset 0 0 0 1px rgba(255, 255, 255, 0.9),
            0 0 0 6px rgba(50, 146, 109, 0.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 0 2px rgba(0, 0, 0, 0.2),
            0 4px 12px rgba(0, 0, 0, 0.3),
            inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    }
}

.wheel-pointer.active {
    animation: pointerPulse 0.6s ease-out;
}

/* RGB/HSL Sliders Method */
.slider-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.slider-group {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.slider-group-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-align: center;
}

.slider-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.slider-row:last-child {
    margin-bottom: 0;
}

.slider-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.color-slider {
    height: 8px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    background: #e5e7eb;
}

.red-slider {
    background: linear-gradient(to right, #000000, #ff0000);
}

.green-slider {
    background: linear-gradient(to right, #000000, #00ff00);
}

.blue-slider {
    background: linear-gradient(to right, #000000, #0000ff);
}

.hue-slider {
    background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.saturation-slider {
    background: linear-gradient(to right, #808080, #ff0000);
}

.lightness-slider {
    background: linear-gradient(to right, #000000, #808080, #ffffff);
}

.slider-input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: center;
}

.slider-input:focus {
    outline: none;
    border-color: #329269;
    box-shadow: 0 0 0 2px rgba(50, 146, 109, 0.1);
}

/* Direct Input Method */
.direct-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.input-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hex-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    transition: all 0.2s ease-in-out;
}

.hex-input-group:focus-within {
    border-color: #329269;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(50, 146, 109, 0.1);
}

.hex-prefix {
    padding: 1rem 0.5rem 1rem 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #6b7280;
}

.hex-input {
    flex: 1;
    padding: 1rem 0.5rem;
    font-size: 1.125rem;
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.random-color-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.random-color-btn:hover {
    transform: scale(1.05);
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.rgb-inputs, .hsl-inputs {
    display: flex;
    gap: 0.5rem;
}

.rgb-input, .hsl-input {
    flex: 1;
    padding: 0.75rem;
    font-size: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background-color: #f9fafb;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.rgb-input:focus, .hsl-input:focus {
    outline: none;
    border-color: #329269;
    background-color: white;
    box-shadow: 0 0 0 2px rgba(50, 146, 109, 0.1);
}

/* Color Presets Method */
.preset-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.preset-category {
    background: #f9fafb;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.preset-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    text-align: center;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
}

.preset-color {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: #329269;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Color Preview Section */
.color-preview-section {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.current-color-preview {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.preview-color {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    margin: 0 auto 1rem;
    background-color: #ff0000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid white;
}

.preview-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-hex {
    font-size: 1.125rem;
    font-weight: 600;
    color: #329269;
    font-family: 'Courier New', monospace;
}

/* Result Section */
.result-section {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid #93c5fd;
}

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

.result-header {
    text-align: center;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

/* Color Formats */
.color-formats {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.format-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.format-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.format-label {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-value-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-value {
    font-family: 'Courier New', monospace;
    color: #1d4ed8;
    font-weight: 500;
    font-size: 0.875rem;
}

.copy-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 0.75rem;
}

.copy-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* Color Details */
.color-details {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-value {
    font-weight: 500;
    color: #1d4ed8;
    font-size: 0.875rem;
}

/* Color Harmonies */
.color-harmonies {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.harmony-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.harmony-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.harmony-tab {
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.harmony-tab:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.harmony-tab.active {
    background: #329269;
    color: white;
}

.harmony-colors {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.harmony-color {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease-in-out;
    position: relative;
}

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

.harmony-color::after {
    content: attr(data-hex);
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    color: #1f2937;
    white-space: nowrap;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 2.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #bae6fd;
    margin-bottom: 1.5rem;
}

.spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 4px solid #e0f2fe;
    border-top: 4px solid #1d4ed8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    color: #1d4ed8;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.025em;
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.error-message i {
    color: #dc2626;
}

/* Popular Colors */
.popular-colors {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

.popular-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-title i {
    color: #f59e0b;
}

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

.popular-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.popular-item:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.popular-color {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin: 0 auto 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
}

.popular-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.popular-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

.popular-hex {
    font-family: 'Courier New', monospace;
    color: #6b7280;
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .picker-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .color-preview-section {
        width: 100%;
        order: -1;
    }

    .current-color-preview {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 1rem;
        align-items: center;
        text-align: left;
    }

    .preview-color {
        width: 80px;
        height: 80px;
        margin: 0;
    }
}

/* Related Tools Section */
.related-tools-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.related-tools-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.related-tools-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tools-header h3 i {
    color: #667eea;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.related-tool-link {
    background: #f8fafc;
    color: #667eea;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tool-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.related-tool-link i {
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .tool-container {
        padding: 1rem;
    }

    .picker-card {
        padding: 1.5rem;
    }

    .method-tabs {
        flex-wrap: wrap;
    }

    .method-tab {
        flex: 1;
        min-width: 120px;
        /* Improve touch targets */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .slider-groups {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .format-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .harmony-tabs {
        justify-content: center;
    }

    .harmony-tab {
        flex: 1;
        min-width: 80px;
        min-height: 44px;
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

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

    .color-wheel {
        width: 250px;
        height: 250px;
    }

    #wheelCanvas {
        width: 250px;
        height: 250px;
    }

    /* Larger pointer for touch */
    .wheel-pointer {
        width: 32px;
        height: 32px;
        border-width: 5px;
    }

    .wheel-pointer::before {
        width: 10px;
        height: 10px;
    }

    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .related-tool-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    .picker-card {
        padding: 1rem;
    }

    .method-tab {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
        min-height: 48px;
    }

    .slider-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }

    .slider-label {
        font-size: 0.75rem;
    }

    .color-wheel {
        width: 200px;
        height: 200px;
    }

    #wheelCanvas {
        width: 200px;
        height: 200px;
    }

    .current-color-preview {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .preview-color {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }

    .harmony-colors {
        justify-content: center;
    }

    .harmony-color {
        width: 50px;
        height: 50px;
        /* Improve touch targets */
        min-width: 44px;
        min-height: 44px;
    }

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

    .popular-color {
        width: 50px;
        height: 50px;
    }

    /* Even larger pointer for small screens */
    .wheel-pointer {
        width: 36px;
        height: 36px;
        border-width: 6px;
    }

    .wheel-pointer::before {
        width: 12px;
        height: 12px;
    }

    /* Improve touch targets for copy buttons */
    .copy-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }

    /* Improve touch targets for popular items */
    .popular-item {
        min-height: 100px;
        padding: 1.25rem 1rem;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .picker-card,
    .result-section,
    .popular-colors {
        border-width: 2px;
        border-color: #000000;
    }

    .method-tab.active {
        background: #000000;
        color: #ffffff;
    }

    .copy-btn {
        background: #000000;
        border: 1px solid #ffffff;
    }

    .related-tools-section {
        padding: 1rem;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Focus Styles for Accessibility */
.method-tab:focus,
.copy-btn:focus,
.harmony-tab:focus,
.popular-item:focus,
.preset-color:focus,
.random-color-btn:focus {
    outline: 2px solid #329269;
    outline-offset: 2px;
}

/* Touch Device Optimizations */
.touch-device .color-wheel {
    /* Larger touch target */
    cursor: pointer;
}

.touch-device .wheel-pointer {
    /* More visible on touch devices */
    width: 32px;
    height: 32px;
    border-width: 5px;
}

.touch-device .wheel-pointer::before {
    width: 10px;
    height: 10px;
}

.touch-device .method-tab,
.touch-device .harmony-tab,
.touch-device .copy-btn,
.touch-device .popular-item {
    /* Ensure minimum touch target size */
    min-height: 44px;
}

.touch-device .preset-color {
    /* Larger preset colors for touch */
    width: 48px;
    height: 48px;
    min-width: 44px;
    min-height: 44px;
}

.touch-device .harmony-color {
    /* Larger harmony colors for touch */
    width: 64px;
    height: 64px;
    min-width: 44px;
    min-height: 44px;
}

/* Prevent text selection on touch devices */
.touch-device .color-wheel,
.touch-device .wheel-pointer,
.touch-device #wheelCanvas {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Print Styles */
@media print {
    .color-picker-tool {
        background: white;
    }

    .method-tabs,
    .copy-btn,
    .random-color-btn {
        display: none;
    }

    .result-section {
        background: white;
        border: 1px solid #000000;
    }
}
