/* Comportamiento del vivo, bloque B: clases, crear clase, bicicletas, check-in, multas.
   Solo lo escribe el agente de este bloque (TAREA-1-interaccion-b.md). */

/* ==========================================================================
   ANIMACIONES BASE COMPARTIDAS (Framer Motion -> CSS keyframes)
   ========================================================================== */
@keyframes rrFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rrSlideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rrSlideUpFadeSmall {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rrSlideDownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rrSlideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes rrModalZoom {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes rrBirthdayPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes rrSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   PANTALLA: /check-in (/reservas/scanner/)
   Valores exactos del vivo: app/[locale]/(admin)/check-in/page.tsx
   ========================================================================== */

/* Entrada general de la pantalla: initial={{ opacity: 0 }} animate={{ opacity: 1 }} */
.scanner-page {
    animation: rrFadeIn 0.3s ease-out;
}

/* Tarjeta de resultado: initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} */
.scanner-result:not(.scanner-result--hidden) {
    animation: rrSlideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Feed de check-ins con scrollbar-hide */
.scanner-log__list {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.scanner-log__list::-webkit-scrollbar {
    display: none;
}

/* Entrada lateral de items en el log: initial={{ opacity: 0, x: -20 }} animate={{ opacity: 1, x: 0 }} */
.scanner-log__item {
    animation: rrSlideInLeft 0.25s ease-out !important;
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}

.scanner-log__item:hover {
    background: rgba(12, 12, 12, 0.6);
    border-color: rgba(255, 107, 0, 0.3);
}

/* Botón deshacer en tarjeta de resultado con escala al presionar */
.scanner-result__undo-btn {
    transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}
.scanner-result__undo-btn:active:not(:disabled) {
    transform: scale(0.97);
}

/* ==========================================================================
   PANTALLA: /penalties (/admin-dashboard/multas/)
   Valores exactos del vivo: app/[locale]/(admin)/penalties/page.tsx
   ========================================================================== */

/* Entrada suave del encabezado y título: initial={{ opacity: 0 }} animate={{ opacity: 1 }} */
.pn-titlebox {
    animation: rrFadeIn 0.3s ease-out;
}

/* Botones de período (.pn-pbtn): hover:bg-gray-100 dark:hover:bg-dark-surface/50 transition-all */
.pn-pbtn {
    transition: all 0.2s ease !important;
}
.pn-pbtn:hover:not(.active) {
    background: rgba(12, 12, 12, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e8e8e8 !important;
}
.pn-pbtn:active {
    transform: scale(0.97);
}

/* Selector de rango de fecha expandible con transición suave */
.pn-range {
    transition: opacity 0.25s ease-out;
}
.pn-range.open {
    animation: rrSlideDownFade 0.25s ease-out;
}
.pn-range input:focus,
.pn-notes:focus {
    outline: none !important;
    border-color: rgba(255, 107, 0, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.3) !important;
}

/* Tarjetas KPI con entrada escalonada (delay 0.05s, 0.1s, 0.15s) */
.pn-kpis {
    gap: 0.9rem;
}
.pn-kpi {
    animation: rrSlideUpFade 0.3s ease-out backwards;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.pn-kpi:nth-child(1) { animation-delay: 0.05s; }
.pn-kpi:nth-child(2) { animation-delay: 0.10s; }
.pn-kpi:nth-child(3) { animation-delay: 0.15s; }
.pn-kpi.hot {
    box-shadow: 0 0 14px rgba(255, 107, 0, 0.15);
}

/* Pestañas (.pn-tabs / .pn-tab) con scrollbar oculto y hover suave */
.pn-tabs {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pn-tabs::-webkit-scrollbar {
    display: none;
}
.pn-tab {
    transition: all 0.2s ease !important;
}
.pn-tab:hover:not(.active) {
    background: rgba(12, 12, 12, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e8e8e8 !important;
}
.pn-tab:active {
    transform: scale(0.97);
}

/* Tarjetas de multa (.pn-card) con entrada escalonada y enlace de socio */
.pn-card {
    animation: rrSlideUpFadeSmall 0.25s ease-out backwards;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.pn-name a {
    cursor: pointer;
    transition: color 0.2s ease !important;
}
.pn-name a:hover {
    text-decoration: underline !important;
    color: #ff9933 !important;
}

/* Botones de acción "Cobrar" y "Cancelar multa" */
.pn-btn {
    transition: all 0.2s ease !important;
}
.pn-btn.pn-cobrar:hover:not(:disabled) {
    background: rgba(255, 107, 0, 0.2) !important;
    border-color: rgba(255, 107, 0, 0.6) !important;
}
.pn-btn.pn-cancelar:hover:not(:disabled) {
    background: rgba(12, 12, 12, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #e8e8e8 !important;
}
.pn-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* Paneles de cobro y cancelación (.pn-panel) */
.pn-panel {
    animation: rrSlideDownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.pn-cerrar {
    transition: color 0.2s ease, background-color 0.2s ease !important;
}
.pn-cerrar:hover {
    color: #e8e8e8 !important;
    background: rgba(255, 255, 255, 0.1) !important;
}
.pn-met {
    transition: all 0.2s ease !important;
}
.pn-met:hover:not(.on) {
    background: rgba(12, 12, 12, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.pn-met:active {
    transform: scale(0.97);
}
.pn-ok {
    transition: all 0.2s ease !important;
}
.pn-ok:hover:not(:disabled) {
    filter: brightness(1.1) !important;
}
.pn-ok:active:not(:disabled) {
    transform: scale(0.98);
}
.pn-motivo {
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.pn-motivo:focus {
    outline: none !important;
    border-color: #fdba74 !important;
    box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.3) !important;
}

/* Botón "Ver más" (.pn-vermas a) */
.pn-vermas a {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}
.pn-vermas a:hover {
    background: rgba(12, 12, 12, 0.5) !important;
    color: #e8e8e8 !important;
}
.pn-vermas a:active {
    transform: scale(0.98);
}

/* ==========================================================================
   PANTALLA: /bike-layout (/admin-dashboard/bicicletas/)
   Valores exactos del vivo: app/[locale]/(admin)/bike-layout/page.tsx
   ========================================================================== */

/* Celdas de bicicleta en el salón (.bk-bike):
   whileHover={ scale: 1.1 }, whileTap={ scale: 0.92 }, duration-200 transition-all */
.bk-bike {
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.bk-bike:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.4) !important;
    border-color: rgba(255, 140, 80, 0.6) !important;
    background: rgba(255, 107, 0, 0.15) !important;
    z-index: 10;
}
.bk-bike:active {
    transform: scale(0.92) !important;
}
.bk-bike--off:hover {
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.4) !important;
    border-color: rgba(248, 113, 113, 0.6) !important;
    background: rgba(248, 113, 113, 0.2) !important;
}
.bk-bike--swap:hover {
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5) !important;
    border-color: rgba(168, 85, 247, 0.8) !important;
}

/* Botones de herramientas (.bk-tool) */
.bk-tool {
    transition: all 0.2s ease !important;
}
.bk-tool:hover {
    background: rgba(12, 12, 12, 0.5) !important;
    border-color: rgba(255, 107, 0, 0.3) !important;
    color: #e8e8e8 !important;
}
.bk-tool:active {
    transform: scale(0.96) !important;
}

/* Botón Guardar plano (.bk-guardar) */
.bk-guardar {
    transition: all 0.2s ease, filter 0.2s ease !important;
}
.bk-guardar:hover:not([disabled]) {
    filter: brightness(1.08) !important;
}
.bk-guardar:active:not([disabled]) {
    transform: scale(0.98) !important;
}

/* Barra inferior de bicicleta seleccionada (.bk-sel) */
.bk-sel.show {
    animation: rrSlideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.bk-btn {
    transition: all 0.2s ease !important;
}
.bk-btn:hover {
    background: rgba(12, 12, 12, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #e8e8e8 !important;
}
.bk-btn:active {
    transform: scale(0.96) !important;
}

/* Modales de bicicletas (.bk-modal-bg, .bk-modal) */
.bk-modal-bg {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    transition: opacity 0.2s ease !important;
}
.bk-modal {
    animation: rrModalZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.bk-modal__acts button {
    transition: all 0.2s ease !important;
}
.bk-modal__acts button:hover {
    filter: brightness(1.1) !important;
}
.bk-modal__acts button:active {
    transform: scale(0.97) !important;
}

/* ==========================================================================
   PANTALLA: /classes/new (Crear clase / modales de formulario)
   Valores exactos del vivo: app/[locale]/(admin)/classes/new/page.tsx
   ========================================================================== */

/* Enlace volver a clases: hover:bg-dark-surface/50 hover:text-dark-text transition-colors */
.btn-back-classes,
a[href*="admin-classes"]:hover,
.admin-classes-back:hover {
    background: rgba(12, 12, 12, 0.5) !important;
    color: #e8e8e8 !important;
    transition: background-color 0.2s ease, color 0.2s ease !important;
}

/* Campos de formulario: focus:border-rush-500/50 focus:ring-2 focus:ring-rush-500/20 */
/* Acotado a crear clase (10/10, auditoría): «.modal …:focus» y «.form-input:focus»
   pisaban con !important el foco de los modales de los otros bloques. */
.form-create-class input:focus,
.form-create-class textarea:focus,
.form-create-class select:focus {
    outline: none !important;
    border-color: rgba(255, 107, 0, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 0, 0.2) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* Toggle de tipo de clase (cycling / functional) */
.class-type-toggle,
.class-type-btn {
    transition: all 0.2s ease !important;
}
.class-type-toggle:hover,
.class-type-btn:hover {
    border-color: rgba(255, 107, 0, 0.4) !important;
}

/* Switch / Checkbox de repetición semanal con resplandor naranja */
.checkbox-label {
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}
.checkbox-label input[type="checkbox"]:checked {
    accent-color: #ff6b00 !important;
    box-shadow: 0 0 8px rgba(255, 107, 0, 0.4) !important;
    transition: box-shadow 0.2s ease !important;
}

/* Botones de semanas de repetición */
.repeat-week-btn {
    transition: all 0.2s ease !important;
}
.repeat-week-btn:hover {
    background: rgba(12, 12, 12, 0.5) !important;
    color: #e8e8e8 !important;
}

/* Párrafo de error con animación de entrada */
.form-error-msg,
.conc-error {
    animation: rrSlideDownFade 0.2s ease-out;
}

/* ==========================================================================
   PANTALLA: /classes (Tarjetas de clase, roster, celdas de spot y modales)
   Valores exactos del vivo: app/[locale]/(admin)/classes/page.tsx,
   components/admin/admin-class-card.tsx, components/admin/admin-spot-grid.tsx
   ========================================================================== */

/* Tarjetas de clase (.admin-class-card / .cls-card) */
.admin-class-card,
.cls-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}
.admin-class-card:hover,
.cls-card:hover {
    border-color: rgba(255, 107, 0, 0.3) !important;
    box-shadow: 0 0 16px rgba(255, 107, 0, 0.08) !important;
}
.cls-card__head {
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}
.cls-card__head:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Acciones en el roster (.ract) */
.ract {
    transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease !important;
}
.ract:hover:not([disabled]) {
    transform: scale(1.08) !important;
    filter: brightness(1.1);
}
.ract:active:not([disabled]) {
    transform: scale(0.95) !important;
}
.ract--ok:hover:not([disabled]) {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    color: #4ade80 !important;
}
.ract--del:hover:not([disabled]) {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #f87171 !important;
}

/* Fila de asistente (.roster-row / .roster-item) */
.roster-row,
.roster-item {
    transition: background-color 0.2s ease, border-color 0.2s ease !important;
}
.roster-row:hover,
.roster-item:hover {
    background: rgba(12, 12, 12, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}
.roster-name,
.roster-name a {
    cursor: pointer !important;
    transition: color 0.2s ease !important;
}
.roster-name:hover,
.roster-name a:hover {
    color: #ff9933 !important;
    text-decoration: underline !important;
}

/* Celdas de spot (.spot-cell, .bike-cell, .admin-spot-grid button)
   whileHover={ scale: 1.06, y: -1 }, whileTap={ scale: 0.95 } */
.spot-cell,
.bike-cell,
.admin-spot-grid button {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important;
}
.spot-cell:not([disabled]):hover,
.bike-cell:not([disabled]):hover,
.admin-spot-grid button:not([disabled]):hover {
    transform: scale(1.06) translateY(-1px) !important;
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.4) !important;
    border-color: rgba(255, 140, 80, 0.6) !important;
    z-index: 5;
}
.spot-cell:not([disabled]):active,
.bike-cell:not([disabled]):active,
.admin-spot-grid button:not([disabled]):active {
    transform: scale(0.95) !important;
}

/* Indicador de cumpleaños: scale: [1, 1.1, 1] en 1.6s infinito */
.bike-cell--birthday,
.mini-cell--birthday,
.badge-birthday {
    animation: rrBirthdayPulse 1.6s ease-in-out infinite !important;
}

/* Modal de perfil rápido y modales de clase */
/* «.modal-overlay .modal» salió: es de todos los modales; los compartidos los anima el bloque D. */
.member-quickview-modal,
.modal-quickview {
    animation: rrModalZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Enlaces de contacto (WhatsApp / Teléfono) en perfil rápido */
.quickview-wa:hover,
a[href^="https://wa.me"]:hover {
    color: #34d399 !important;
    transition: color 0.2s ease !important;
}

/* ==========================================================================
   TEMA CLARO
   ========================================================================== */
html[data-tema="claro"] .scanner-log__item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(194, 65, 12, 0.3);
}

html[data-tema="claro"] .pn-pbtn:hover:not(.active),
html[data-tema="claro"] .pn-tab:hover:not(.active),
html[data-tema="claro"] .pn-btn.pn-cancelar:hover:not(:disabled),
html[data-tema="claro"] .pn-met:hover:not(.on),
html[data-tema="claro"] .pn-vermas a:hover,
html[data-tema="claro"] .bk-tool:hover,
html[data-tema="claro"] .bk-btn:hover,
html[data-tema="claro"] .repeat-week-btn:hover,
html[data-tema="claro"] .roster-row:hover,
html[data-tema="claro"] .roster-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}

html[data-tema="claro"] .pn-btn.pn-cobrar:hover:not(:disabled) {
    background: #ffedd5 !important;
}

html[data-tema="claro"] .pn-name a:hover,
html[data-tema="claro"] .roster-name:hover,
html[data-tema="claro"] .roster-name a:hover {
    color: #c2410c !important;
}

html[data-tema="claro"] .bk-bike:hover,
html[data-tema="claro"] .spot-cell:not([disabled]):hover,
html[data-tema="claro"] .bike-cell:not([disabled]):hover {
    background: #ffedd5 !important;
    border-color: #f97316 !important;
}

/* ==========================================================================
   MOVIMIENTO REDUCIDO
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .scanner-page,
    .scanner-result,
    .scanner-log__item,
    .pn-titlebox,
    .pn-kpi,
    .pn-card,
    .pn-panel,
    .pn-range.open,
    .bk-bike,
    .bk-sel.show,
    .bk-modal,
    .form-error-msg,
    .conc-error,
    .admin-class-card,
    .cls-card,
    .spot-cell,
    .bike-cell,
    .bike-cell--birthday,
    .mini-cell--birthday,
    .badge-birthday {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
