/* RGB to Pantone Converter Styles */
.rgb-pantone-converter {
    margin-bottom: 2rem;
}

.converter-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .converter-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

/* Input Panel */
.input-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Color Display Card */
.color-display-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.color-display-card:hover {
    transform: translateY(-2px);
}

.color-preview-large {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    background: rgb(220, 53, 69);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.color-picker-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.color-picker-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 5;
}

.color-preview-large:hover .color-picker-icon {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-picker-icon svg {
    width: 20px;
    height: 20px;
    color: #667eea;
}

.color-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 1.5rem;
    display: flex;
    align-items: flex-end;
}

.color-hex-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

@media (max-width: 767px) {
    .color-display-card {
        padding: 1.5rem;
    }
    
    .color-hex-display {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }
    
    .color-picker-icon {
        width: 36px;
        height: 36px;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .color-picker-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* RGB Controls Panel */
.rgb-controls-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

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

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

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

.channel-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-input {
    width: 70px;
    padding: 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    background: #f7fafc;
    transition: all 0.2s ease;
    
}

.channel-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.color-slider {
    width: 100%;
    height: 16px;
    border-radius: 4px;
    background: transparent;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;
}

.color-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: transparent;
    border-radius: 4px;
}

.color-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    margin-top: -5px;
    position: relative;
}

.color-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.color-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    background: transparent;
    border-radius: 4px;
    border: none;
}

.color-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    position: relative;
}

.color-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.slider-track {
    position: relative;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-top: -16px;
    z-index: 1;
    pointer-events: none;
}

.slider-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.1s ease;
}

.rgb-channel-group[data-channel="red"] .slider-fill {
    background: linear-gradient(to right, #000, #f00);
}

.rgb-channel-group[data-channel="green"] .slider-fill {
    background: linear-gradient(to right, #000, #0f0);
}

.rgb-channel-group[data-channel="blue"] .slider-fill {
    background: linear-gradient(to right, #000, #00f);
}

/* Color Formats Panel */
.color-formats-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.format-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.format-item:hover {
    background: #edf2f7;
    transform: translateY(-1px);
}

.format-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

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

.copy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #718096;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.copy-button:hover {
    background: #e2e8f0;
    color: #667eea;
}

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

.copy-button svg {
    width: 16px;
    height: 16px;
}

/* Preset Colors Section */
.preset-colors-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.preset-color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-color-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.preset-color-btn:active {
    transform: translateY(0);
}

.preset-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preset-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #4a5568;
}

/* Results Panel */
.results-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.results-subtitle {
    font-size: 0.875rem;
    color: #718096;
    margin: 0.5rem 0 0 0;
}

.pantone-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.pantone-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.pantone-card:hover {
    border-color: #667eea;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.pantone-color-swatch {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
}

.pantone-card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pantone-code {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
    
}

.pantone-match-score {
    font-size: 0.75rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.match-bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.match-fill {
    height: 100%;
    background: linear-gradient(to right, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.pantone-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pantone-copy-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #4a5568;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pantone-copy-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pantone-copy-btn svg {
    width: 14px;
    height: 14px;
}

.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #718096;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

.info-text {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #4a5568;
    margin: 0 0 1rem 0;
}

.info-text:last-child {
    margin-bottom: 0;
}

.info-list {
    margin: 0;
    padding-left: 1.25rem;
    list-style-type: disc;
}

.info-list li {
    font-size: 0.875rem;
    line-height: 1.8;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.info-list li:last-child {
    margin-bottom: 0;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 250px;
    max-width: 400px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #10b981;
}

.toast-message {
    font-size: 0.875rem;
    color: #1a1a1a;
    flex: 1;
}

.toast-message strong {
    font-weight: 600;
    color: #667eea;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .converter-wrapper {
        gap: 1.5rem;
    }
    
    .color-display-card,
    .rgb-controls-panel,
    .color-formats-panel,
    .preset-colors-section,
    .results-panel {
        padding: 1.25rem;
    }
    
    .format-grid {
        grid-template-columns: 1fr;
    }
    
    .preset-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .pantone-results {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    .info-section {
        grid-template-columns: 1fr;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pantone-results {
        grid-template-columns: 1fr;
    }
}
