/* /css/acces.css ou à ajouter dans style.css */

/* --- Style de l'aperçu lumineux --- */
#preview-light {
    width: 100%;
    height: 10vh;
    border-radius: 0.5rem;
    border: 1px solid #333;
    /* dark-accent ou similaire */
    background-color: #FF0000;
    /* Sera écrasé par JS */
    box-shadow: 0 0 20px 5px rgba(255, 0, 0, 0.5);
    /* Sera écrasé par JS */
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    animation-iteration-count: infinite;
    /* Important pour les effets */
    animation-timing-function: linear;
    /* Généralement linéaire pour les cycles */
    /* animation-name: none; */
    /* Assuré par JS */
}

/* --- Animations pour les effets (définies ici, appliquées via JS) --- */
@keyframes fade-anim {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

@keyframes strobe-anim {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes BPM-anim {
    0% {
        opacity: 0;
    }

    17% {
        opacity: 1;
    }

    34% {
        opacity: 0;
    }

    44% {
        opacity: 0;
    }

    56% {
        opacity: 0.7;
    }

    68% {
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}


/* --- Style du Slider de Teinte (utilisant la classe .slider-hue) --- */
.slider-hue {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 25px;
    border-radius: 5px;
    background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
    outline: none;
    border: 1px solid #444;
    cursor: pointer;
}

.slider-hue::-webkit-slider-thumb {
    /* Pour Chrome/Edge/Safari */
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 35px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    margin-top: -5px;
    /* Centre verticalement */
}

.slider-hue::-moz-range-thumb {
    /* Pour Firefox */
    width: 15px;
    height: 35px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* --- Styles génériques pour les autres sliders (Luminosité, Vitesse) --- */
.slider-luminosity,
.slider-speed {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    /* Dégradé simple gris par défaut pour vitesse */
    background: linear-gradient(to right, #333, #eee);
    outline: none;
    border: 1px solid #444;
    cursor: pointer;
    transition: opacity 0.3s ease;
    /* Pour l'effet disabled */
}

/* Style spécifique pour la luminosité (montre noir vers couleur actuelle) */
/* Optionnel: tu peux mettre à jour --hue dynamiquement via JS si tu veux un dégradé précis */
.slider-luminosity {
    background: linear-gradient(to right, #000, hsl(var(--hue, 0), 100%, 50%));
}

.slider-luminosity::-webkit-slider-thumb,
.slider-speed::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ddd;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    margin-top: -5px;
    /* Centre */
}

.slider-luminosity::-moz-range-thumb,
.slider-speed::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ddd;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

/* Style quand le slider vitesse est désactivé */
.slider-speed:disabled {
    cursor: not-allowed;
    /* L'opacité est gérée par JS via la classe opacity-50 de Tailwind */
}

.slider-speed:disabled::-webkit-slider-thumb {
    cursor: not-allowed;
    background: #888;
}

.slider-speed:disabled::-moz-range-thumb {
    cursor: not-allowed;
    background: #888;
}

/* --- Style pour l'effet de hover "Spotlight" (btn-hover-effect) --- */
/* (Copie ici le bloc CSS pour .btn-hover-effect si tu ne l'as pas mis dans style.css) */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.2s ease-out;
}

.btn-hover-effect:hover {
    transform: scale(1.03);
}

.btn-hover-effect::before {
    content: '';
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    transform: translate(-50%, -50%);
    width: 0px;
    height: 0px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    opacity: 0;
    z-index: -1;
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
}

.btn-hover-effect:hover::before {
    width: 300px;
    height: 300px;
    opacity: 1;
}

.btn-hover-effect>* {
    position: relative;
    z-index: 2;
}

/* --- NOUVEAU : Color Picker 2D (Hue x Brightness) --- */
.color-picker-container {
    position: relative;
    width: 100%;
    height: 15vh;
    border-radius: 0.5rem;
    border: 1px solid #444;
    cursor: crosshair;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    /* Important for touch dragging */
    /* Layer 1: Hue gradient (Left to Right) */
    /* Layer 2: Brightness gradient (Top to Bottom: White -> Transparent -> Black) */
    background:
        linear-gradient(to bottom, #ffffff 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0) 50%, #000000 100%),
        linear-gradient(to right, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}

.picker-cursor {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid white;
    background-color: transparent;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    /* Center cursor on coordinates */
}

/* --- Appended new CP styling --- */
.control-panel-card {
    width: 100%;
    max-width: 42rem;
    /* max-w-2xl */
    margin: 0.5rem auto 1rem;
    background-color: var(--dark-card);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
}

@media (min-width: 640px) {
    .control-panel-card {
        padding: 1.5rem;
    }
}

.form-leave-btn {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 10;
}

.btn-leave {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    /* text-xs */
    color: #6b7280;
    /* text-gray-500 */
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-leave:hover {
    color: #ef4444;
    /* text-red-500 */
}

.cp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(10, 10, 15, 0.5);
    /* bg-dark-bg/50 */
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #374151;
    /* border-gray-700 */
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.cp-header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-right: 0.75rem;
}

.cp-header-title {
    font-size: 1.125rem;
    /* text-lg */
    font-weight: 700;
    margin: 0;
    padding-bottom: 0.25rem;
}

@media (min-width: 640px) {
    .cp-header-title {
        font-size: 1.25rem;
        /* text-xl */
    }
}

.cp-header-subtitle {
    font-size: 0.75rem;
    /* text-xs */
    color: #9ca3af;
    /* text-gray-400 */
    margin: 0;
}

.cp-header-timer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    padding-left: 0.75rem;
    border-left: 1px solid #4b5563;
    /* border-gray-600 */
}

.timer-label {
    font-size: 0.65rem;
    color: #6b7280;
    /* text-gray-500 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.timer-value {
    font-size: 1.125rem;
    /* text-lg */
    font-weight: 700;
    color: #06b6d4;
    /* text-cyan-500 approximating text-rgb-cyan if not defined */
    font-family: monospace;
}

@media (min-width: 640px) {
    .timer-value {
        font-size: 1.25rem;
        /* text-xl */
    }
}

.cp-label {
    display: block;
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 500;
    color: #d1d5db;
    /* text-gray-300 */
    margin-bottom: 0.25rem;
    /* mb-1 for apercu, mb-2 for others */
}

.preview-box {
    margin-bottom: 1rem;
    height: 70px;
    border-radius: 0.25rem;
    border: 1px solid #374151;
    /* border-gray-700 */
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.cp-controls-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.picker-hints {
    font-size: 0.75rem;
    /* text-xs */
    color: #6b7280;
    /* text-gray-500 */
    text-align: center;
}

.cp-select {
    width: 100%;
    background-color: var(--dark-accent);
    color: white;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #374151;
    outline: none;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.cp-select:focus {
    box-shadow: 0 0 0 2px var(--rgb-blue);
    border-color: transparent;
}

.transition-visibility {
    transition: opacity 0.3s;
}

/* Base slider styling for generic elements if not heavily customized via JS */
.slider-speed {
    width: 100%;
}

.btn-validate {
    width: 100%;
    background-color: var(--rgb-green);
    color: var(--dark-bg);
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-validate:hover {
    opacity: 0.9;
}