/* Converter Container */
.hsv-pantone-converter {
    margin-bottom: 2rem;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Panel Styles */
.input-panel,
.output-panel {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #1a1a1a;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Control Group */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.control-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

/* Slider Styles */
.slider-wrapper {
    position: relative;
    height: 24px;
    border-radius: 12px;
    overflow: visible;
    display: flex;
    align-items: center;
}

.slider-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 12px;
    pointer-events: none;
    border-radius: 6px;
    z-index: 0;
}

/* Hue: full spectrum */
.slider-wrapper--hue .slider-track {
    background: linear-gradient(to right,
        #ff0000 0%,
        #ff8000 8.33%,
        #ffff00 16.67%,
        #80ff00 25%,
        #00ff00 33.33%,
        #00ff80 41.67%,
        #00ffff 50%,
        #0080ff 58.33%,
        #0000ff 66.67%,
        #8000ff 75%,
        #ff00ff 83.33%,
        #ff0080 91.67%,
        #ff0000 100%
    );
}

/* Saturation: gray to full color (red as default) */
.slider-wrapper--saturation .slider-track {
    background: linear-gradient(to right, #808080, #ff0000);
}

/* Value: black to white */
.slider-wrapper--value .slider-track {
    background: linear-gradient(to right, #000000, #ffffff);
}

.color-slider {
    position: relative;
    width: 100%;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 1;
    margin: 0;
    padding: 0;
}

.color-slider::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 6px;
    background: transparent;
}

.color-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    margin-top: -12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-slider::-webkit-slider-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.color-slider::-moz-range-track {
    height: 12px;
    border-radius: 6px;
    background: transparent;
}

.color-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.color-slider::-moz-range-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* Number Input */
.number-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.number-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.number-input::-webkit-inner-spin-button,
.number-input::-webkit-outer-spin-button {
    opacity: 1;
}

/* Color Display */
.color-display-wrapper {
    margin-bottom: 1.5rem;
}

.color-display {
    width: 100%;
    height: 256px;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.color-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.color-display-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff0000;
    position: relative;
}

.color-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Pantone Result Card */
.pantone-result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.25rem;
    color: #ffffff;
}

.pantone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pantone-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.copy-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.copy-button:active {
    transform: scale(0.95);
}

.pantone-code {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    font-variant-numeric: tabular-nums;
}

.match-indicator {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.match-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.match-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 95%;
}

.match-percentage {
    font-size: 0.875rem;
    font-weight: 600;
    align-self: flex-end;
}

/* Color Formats Section */
.color-formats-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.formats-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

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

.format-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.format-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.format-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.format-value-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.format-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    
    flex: 1;
    word-break: break-all;
}

.format-copy {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.375rem;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.format-copy:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.format-copy:active {
    transform: scale(0.95);
}

/* Quick Samples Section */
.quick-samples-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.samples-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

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

.sample-chip {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sample-chip:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.sample-chip:active {
    transform: translateY(0);
}

.sample-color {
    display: block;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.sample-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
}

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

    .input-panel,
    .output-panel {
        padding: 1.25rem;
    }

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

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

    .pantone-code {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .hsv-pantone-converter {
        margin-top: 1.5rem;
    }

    .input-panel,
    .output-panel {
        padding: 1rem;
        border-radius: 12px;
    }

    .panel-title {
        font-size: 1.125rem;
    }

    .control-group {
        gap: 1.25rem;
    }

    .color-display {
        border-radius: 10px;
    }

    .pantone-result-card {
        padding: 1rem;
    }

    .pantone-code {
        font-size: 1.125rem;
    }

    .format-card {
        padding: 0.875rem;
    }

    .sample-chip {
        padding: 0.625rem;
    }

    .sample-color {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
}

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

/* Focus States */
.color-slider:focus-visible,
.number-input:focus-visible,
.copy-button:focus-visible,
.format-copy:focus-visible,
.sample-chip:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
