/* Selector de canal (WhatsApp / SMS) en filas compactas tipo radio. Estilos propios (ui-*) porque
   el estado seleccionado cruza el radio nativo con la fila (`:checked + .card`) y eso Tailwind no
   lo cubre limpio. Modo claro y oscuro. */

.ui-channel-opt {
    display: block;
    cursor: pointer;
}

/* Radio nativo oculto pero enfocable: la selección se pinta sobre la fila hermana. */
.ui-channel-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ui-channel-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.875rem;
    background-color: #ffffff;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ui-channel-card:hover {
    border-color: #d1d5db;
}

.ui-channel-ic {
    width: 2rem;
    height: 2rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    background-color: #f3f4f6;
    color: #6b7280;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.ui-channel-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #111827;
}

/* El punto se empuja al borde derecho: entre el nombre y él no hay nada fijo. */
.ui-channel-dot {
    margin-left: auto;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.ui-channel-dot i {
    font-size: 0.625rem;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Estado seleccionado: sin borde de acento, la señal es el check verde y el ícono a color. */
.ui-channel-radio:checked + .ui-channel-card {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

.ui-channel-radio:checked + .ui-channel-card .ui-channel-dot {
    border-color: #059669;
    background-color: #059669;
}

.ui-channel-radio:checked + .ui-channel-card .ui-channel-dot i {
    opacity: 1;
    transform: scale(1);
}

.ui-channel-radio:checked + .ui-channel-card .ui-channel-ic-wa {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.ui-channel-radio:checked + .ui-channel-card .ui-channel-ic-sms {
    background-color: rgba(255, 69, 0, 0.12);
    color: #ff4500;
}

/* Foco por teclado: anillo sobre la fila, del mismo verde del check. */
.ui-channel-radio:focus-visible + .ui-channel-card {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}

/* Dark mode */
:root.dark .ui-channel-card {
    background-color: #242428;
    border-color: #374151;
}

:root.dark .ui-channel-card:hover {
    border-color: #4b5563;
}

:root.dark .ui-channel-ic {
    background-color: #1a1a1e;
    color: #9ca3af;
}

:root.dark .ui-channel-title {
    color: #ffffff;
}

:root.dark .ui-channel-dot {
    border-color: #4b5563;
}

:root.dark .ui-channel-radio:checked + .ui-channel-card {
    border-color: #4b5563;
    background-color: #2b2b31;
}

:root.dark .ui-channel-radio:checked + .ui-channel-card .ui-channel-dot {
    border-color: #10b981;
    background-color: #10b981;
}

:root.dark .ui-channel-radio:checked + .ui-channel-card .ui-channel-ic-wa {
    background-color: rgba(16, 185, 129, 0.18);
    color: #34d399;
}
