/* --- Color Converter Wrapper --- */
#cv-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background-color: #111827;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #374151;
    color: white;
}

/* --- Preview Area --- */
.cv-preview-container {
    width: 100%;
    height: 150px;
    border: 4px solid #333;
    border-radius: 8px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    background-image: 
        linear-gradient(45deg, #222 25%, transparent 25%), 
        linear-gradient(-45deg, #222 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #222 75%), 
        linear-gradient(-45deg, transparent 75%, #222 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #111; /* Checkboard background for transparency */
}

#cv-preview {
    width: 100%;
    height: 100%;
    background-color: #000000;
    transition: background-color 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    font-size: 1.2rem;
    color: white; /* Dynamically inverted in JS ideally, but white with shadow works */
}

/* --- Controls Grid --- */
.cv-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

@media (min-width: 768px) {
    .cv-controls {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* --- Input Groups --- */
.cv-group {
    background-color: #1f2937;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #374151;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.cv-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

/* Text Inputs */
.cv-input {
    background-color: #000;
    border: 2px solid #374151;
    color: #fff;
    padding: 10px;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 1rem;
    border-radius: 4px;
    outline: none;
    width: 100%;
    text-transform: uppercase;
    text-align: center;
}

.cv-input:focus {
    border-color: #FBBF24; /* Amber */
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.cv-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cv-copy-btn {
    background: #374151;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.cv-copy-btn:hover { background: #4b5563; }
.cv-copy-btn:active { transform: translateY(2px); }

/* --- Sliders (Range) --- */
.cv-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cv-slider-label {
    width: 30px;
    font-size: 0.8rem;
    font-weight: bold;
}

.cv-slider {
    flex-grow: 1;
    -webkit-appearance: none;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.cv-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #000;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
    margin-top: -6px; /* center thumb */
}

.cv-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #000;
}

/* Custom Track Colors via JS or classes */
.cv-slider.red::-webkit-slider-runnable-track { background: linear-gradient(to right, #000, #ff0000); }
.cv-slider.green::-webkit-slider-runnable-track { background: linear-gradient(to right, #000, #00ff00); }
.cv-slider.blue::-webkit-slider-runnable-track { background: linear-gradient(to right, #000, #0000ff); }

/* Number inputs next to sliders */
.cv-num-input {
    width: 60px;
    background: #000;
    border: 1px solid #4b5563;
    color: white;
    padding: 5px;
    font-family: 'Press Start 2P', monospace, sans-serif;
    text-align: right;
    border-radius: 4px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
    #cv-wrapper { padding: 15px; }
    .cv-preview-container { height: 100px; }
    .cv-controls { flex-direction: column; }
}