/* /frontend/assets/css/app.css */
body, html {
    height: 100%;
    margin: 0;
    overflow: hidden; /* Evita que la pantalla rebote */
}
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.material-symbols-outlined.fill {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================================
   PREMIUM CREAM LIGHT THEME OVERRIDES FOR MOB APP (PWA)
   ============================================================ */

/* Fondo general suave crema/arena que evoca la calidez del mate */
html:not(.dark) body {
    background-color: #faf7f2 !important;
    color: #334155 !important;
}

/* Cabecera adaptativa por temas con borde naranja */
header {
    background-color: #101922 !important;
    border-bottom: 2px solid #f48c25 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}
header h1, header p, header span, header a, header button, header .material-symbols-outlined {
    color: #ffffff !important;
}

/* Cabecera en Modo Claro - Fondo blanco y texto oscuro */
html:not(.dark) header {
    background-color: #ffffff !important;
    border-bottom: 2px solid #f48c25 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}
html:not(.dark) header h1,
html:not(.dark) header p,
html:not(.dark) header span,
html:not(.dark) header a,
html:not(.dark) header button,
html:not(.dark) header div,
html:not(.dark) header .material-symbols-outlined {
    color: #0f172a !important;
}

/* Navegación inferior (Bottom Nav) */
html:not(.dark) nav {
    background-color: #ffffff !important;
    border-top: 1px solid #e8dfd3 !important;
}
html:not(.dark) nav a:not(.text-primary) {
    color: #64748b !important;
}
html:not(.dark) nav a:not(.text-primary):hover {
    color: #f48c25 !important;
}

/* Tarjetas, modales, cajas y contenedores principales */
html:not(.dark) .bg-white:not(.b2b-premium-banner *),
html:not(.dark) [class*=" bg-white"]:not(.b2b-premium-banner *),
html:not(.dark) [class^="bg-white"]:not(.b2b-premium-banner *),
html:not(.dark) .modal-content,
html:not(.dark) #modal-crear-ronda > div,
html:not(.dark) #modal-proponer-punto > div,
html:not(.dark) #modal-ver-miembros > div,
html:not(.dark) #modal-invitar-a-grupo > div,
html:not(.dark) #modal-perfil-publico > div,
html:not(.dark) #modal-crear-grupo > div,
html:not(.dark) #modal-editar-grupo > div,
html:not(.dark) #modal-miembros > div,
html:not(.dark) #modal-legal > div,
html:not(.dark) #modal-recuperacion > div {
    background-color: #ffffff !important;
}

html:not(.dark) .bg-slate-50 {
    background-color: #fdfcfb !important; /* Crema premium extremadamente suave */
}

html:not(.dark) .bg-slate-100 {
    background-color: #f5eedc !important; /* Fondo crema intermedio para inputs y subpaneles */
}

/* Bordes en color mate/crema suave, más definidos para contraste */
html:not(.dark) .border-slate-200,
html:not(.dark) .border-slate-100,
html:not(.dark) .border-slate-300,
html:not(.dark) .border-b,
html:not(.dark) .border,
html:not(.dark) border {
    border-color: #dfd2be !important;
}

/* Sombra difusa naranja suave para tarjetas */
html:not(.dark) .shadow-sm,
html:not(.dark) .shadow-md,
html:not(.dark) .shadow-lg,
html:not(.dark) .shadow-xl,
html:not(.dark) .shadow {
    box-shadow: 0 4px 12px rgba(244, 140, 37, 0.06) !important;
}

/* Cajas específicas de Rondas Públicas y Privadas en el formulario */
html:not(.dark) #box-privada {
    background-color: #faf7f2 !important;
    border-color: #dfd2be !important;
}
html:not(.dark) #box-publica {
    background-color: #fffbeb !important;
    border-color: #f48c25 !important;
    color: #b45309 !important;
}
html:not(.dark) #box-publica label {
    color: #b45309 !important;
}

/* Inputs, Selectores y Textareas */
html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea {
    background-color: #ffffff !important;
    border: 1px solid #dfd2be !important;
    color: #0f172a !important;
    transition: all 0.3s ease !important;
}
html:not(.dark) input:focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
    border-color: #f48c25 !important;
    box-shadow: 0 0 0 3px rgba(244, 140, 37, 0.15) !important;
    outline: none !important;
}
html:not(.dark) input::placeholder, 
html:not(.dark) textarea::placeholder {
    color: #7d91aa !important;
}

/* Botones genéricos de slate a crema en modo claro */
html:not(.dark) #btn-abrir-proponer {
    background-color: #f5eedc !important;
    color: #334155 !important;
}
html:not(.dark) #btn-abrir-proponer:hover {
    background-color: #ebdcb9 !important;
}
html:not(.dark) #form-crear-ronda .bg-slate-100 {
    background-color: #faf7f2 !important;
}
html:not(.dark) #form-crear-ronda label div {
    color: #334155 !important;
}

/* Ajustes de colores de texto oscuros para legibilidad */
html:not(.dark) .text-slate-800,
html:not(.dark) .text-slate-900,
html:not(.dark) .text-slate-850 {
    color: #0f172a !important;
}
html:not(.dark) .text-slate-500,
html:not(.dark) .text-slate-600,
html:not(.dark) .text-slate-550 {
    color: #334155 !important;
}
html:not(.dark) .text-slate-400,
html:not(.dark) .text-gray-400 {
    color: #5c6e84 !important;
}
html:not(.dark) .text-slate-300,
html:not(.dark) .text-gray-300 {
    color: #7d91aa !important;
}


/* Specific page light style settings */
html:not(.dark) #chat-box {
    background-color: #faf7f2 !important;
}
html:not(.dark) emoji-picker {
    --background: #ffffff;
    --border-color: #e8dfd3;
    --input-background: #ffffff;
    --input-border-color: #e8dfd3;
    --outline-color: #f48c25;
}
html:not(.dark) .bg-slate-200 {
    background-color: #e8dfd3 !important;
}
html:not(.dark) button.bg-white {
    background-color: #ffffff !important;
    color: #f48c25 !important;
}
html:not(.dark) label[for="input-foto"] {
    background-color: #ffffff !important;
    border-color: #e8dfd3 !important;
}

/* ============================================================
   B2B COMMERCIAL PREMIUM BANNER STYLE RESET (WHITE OVERRIDES)
   ============================================================ */
.b2b-premium-banner,
.b2b-premium-banner * {
    color: #ffffff !important;
}
.b2b-premium-banner .material-symbols-outlined {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================
   PREMIUM DARK THEME OVERRIDES FOR MOB APP (PWA)
   ============================================================ */
html.dark body {
    background-color: #0b0f19 !important;
    color: #f8fafc !important;
}
html.dark header {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}
html.dark header h1 {
    color: #ffffff !important;
}
html.dark header button:hover {
    background-color: #1e293b !important;
}
html.dark nav {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}
html.dark nav a:not(.text-primary) {
    color: #94a3b8 !important;
}
html.dark nav a:not(.text-primary):hover {
    color: #f48c25 !important;
}
html.dark #modal-crear-ronda > div,
html.dark #modal-proponer-punto > div,
html.dark #modal-perfil-publico > div,
html.dark #modal-crear-grupo > div,
html.dark #modal-editar-grupo > div,
html.dark #modal-miembros > div,
html.dark #modal-ver-miembros > div,
html.dark #modal-invitar-a-grupo > div,
html.dark #modal-recuperacion > div,
html.dark #modal-legal > div {
    background-color: #0f172a !important;
    border: 1px solid #1e293b !important;
    color: #ffffff !important;
}

/* Ensure all modal inner containers are responsive and scrollable on small heights */
#modal-crear-ronda > div,
#modal-proponer-punto > div,
#modal-ver-miembros > div,
#modal-invitar-a-grupo > div,
#modal-perfil-publico > div,
#modal-crear-grupo > div,
#modal-editar-grupo > div,
#modal-miembros > div,
#modal-legal > div,
#modal-recuperacion > div,
#modal-paywall > div {
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    -ms-overflow-style: auto !important;
}

#modal-crear-ronda > div::-webkit-scrollbar,
#modal-proponer-punto > div::-webkit-scrollbar,
#modal-ver-miembros > div::-webkit-scrollbar,
#modal-invitar-a-grupo > div::-webkit-scrollbar,
#modal-perfil-publico > div::-webkit-scrollbar,
#modal-crear-grupo > div::-webkit-scrollbar,
#modal-editar-grupo > div::-webkit-scrollbar,
#modal-miembros > div::-webkit-scrollbar,
#modal-legal > div::-webkit-scrollbar,
#modal-recuperacion > div::-webkit-scrollbar,
#modal-paywall > div::-webkit-scrollbar {
    width: 6px !important;
    display: block !important;
}

#modal-crear-ronda > div::-webkit-scrollbar-track,
#modal-proponer-punto > div::-webkit-scrollbar-track,
#modal-ver-miembros > div::-webkit-scrollbar-track,
#modal-invitar-a-grupo > div::-webkit-scrollbar-track,
#modal-perfil-publico > div::-webkit-scrollbar-track,
#modal-crear-grupo > div::-webkit-scrollbar-track,
#modal-editar-grupo > div::-webkit-scrollbar-track,
#modal-miembros > div::-webkit-scrollbar-track,
#modal-legal > div::-webkit-scrollbar-track,
#modal-recuperacion > div::-webkit-scrollbar-track,
#modal-paywall > div::-webkit-scrollbar-track {
    background: transparent !important;
}

#modal-crear-ronda > div::-webkit-scrollbar-thumb,
#modal-proponer-punto > div::-webkit-scrollbar-thumb,
#modal-ver-miembros > div::-webkit-scrollbar-thumb,
#modal-invitar-a-grupo > div::-webkit-scrollbar-thumb,
#modal-perfil-publico > div::-webkit-scrollbar-thumb,
#modal-crear-grupo > div::-webkit-scrollbar-thumb,
#modal-editar-grupo > div::-webkit-scrollbar-thumb,
#modal-miembros > div::-webkit-scrollbar-thumb,
#modal-legal > div::-webkit-scrollbar-thumb,
#modal-recuperacion > div::-webkit-scrollbar-thumb,
#modal-paywall > div::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4) !important;
    border-radius: 9999px !important;
}

html.dark #modal-crear-ronda > div::-webkit-scrollbar-thumb,
html.dark #modal-proponer-punto > div::-webkit-scrollbar-thumb,
html.dark #modal-paywall > div::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.5) !important;
}

html.dark #modal-crear-ronda h3,
html.dark #modal-proponer-punto h3,
html.dark #modal-miembros h3,
html.dark #modal-ver-miembros h3,
html.dark #modal-recuperacion h3,
html.dark #modal-legal h3 {
    color: #ffffff !important;
    border-color: #1e293b !important;
    background-color: #0f172a !important;
}
html.dark #modal-miembros .bg-white,
html.dark #modal-ver-miembros .bg-white {
    background-color: #0f172a !important;
}
html.dark #modal-miembros .border-b,
html.dark #modal-ver-miembros .border-b {
    border-color: #1e293b !important;
}
html.dark input, 
html.dark select, 
html.dark textarea {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}
html.dark input::placeholder, 
html.dark textarea::placeholder {
    color: #64748b !important;
}
html.dark label {
    color: #cbd5e1 !important;
}
html.dark #box-privada {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
html.dark #box-publica {
    background-color: #0f1e36 !important;
    border-color: #1d4ed8 !important;
    color: #93c5fd !important;
}
html.dark #box-publica label {
    color: #93c5fd !important;
}
html.dark #btn-abrir-proponer {
    background-color: #334155 !important;
}
html.dark #btn-abrir-proponer:hover {
    background-color: #475569 !important;
}
html.dark #form-crear-ronda .bg-slate-100 {
    background-color: #1e293b !important;
}
html.dark #form-crear-ronda label div {
    color: #94a3b8 !important;
}
#form-crear-ronda label input:checked + div {
    background-color: #f48c25 !important;
    color: #ffffff !important;
}



html.dark #banner-modo-pueblo {
    background-color: rgba(120, 53, 4, 0.15) !important;
    border-color: rgba(217, 119, 6, 0.25) !important;
    color: #fbbf24 !important;
}

html.dark #box-publica {
    background-color: rgba(30, 41, 59, 0.4) !important;
    border-color: #334155 !important;
}
html.dark #box-publica label {
    color: #93c5fd !important;
}
html.dark #lugar-publico,
html.dark #grupo-ronda,
html.dark #tipo-bebida,
html.dark #cupo-ronda,
html.dark #desc-ronda {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}
html.dark #modal-proponer-punto label[class*="border-dashed"] {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}
html.dark #modal-proponer-punto label[class*="border-dashed"]:hover {
    background-color: #334155 !important;
}
html.dark #modal-proponer-punto label[class*="border-dashed"] p {
    color: #cbd5e1 !important;
}
html.dark #modal-proponer-punto label[class*="border-dashed"] p[id="foto-file-name"] {
    color: #94a3b8 !important;
}
#form-proponer-punto button[type="submit"] {
    background-color: #f48c25 !important;
    color: #ffffff !important;
}
#form-proponer-punto button[type="submit"]:hover {
    background-color: #e07b12 !important;
}
/* Card inner dark background (now #tarjeta-inner) */
html.dark #tarjeta-inner {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #f1f5f9 !important;
}

html.dark #btn-location {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #ffffff !important;
}
html.dark #btn-location:hover {
    background-color: #1e293b !important;
}
html.dark #panel-notificaciones {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #ffffff !important;
}
html.dark #panel-notificaciones h3 {
    color: #ffffff !important;
}
html.dark #panel-notificaciones .border-b {
    border-color: #1e293b !important;
}
html.dark #lista-notificaciones p {
    color: #cbd5e1 !important;
}
html.dark #lista-notificaciones > div {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
html.dark #lista-notificaciones > div.unread {
    background-color: #1e293b !important;
    border-left-color: #f48c25 !important;
}

/* Comunidad specific dark styles */
html.dark .bg-white {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    color: #f8fafc !important;
}
html.dark .text-slate-900 {
    color: #ffffff !important;
}
html.dark .text-slate-800 {
    color: #f1f5f9 !important;
}
html.dark .text-slate-700 {
    color: #e2e8f0 !important;
}
html.dark .text-slate-600 {
    color: #cbd5e1 !important;
}
html.dark .text-slate-500 {
    color: #94a3b8 !important;
}
html.dark .border-slate-200,
html.dark .border-slate-100 {
    border-color: #1e293b !important;
}
html.dark .bg-slate-50,
html.dark .bg-slate-100 {
    background-color: #1e293b !important;
}
html.dark .bg-slate-200 {
    background-color: #1e293b !important;
}
html.dark .bg-blue-50 {
    background-color: #0c1e35 !important;
    border-color: #1e3a8a !important;
    color: #93c5fd !important;
}
html.dark .text-blue-800 {
    color: #93c5fd !important;
}
html.dark #lista-charlas-privadas a {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
html.dark #lista-charlas-privadas a:hover {
    background-color: #334155 !important;
}
html.dark .bg-red-50 {
    background-color: #311515 !important;
    color: #fca5a5 !important;
    border-color: #7f1d1d !important;
}
html.dark .bg-red-100 {
    background-color: #4c1d1d !important;
    color: #fca5a5 !important;
    border-color: #7f1d1d !important;
}

/* Chat boxes specific dark styles */
html.dark #chat-box {
    background-color: #0b0f19 !important;
}
html.dark footer {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}
html.dark #btn-audio {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
}
html.dark #btn-audio:hover {
    background-color: #334155 !important;
}
html.dark emoji-picker {
    --background: #0f172a;
    --border-color: #1e293b;
    --input-background: #1e293b;
    --input-border-color: #334155;
    --outline-color: #f48c25;
}

/* Mis Rondas specific dark styles */
html.dark button:not(.text-primary) {
    color: #94a3b8 !important;
}
html.dark button.bg-white {
    background-color: #0f172a !important;
    color: #f48c25 !important;
}
html.dark #contenedor-creadas, html.dark #contenedor-pedidas {
    color: #cbd5e1 !important;
}

/* Perfil specific dark styles */
html.dark label[for="input-foto"] {
    background-color: #1e293b !important;
    border-color: #0f172a !important;
}
html.dark .bg-yellow-100 {
    background-color: #3e2e0e !important;
    color: #fef08a !important;
    border-color: #ca8a04 !important;
}
html.dark .bg-yellow-50 {
    background-color: #3e2e0e !important;
    color: #fef08a !important;
    border-color: #ca8a04 !important;
}
html.dark .bg-green-50 {
    background-color: #062f1d !important;
    color: #4ade80 !important;
    border-color: #166534 !important;
}
html.dark #kyc-blocker {
    background-color: rgba(15, 23, 42, 0.95) !important;
}

/* Login/Reset Page overrides */
.iti { width: 100%; display: block; }
.iti__flag-container { border-radius: 0.75rem 0 0 0.75rem; z-index: 10; }
#reg-telefono-visual { padding-left: 80px !important; }
html.dark .iti__country-list { background-color: #1e293b; color: #f8fafc; border-color: #334155; }
html.dark .iti__country { padding: 8px 10px; }
html.dark .iti__country:hover, html.dark .iti__country.iti__highlight { background-color: #334155; }
html.dark .prose {
    color: #e2e8f0 !important;
}
html.dark .prose h1, html.dark .prose h2, html.dark .prose h3 {
    color: #ffffff !important;
}

/* PWA Splash logo visual animations */
.glow-pulse {
    animation: pulseGlow 3s infinite ease-in-out;
}
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(244, 140, 37, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(244, 140, 37, 0.5);
    }
}
.steam {
    animation: steamUp 4s infinite linear;
    opacity: 0;
}
@keyframes steamUp {
    0% { transform: translateY(10px) scale(0.8); opacity: 0; }
    50% { opacity: 0.5; }
    100% { transform: translateY(-30px) scale(1.2); opacity: 0; }
}

/* ============================================================
   FLOATING AVAILABILITY PANEL (ESTOY DISPONIBLE) PREMIUM STYLES
   ============================================================ */
#panel-disponibilidad {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between !important;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 180px !important;
    height: 52px !important;
    box-sizing: border-box !important;
}

html:not(.dark) #panel-disponibilidad {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid #dfd2be !important;
    box-shadow: 0 4px 12px rgba(244, 140, 37, 0.06) !important;
}

html.dark #panel-disponibilidad {
    background-color: #1e293b !important;
    border: 1px solid #475569 !important;
    box-shadow: 0 0 15px rgba(244, 140, 37, 0.15) !important;
}

/* Text styles inside panel */
#panel-disponibilidad .text-title {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
html:not(.dark) #panel-disponibilidad .text-title {
    color: #0f172a !important;
}
html.dark #panel-disponibilidad .text-title {
    color: #ffffff !important;
}

#panel-disponibilidad .text-sub {
    font-size: 10px;
    font-weight: 500;
}
html:not(.dark) #panel-disponibilidad .text-sub {
    color: #475569 !important;
}
html.dark #panel-disponibilidad .text-sub {
    color: #cbd5e1 !important;
}

/* Divider inside panel */
#panel-disponibilidad .panel-divider {
    height: 24px;
    border-left: 1px solid;
}
html:not(.dark) #panel-disponibilidad .panel-divider {
    border-left-color: #dfd2be !important;
}
html.dark #panel-disponibilidad .panel-divider {
    border-left-color: #334155 !important;
}

/* Switch styling inside panel */
#panel-disponibilidad .toggle-bg {
    width: 40px;
    height: 22px;
    border-radius: 9999px;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}
html:not(.dark) #panel-disponibilidad .toggle-bg {
    background-color: #cbd5e1 !important;
    border: 1.5px solid #94a3b8 !important;
}
html.dark #panel-disponibilidad .toggle-bg {
    background-color: #1e293b !important;
    border: 1.5px solid #475569 !important;
}

/* Checked Switch background state */
#panel-disponibilidad input:checked + .toggle-bg {
    background-color: #10b981 !important;
    border-color: #059669 !important;
}
html.dark #panel-disponibilidad input:checked + .toggle-bg {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

/* Sliding Knob (Circle Dot) */
#panel-disponibilidad .toggle-bg::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    background-color: #ffffff !important;
    border-radius: 9999px !important;
    height: 14px !important;
    width: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

#panel-disponibilidad input:checked + .toggle-bg::after {
    transform: translateX(18px) !important;
}

/* ============================================================
   DETAILED POPUP CARD — STICKY FOOTER PATTERN
   ============================================================ */

/* Outer wrapper: positioning + shadow */
#tarjeta-detalle-ronda {
    z-index: 40 !important;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.20), 0 4px 12px -4px rgba(0, 0, 0, 0.12) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Inner card: flex-col, overflow hidden — NO scroll on the card itself */
#tarjeta-inner {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    /* Default max-height = viewport - header(60) - nav(65) - card_bottom(90) - gap(10) */
    max-height: calc(100dvh - 225px) !important;
}
#tarjeta-detalle-ronda.has-adsense #tarjeta-inner {
    /* + adsense bar (~52px) */
    max-height: calc(100dvh - 280px) !important;
}

/* Scrollable content area: GROWS to fill space, scrolls silently */
#tarjeta-detalle-ronda #detalle-desc-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
#tarjeta-detalle-ronda #detalle-desc-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

/* Sticky footer: NEVER shrinks — always visible */
#tarjeta-detalle-ronda #detalle-bottom-section {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
}

/* Header: never shrinks */
#tarjeta-detalle-ronda #detalle-header-section {
    flex-shrink: 0 !important;
}

/* ---- IMAGE: explicit 38px square (overrides missing Tailwind size-* utility) ---- */
#tarjeta-detalle-ronda #detalle-foto {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
}

/* ---- DESCRIPTION: max 2 lines clip ---- */
#tarjeta-detalle-ronda #detalle-info > div:first-child {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* ---- TEXTO CARD — CONTRASTE EXPLÍCITO CLARO/OSCURO ---- */
/* Título */
html:not(.dark) #tarjeta-detalle-ronda #detalle-nombre {
    color: #0f172a !important;
}
html.dark #tarjeta-detalle-ronda #detalle-nombre {
    color: #ffffff !important;
}
html.dark #tarjeta-detalle-ronda #detalle-nombre span,
html.dark #tarjeta-detalle-ronda #detalle-nombre div {
    color: #ffffff !important;
}
/* Descripción */
html:not(.dark) #tarjeta-detalle-ronda #detalle-info,
html:not(.dark) #tarjeta-detalle-ronda #detalle-info div {
    color: #1e293b !important;
}
html.dark #tarjeta-detalle-ronda #detalle-info,
html.dark #tarjeta-detalle-ronda #detalle-info div {
    color: #e2e8f0 !important;
}
/* Texto de Clima — siempre legible */
html:not(.dark) #tarjeta-detalle-ronda #detalle-clima-box {
    color: #1e293b !important;
}
html.dark #tarjeta-detalle-ronda #detalle-clima-box,
html.dark #tarjeta-detalle-ronda #detalle-clima-box * {
    color: #f1f5f9 !important;
}
/* Temperatura (mantiene color icono) */
html.dark #tarjeta-detalle-ronda #detalle-clima-box .text-amber-500 { color: #fbbf24 !important; }
html.dark #tarjeta-detalle-ronda #detalle-clima-box .text-blue-500,
html.dark #tarjeta-detalle-ronda #detalle-clima-box .text-blue-400  { color: #60a5fa !important; }
html.dark #tarjeta-detalle-ronda #detalle-clima-box .text-red-500   { color: #f87171 !important; }
html.dark #tarjeta-detalle-ronda #detalle-clima-box .text-orange-500 { color: #fb923c !important; }
html.dark #tarjeta-detalle-ronda #detalle-clima-box .text-emerald-500 { color: #34d399 !important; }

/* ---- ROUTE BADGES — EXPLICIT CONTRAST BOTH THEMES ---- */
#tarjeta-detalle-ronda .route-badge {
    background-color: #f1f5f9 !important;
    border: 1px solid #dfd2be !important;
    color: #1e293b !important;
    font-weight: 800 !important;
}
html.dark #tarjeta-detalle-ronda .route-badge {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
    font-weight: 800 !important;
}
#tarjeta-detalle-ronda .route-badge span.text-slate-400 { color: #64748b !important; }
html.dark #tarjeta-detalle-ronda .route-badge span.text-slate-400 { color: #94a3b8 !important; }

/* ---- AMENITY + YERBA BADGES ---- */
html:not(.dark) #tarjeta-detalle-ronda #detalle-amenities-box span {
    background-color: #f1f5f9 !important;
    border-color: #dfd2be !important;
    color: #1e293b !important;
}
html.dark #tarjeta-detalle-ronda #detalle-amenities-box span {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
html.dark #tarjeta-detalle-ronda #detalle-yerbas-box .bg-slate-50 {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}
html.dark #tarjeta-detalle-ronda #detalle-yerbas-box .text-slate-800 {
    color: #f1f5f9 !important;
}

/* ---- OPEN/CLOSE BADGES IN NAME ---- */
html.dark #tarjeta-detalle-ronda #detalle-nombre .bg-amber-100 {
    background-color: rgba(120, 53, 4, 0.4) !important;
    color: #fcd34d !important;
}
html.dark #tarjeta-detalle-ronda .text-yellow-500 { color: #fbbf24 !important; }
html.dark #tarjeta-detalle-ronda .text-slate-400  { color: #94a3b8 !important; }

/* ---- BG overrides inside card ---- */
html:not(.dark) #tarjeta-detalle-ronda .bg-slate-50 { background-color: #f8f5f0 !important; }
html.dark #tarjeta-detalle-ronda .bg-slate-50       { background-color: #0d1623 !important; }
html.dark #tarjeta-detalle-ronda .border-slate-100  { border-color: #1e293b !important; }
html.dark #tarjeta-inner { background-color: #0f172a !important; border-color: #1e293b !important; }


/* Estilos para el selector de marcador PWA SweetAlert2 */
.pin-selector-swal {
    width: 320px !important;
    max-width: 95% !important;
    padding: 16px !important;
    border-radius: 20px !important;
    font-family: inherit !important;
}
.pin-selector-swal .swal2-title {
    font-size: 16px !important;
    font-weight: 800 !important;
    padding: 0 !important;
    margin-bottom: 4px !important;
}
.pin-selector-swal .swal2-html-container {
    margin: 8px 0 0 0 !important;
    font-size: 12px !important;
}

/* ─── RESPONSIVE CARD POSITIONING ─────────────────────────────────────── */
/* Mobile: full-width centered above nav bar */
@media (max-width: 767px) {
    #tarjeta-detalle-ronda {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 16px) !important;
        max-width: 460px !important;
        right: auto !important;
        /* sits above nav (~65px): leave 80px from bottom of map container */
        bottom: 68px !important;
    }
    #tarjeta-inner {
        /* mobile: 100dvh - header(60) - nav(65) - bottom_offset(68) - gap(12) */
        max-height: calc(100dvh - 205px) !important;
    }
    #tarjeta-detalle-ronda.has-adsense {
        /* AdSense bar ~52px extra */
        bottom: 118px !important;
    }
    #tarjeta-detalle-ronda.has-adsense #tarjeta-inner {
        max-height: calc(100dvh - 256px) !important;
    }
}

/* Tablet (768–1023px): left-anchored card shifted next to panels */
@media (min-width: 768px) and (max-width: 1023px) {
    #tarjeta-detalle-ronda {
        left: 212px !important;
        right: auto !important;
        bottom: 70px !important;
        width: 355px !important;
        max-width: 355px !important;
        transform: none !important;
    }
    #tarjeta-inner {
        /* tablet: 100dvh - header(60) - nav(65) - bottom(70) - gap(12) */
        max-height: calc(100dvh - 207px) !important;
    }
    #tarjeta-detalle-ronda.has-adsense {
        bottom: 122px !important;
    }
    #tarjeta-detalle-ronda.has-adsense #tarjeta-inner {
        max-height: calc(100dvh - 315px) !important;
    }
}

/* Desktop (1024px+): left-anchored card shifted next to panels */
@media (min-width: 1024px) {
    #tarjeta-detalle-ronda {
        left: 220px !important;
        right: auto !important;
        bottom: 72px !important;
        width: 385px !important;
        max-width: 385px !important;
        transform: none !important;
    }
    #tarjeta-inner {
        /* desktop: 100dvh - header(60) - nav(65) - bottom(72) - gap(10) */
        max-height: calc(100dvh - 207px) !important;
    }
    #tarjeta-detalle-ronda.has-adsense {
        bottom: 124px !important;
    }
    #tarjeta-detalle-ronda.has-adsense #tarjeta-inner {
        max-height: calc(100dvh - 315px) !important;
    }
}


/* Ocultar barra de desplazamiento en contenedores con scroll horizontal */
.overflow-x-auto {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
}
.overflow-x-auto::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari/Webkit */
}

/* Botón Crear Ronda vibrante y nítido para Modo Claro */
html:not(.dark) #btn-crear-ronda {
    background-color: #ff6f00 !important; /* Un naranja más vibrante, cálido y fuerte */
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(255, 111, 0, 0.3) !important;
    border: none !important;
    opacity: 1 !important;
}
html:not(.dark) #btn-crear-ronda span {
    color: #ffffff !important;
}
html:not(.dark) #btn-crear-ronda:hover {
    background-color: #e65100 !important;
}

/* Botón Crear Ronda vibrante y nítido para Modo Oscuro */
html.dark #btn-crear-ronda {
    background-color: #f48c25 !important; /* Naranja corporativo vibrante */
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 16px rgba(244, 140, 37, 0.45) !important;
    border: none !important;
    opacity: 1 !important;
}
html.dark #btn-crear-ronda span {
    color: #ffffff !important;
}
html.dark #btn-crear-ronda:hover {
    background-color: #ff9d3b !important;
}

/* Filtro de alto contraste para el basemap oscuro cuando la web está en Tema Claro (crea un carbón cálido y suave con calles visibles) */
html:not(.dark) .leaflet-tile-container {
    filter: sepia(0.3) saturate(1.4) brightness(1.3) contrast(1.15) hue-rotate(340deg) !important;
}
/* Filtro de alto contraste para el basemap oscuro cuando la web está en Tema Oscuro (evita la pantalla negra y mantiene calles visibles) */
html.dark .leaflet-tile-container {
    filter: brightness(1.1) contrast(1.05) saturate(1.1) !important;
}



/* Ajustes de contraste para el switch en tema claro */
html:not(.dark) #panel-disponibilidad {
    background-color: rgba(253, 252, 251, 0.98) !important; /* Crema premium suave sólido */
    border: 1.5px solid #dfd2be !important;
}
html:not(.dark) #panel-disponibilidad .text-title {
    color: #0f172a !important;
}
html:not(.dark) #panel-disponibilidad .text-sub {
    color: #334155 !important;
}
html:not(.dark) #panel-disponibilidad .toggle-bg {
    background-color: #e2e8f0 !important;
    border: 1.5px solid #cbd5e1 !important;
}

/* ============================================================
   PORTAL DE COMERCIO (B2B) - CLARO CREMA & SLATE OSCURO
   ============================================================ */
.crema-card {
    background-color: #ffffff !important;
    border: 1px solid #dfd2be !important;
    box-shadow: 0 4px 15px rgba(244, 140, 37, 0.04) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.crema-card:hover {
    box-shadow: 0 6px 20px rgba(244, 140, 37, 0.08) !important;
    transform: translateY(-2px);
}
html.dark .crema-card {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}
html.dark .crema-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

/* Banner de Comercio Adherido B2B Premium */
.b2b-premium-banner {
    background: linear-gradient(135deg, #f48c25 0%, #d37315 100%) !important;
    color: #ffffff !important;
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgba(244, 140, 37, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
.b2b-premium-banner h3, 
.b2b-premium-banner p, 
.b2b-premium-banner span, 
.b2b-premium-banner strong, 
.b2b-premium-banner div {
    color: #ffffff !important;
}

/* Inputs de control del panel de comercio */
.dark input[type="time"],
.dark input[type="date"],
.dark input[type="text"] {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}
html:not(.dark) input[type="time"],
html:not(.dark) input[type="date"],
html:not(.dark) input[type="text"] {
    background-color: #ffffff !important;
    border-color: #dfd2be !important;
    color: #0f172a !important;
}

/* ============================================================
   TRANSIT AND ANIMATED ROUTE STYLES (FASE 5)
   ============================================================ */

/* 3-Column horizontal transit times grid */
.b2b-transit-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    text-align: center !important;
    margin-top: 8px !important;
}

/* Individual transit box */
.b2b-transit-box {
    background-color: #ffffff !important;
    border: 1px solid #dfd2be !important;
    padding: 8px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

html.dark .b2b-transit-box {
    background-color: #0f172a !important;
    border-color: #1e293b !important;
}

/* Animated route line flowing animation */
@keyframes flow-route {
    to {
        stroke-dashoffset: -20;
    }
}
.animated-route-flow {
    stroke-dasharray: 6, 10 !important;
    animation: flow-route 1s linear infinite !important;
}

/* ============================================================
   MAPA ESTILO NAVIGATION & CUSTOM PULSE LOCATION MARKERS
   ============================================================ */

#map-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
}

/* Custom div icon resets to prevent Leaflet defaults from showing white box borders */
.custom-div-icon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ============================================================
   FLOATING HEATMAP PANEL (MAPA DE CALOR) PREMIUM STYLES
   ============================================================ */
#panel-heatmap {
    position: absolute;
    top: 84px; /* Stacks nicely below availability panel */
    left: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between !important;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 180px !important;
    height: 52px !important;
    box-sizing: border-box !important;
}

html:not(.dark) #panel-heatmap {
    background-color: rgba(253, 252, 251, 0.98) !important;
    border: 1px solid #dfd2be !important;
    box-shadow: 0 4px 12px rgba(244, 140, 37, 0.06) !important;
}

html.dark #panel-heatmap {
    background-color: #1e293b !important;
    border: 1px solid #475569 !important;
    box-shadow: 0 0 15px rgba(244, 140, 37, 0.15) !important;
}

#panel-heatmap .text-title {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
html:not(.dark) #panel-heatmap .text-title {
    color: #0f172a !important;
}
html.dark #panel-heatmap .text-title {
    color: #ffffff !important;
}

#panel-heatmap .text-sub {
    font-size: 10px;
    font-weight: 500;
}
html:not(.dark) #panel-heatmap .text-sub {
    color: #334155 !important;
}
html.dark #panel-heatmap .text-sub {
    color: #cbd5e1 !important;
}

#panel-heatmap .panel-divider {
    height: 24px;
    border-left: 1px solid;
}
html:not(.dark) #panel-heatmap .panel-divider {
    border-left-color: #dfd2be !important;
}
html.dark #panel-heatmap .panel-divider {
    border-left-color: #334155 !important;
}

#panel-heatmap .toggle-bg {
    width: 40px;
    height: 22px;
    border-radius: 9999px;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}
html:not(.dark) #panel-heatmap .toggle-bg {
    background-color: #e2e8f0 !important;
    border: 1.5px solid #cbd5e1 !important;
}
html.dark #panel-heatmap .toggle-bg {
    background-color: #1e293b !important;
    border: 1.5px solid #475569 !important;
}

#panel-heatmap input:checked + .toggle-bg {
    background-color: #10b981 !important;
    border-color: #059669 !important;
}
html.dark #panel-heatmap input:checked + .toggle-bg {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

#panel-heatmap .toggle-bg::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    background-color: #ffffff !important;
    border-radius: 9999px !important;
    height: 14px !important;
    width: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

#panel-heatmap input:checked + .toggle-bg::after {
    transform: translateX(18px) !important;
}

/* User marker custom frames */
.user-pulse-avatar-frame {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid var(--pulse-color);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    overflow: hidden;
    animation: pulse-dot 2s infinite;
}

.user-pulse-emoji-frame {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    animation: pulse-dot 2s infinite;
}

/* Estilos del radar de ubicación premium de usuario */
@keyframes radar-pulse {
  0% { transform: scale(0.25); opacity: 1; }
  85% { opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 var(--pulse-shadow); }
  75% { transform: scale(1.05); box-shadow: 0 0 0 12px transparent; }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 transparent; }
}

.user-pulse-container {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.user-pulse-ring {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--pulse-color-rgba);
  animation: radar-pulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  pointer-events: none;
}

.user-pulse-ring-2 {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--pulse-color-rgba);
  animation: radar-pulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  animation-delay: 0.7s;
  pointer-events: none;
}

.user-pulse-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pulse-color);
  border: 3px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  position: relative;
  z-index: 10;
  animation: pulse-dot 2s infinite;
  pointer-events: none;
}

/* Map Background and Tile container override to prevent white flash (global para ambos temas ya que el mapa siempre es oscuro) */
#map,
.leaflet-container,
.leaflet-tile,
.leaflet-layer,
.leaflet-pane {
    background-color: #11151c !important;
    background: #11151c !important;
}

/* Floating Status Tooltip/Bubble above user pin */
.pin-status-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 100;
    animation: bounceBubble 2s infinite ease-in-out;
}

/* Light Mode Bubble Style */
html:not(.dark) .pin-status-bubble {
    background-color: #ffffff;
    border: 1.5px solid #dfd2be;
    color: #0f172a;
}
html:not(.dark) .pin-status-bubble::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: #dfd2be transparent transparent;
}
html:not(.dark) .pin-status-bubble::before {
    content: '';
    position: absolute;
    bottom: -3.5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: #ffffff transparent transparent;
    z-index: 1;
}

/* Dark Mode Bubble Style */
html.dark .pin-status-bubble {
    background-color: #161c24;
    border: 1.5px solid #374151;
    color: #ffffff;
}
html.dark .pin-status-bubble::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: #374151 transparent transparent;
}
html.dark .pin-status-bubble::before {
    content: '';
    position: absolute;
    bottom: -3.5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px 4px 0;
    border-style: solid;
    border-color: #161c24 transparent transparent;
    z-index: 1;
}

@keyframes bounceBubble {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, -3px); }
}

/* Defensive Layout boundaries */
#map-container {
    overflow: hidden !important;
}

/* Prevent title and badges from colliding with Close (X) button */
#tarjeta-detalle-ronda #detalle-header-section > div:nth-child(2) {
    padding-right: 44px !important;
}

/* High-contrast and safe badges inside card header */
.badge-punto-seguro, .badge-premium {
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    margin-left: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
    user-select: none !important;
}
.badge-punto-seguro {
    background-color: #64748b !important; /* slate-500 */
    color: #ffffff !important;
}
.badge-premium {
    background-color: #fb923c !important; /* orange-400 */
    color: #ffffff !important;
}