/* ==========================================================================
   PAREJAS SWINGER MÉXICO - HOJA DE ESTILOS MAESTRA (RE-ORGANIZADA)
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES & CONFIGURACIÓN (:root)
   ========================================================================== */
:root {
    /* --- PALETA PASTEL VIBRANTE --- */
    --primary-color: #82b1ff;       /* Azul Principal */
    --primary-dark: #448aff;        /* Azul Interacción */
    --secondary-color: #ff80ab;     /* Rosa Acento */
    --success-color: #b9f6ca;       /* Verde Fondo */
    --success-dark: #00c853;        /* Verde Texto/Iconos */
    --warning-color: #ffe57f;       /* Amarillo Fondo */
    --warning-dark: #ffa000;        /* Amarillo Texto/Iconos */
    --danger-color: #ff8a80;        /* Rojo Fondo */
    --danger-dark: #d32f2f;         /* Rojo Texto/Iconos */

    /* --- BRANDING PATRIO (LOGOTIPO) --- */
    --brand-p: #FBC02D;  
    --brand-sw: #D32F2F; 
    --brand-me: #388E3C; 
    --brand-xi: #9E9E9E; 
    --brand-co: #C62828; 

    /* --- NEUTROS & FONDOS --- */
    --bg-body: #f4f7f6;     
    --bg-card: #ffffff;     
    --bg-input: #ffffff;
    --text-main: #2c3e50;   
    --text-muted: #7f8c8d;  
    --border-color: #e0e0e0;

    /* --- DIMENSIONES & UI --- */
    --header-height: 70px;
    --sticky-bar-height: 40px;
    --radius: 12px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);

    /* --- GRADIENTES --- */
    --gradient-primary: linear-gradient(135deg, #82b1ff 0%, #b388ff 100%);
    --gradient-gold: linear-gradient(135deg, #ffe082 0%, #ffd54f 100%);
    
    /* --- CONFIANZA --- */
    --rating-gold: #FFD700;
    --trust-high: #4caf50;
    --trust-med: #ff9800;
    --trust-low: #f44336;
}

/* ==========================================================================
   2. RESET, BASE & ANIMACIONES
   ========================================================================== */

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
    padding-top: var(--header-height);
    -webkit-font-smoothing: antialiased;
    /* FONDO ANIMADO (GIF) - Integrado de v12 */
    background: url('../assets/images/background.gif') repeat fixed center center !important;
    background-color: var(--bg-body); /* Fallback */
    background-size: cover !important;
}

/* Contenedor principal para legibilidad sobre el GIF */
#content-view {
    background-color: rgba(244, 247, 246, 0.92) !important;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Ajuste dinámico si la barra sticky está visible */
body:has(#global-sticky-ads:not(.hide)) main {
    padding-top: var(--sticky-bar-height) !important;
}

/* Bloquear scroll cuando hay modales abiertos */
body.modal-open {
    overflow: hidden !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--text-main);
}

a { text-decoration: none; transition: all 0.2s ease; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd8dc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b0bec5; }

/* Utilidades */
.hide { display: none !important; }
.show { display: block !important; }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.scroll-y { overflow-y: auto; }
.text-xs { font-size: 0.75rem; }
.text-small { font-size: 0.85rem; }
.fw-bold { font-weight: 700 !important; }

/* --- Animaciones --- */
.animate-fade-in { animation: fadeIn 0.4s ease-in-out; }
.animate-slide-up { animation: slideUp 0.4s ease-out; }
.pulse-animation { animation: pulse 1.5s infinite; }
.pulsate { animation: pulse 2s infinite; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(130, 177, 255, 0.7); }
    70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(130, 177, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(130, 177, 255, 0); }
}

/* ==========================================================================
   3. COMPONENTES UI (Botones, Avatares, Badges)
   ========================================================================== */

.btn { border-radius: 8px; font-weight: 600; padding: 8px 16px; transition: all 0.2s; }
.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.btn-outline-primary { color: var(--primary-dark); border-color: var(--primary-color); }
.btn-outline-primary:hover { background-color: var(--primary-color); color: white; }

.bg-gradient-primary { background: var(--gradient-primary) !important; }

/* Avatares */
.avatar-xs { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-small { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.profile-avatar-large {
    width: 120px; height: 140px; border-radius: 50%; object-fit: cover;
    border: 4px solid white; box-shadow: var(--shadow-md); background-color: #eee;
}

/* Status Dots */
.status-dot, .status-dot-small { display: inline-block; border-radius: 50%; border: 2px solid white; }
.status-dot-small { width: 10px; height: 10px; }
.status-online, .bg-success { background-color: var(--trust-high) !important; }
.status-offline, .bg-secondary { background-color: #9e9e9e !important; }

/* Loader Overlay */
.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-card); z-index: 20000;
    display: flex; justify-content: center; align-items: center;
}
.loader-content { text-align: center; }
.loader-logo { width: 80px; margin-top: 20px; border-radius: 50%; }

/* ==========================================================================
   4. HEADER, NAVBAR & BARRA STICKY
   ========================================================================== */

.navbar { height: var(--header-height); border-bottom: 1px solid var(--border-color); transition: background-color 0.3s; }
.navbar-brand { font-size: 1.4rem; letter-spacing: -0.5px; }

/* --- A. Header Público (Landing) --- */
#public-header { background-color: var(--bg-card) !important; }
#public-header .navbar-brand { color: var(--primary-dark) !important; }
#public-header .nav-link { 
    color: var(--text-main) !important;
    font-weight: 500; 
}
#public-header .nav-link:hover { color: var(--primary-color) !important; }

/* --- B. Header App (Privado) --- */
#app-header { background: var(--gradient-primary) !important; border-bottom: none; }
#app-header .navbar-brand { color: white !important; }
#app-header .nav-link { 
    color: rgba(255,255,255,0.9) !important; 
    font-weight: 500;
}
#app-header .nav-link:hover, #app-header .nav-link.active { 
    color: #ffffff !important; 
    opacity: 1; 
}
#app-header .nav-link.active { 
    font-weight: 700; 
    border-bottom: 2px solid rgba(255,255,255,0.8); 
}

/* Colores Logotipo Patrio */
.color-p { color: var(--brand-p) !important; text-shadow: 1px 1px 1px rgba(0,0,0,0.05); }
.color-sw { color: var(--brand-sw) !important; font-weight: 800; }
.color-me { color: var(--brand-me) !important; }
.color-xi { color: var(--brand-xi) !important; }
.color-co { color: var(--brand-co) !important; }

/* Botones Iconos Header */
.nav-btn-icon { color: white; cursor: pointer; transition: transform 0.2s; position: relative; }
.nav-btn-icon:hover { transform: scale(1.1); color: #f0f0f0; }

/* Dropdown Notificaciones (CORREGIDO V2 - FUERZA BRUTA) */
#notifDropdown .badge { font-size: 0.6rem; transform: translate(-50%, -50%); }

#notifications-widget-content { max-height: 350px; overflow-y: auto; }

/* 1. REGLA GENERAL: Resetear la posición automática de JS */
.navbar .dropdown-menu {
    transform: none !important; /* Anula cálculos de JS */
    margin-top: 12px !important;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* 2. ESCRITORIO (PC): Pegado a la derecha del icono */
@media (min-width: 992px) {
    .navbar .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;   /* Alineado a la derecha */
        left: auto !important; /* Libera la izquierda */
        min-width: 320px;
    }
}

/* 3. MÓVIL: Flotante fijo (Evita que se corte) */
@media (max-width: 991px) {
    .navbar .dropdown-menu {
        position: fixed !important;   /* Se sale de la barra para no cortarse */
        top: 75px !important;         /* Justo debajo del header */
        left: 50% !important;         /* Centrado horizontal */
        transform: translateX(-50%) !important; /* Corrección de centrado */
        width: 90% !important;        /* Ancho seguro */
        max-width: 380px !important;
        right: auto !important;
        z-index: 1060 !important;     /* Encima de todo */
    }
}

/* --- Barra de Anuncios Sticky --- */
#global-sticky-ads {
    position: fixed !important;
    top: 70px !important; /* Altura exacta del header */
    left: 0 !important;
    width: 100% !important;
    height: 40px !important;
    z-index: 1020 !important; 
    background-color: var(--warning-color) !important;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

#global-sticky-ads .badge { margin-right: 8px; font-size: 0.7rem; }
/* Miniatura en barra sticky (v11) */
.sticky-ad-thumb {
    width: 30px; height: 30px; border-radius: 4px; object-fit: cover;
    margin-right: 8px; border: 1px solid rgba(0,0,0,0.2);
    vertical-align: middle; display: inline-block;
}

body.modal-open #global-sticky-ads { z-index: 0 !important; }

/* ==========================================================================
   5. LANDING PAGE & HERO
   ========================================================================== */

.hero-section {
    position: relative; 
    height: 60vh;
    min-height: 400px;
    background: #000 !important;
    background-image: none !important; /* v12 override */
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

/* Nuevo Hero Video Wrapper (v12) */
#hero-video-wrapper {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}
.hero-bg-video {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%; min-height: 100%; width: auto; height: auto;
    object-fit: cover; opacity: 0; transition: opacity 1.5s ease-in-out;
}
.hero-bg-video.active { opacity: 0.5; }

/* Fondos anteriores (Legacy pero mantenidos por estructura) */
.animated-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url('../assets/images/fondo_movimiento.png') repeat 0 0;
    opacity: 0.25; animation: bgSlide 60s linear infinite; z-index: 1;
    display: none; /* Oculto en favor del video, quitar display:none si se requiere fallback */
}
@keyframes bgSlide { from { background-position: 0 0; } to { background-position: 100% 100%; } }

.overlay-gradient {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.40) 100%) !important; /* Ajustado v12 */
    z-index: 1 !important;
}

.hero-content { position: relative; z-index: 2 !important; max-width: 800px; padding: 20px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.landing-section { padding: 60px 0; border-bottom: 1px solid var(--border-color); background-color: var(--bg-card); }
.landing-section h3 {
    text-align: center; margin-bottom: 40px; font-weight: 700;
    position: relative; padding-bottom: 15px;
}
.landing-section h3::after {
    content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 60px; height: 4px; background: var(--primary-color); border-radius: 2px;
}

/* Podcast Glassmorphism (v12) */
#landing-view > .container.py-5.border-top {
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 40px !important; margin-top: 30px; margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.5) !important;
}

/* Carruseles (Estilo Netflix) */
.landing-carousel-container {
    display: flex; gap: 20px; overflow-x: hidden !important; /* AutoScroll v12 */
    padding: 20px 10px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.landing-carousel-container::-webkit-scrollbar { display: none; }

/* Animación Automática (v12) */
@keyframes autoScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-1200px); }
}

.carousel-card {
    flex: 0 0 160px; scroll-snap-align: start;
    background: var(--bg-card); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-md);
    transition: transform 0.3s ease; border: 1px solid var(--border-color);
    animation: autoScroll 30s linear infinite alternate; /* v12 */
}
.carousel-card:hover { transform: translateY(-5px); }
.carousel-card img { width: 100%; height: 160px; object-fit: cover; border-bottom: 1px solid #f0f0f0; }
.carousel-card h6 { margin: 8px 5px 0; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carousel-card p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

.carousel-video-card {
    flex: 0 0 280px; aspect-ratio: 16/9; scroll-snap-align: center;
    background: black; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md);
    animation: autoScroll 30s linear infinite alternate; /* v12 */
}
.carousel-video-card video { width: 100%; height: 100%; object-fit: cover; }

/* Pausa al hover */
.landing-carousel-container:hover .carousel-card,
.landing-carousel-container:hover .carousel-video-card {
    animation-play-state: paused;
}

/* ==========================================================================
   6. LAYOUTS INTERNOS & GRIDS (Perfiles, Anuncios, Galerías)
   ========================================================================== */

/* --- PERFILES --- */
#profiles-container.profile-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    gap: 20px !important; padding-bottom: 20px;
}

.profile-card {
    background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: transform 0.2s;
    height: 100%; display: flex; flex-direction: column;
    border: 1px solid var(--border-color);
}
.profile-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.profile-card-header {
    height: 140px; background-color: #f0f2f5; position: relative;
    display: flex; align-items: flex-end; justify-content: center;
}
.profile-credibility-bar { position: absolute; top: 0; left: 0; height: 4px; background-color: var(--success-dark); z-index: 2; }
.profile-image-wrapper {
    width: 100px; height: 150px; border-radius: 50%;
    border: 4px solid var(--bg-card); position: relative; margin-bottom: -40px; z-index: 2;
    background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.profile-image-wrapper img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.user-status-indicator { position: absolute; bottom: 5px; right: 5px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }

.profile-card-body { padding: 50px 15px 15px; text-align: center; flex-grow: 1; }
.profile-name { font-size: 1.1rem; margin-bottom: 2px; }
.profile-type { font-size: 0.85rem; color: var(--primary-dark); font-weight: 600; margin-bottom: 2px; }
.profile-location { font-size: 0.8rem; color: var(--text-muted); }
.profile-desc { font-size: 0.85rem; color: var(--text-main); margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.profile-card-footer {
    padding: 12px; border-top: 1px solid var(--border-color); background: #fcfcfc;
    display: flex; justify-content: space-between; gap: 10px;
}
.profile-card-footer .btn { flex: 1; font-size: 0.85rem; }

.badge-premium {
    position: absolute; top: 10px; right: 10px; background: var(--gradient-gold); color: #333;
    padding: 4px 10px; border-radius: 20px; font-size: 0.65rem; font-weight: 800; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- ANUNCIOS --- */
#ads-container {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 20px !important;
}

.ad-card {
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border-color); box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; height: 100%;
    transition: transform 0.2s;
}
.ad-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.ad-header { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.ad-badge { font-size: 0.7rem; padding: 4px 8px; border-radius: 6px; font-weight: 700; text-transform: uppercase; }
.badge-fiesta { background: #ffebee; color: #c62828; }
.badge-cita { background: #e3f2fd; color: #1565c0; }
.badge-intercambio { background: #e8f5e9; color: #2e7d32; }
.badge-viaje { background: #fff3e0; color: #ef6c00; }
.badge-amistad { background: #f3e5f5; color: #7b1fa2; }

/* --- GALERÍA VIP --- */
#premium-content-grid.premium-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 10px !important;
}
.premium-item { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #eee; cursor: pointer; }
.premium-item img, .premium-item video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.premium-item:hover img { transform: scale(1.05); }

.premium-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white; font-size: 0.75rem; opacity: 0; transition: opacity 0.2s;
    display: flex; align-items: center;
}
.premium-item:hover .premium-overlay { opacity: 1; }

.premium-overlay img.avatar-xs, 
.premium-overlay img.rounded-circle {
    width: 30px !important; height: 30px !important; min-width: 30px !important;
    border-radius: 50% !important; object-fit: cover !important;
    border: 1.5px solid white !important; margin-right: 8px !important;
}
.premium-overlay span {
    color: white !important; font-weight: 700 !important;
    text-shadow: 0 1px 2px black; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ==========================================================================
   7. CHAT & SALAS (Diseño Pro)
   ========================================================================== */

.chat-layout-wrapper {
    display: flex; height: calc(100vh - 140px); background: var(--bg-card);
    border-radius: var(--radius); border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm); overflow: hidden;
}

.chat-sidebar { width: 280px; background: #f8f9fa; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; }
.sidebar-header { padding: 15px; border-bottom: 1px solid var(--border-color); background: #fff; font-weight: bold; }
.online-user-item { padding: 10px 15px; border-bottom: 1px solid #eee; transition: background 0.2s; }
.online-user-item:hover { background: #fff; }

.chat-window { flex: 1; display: flex; flex-direction: column; background: var(--bg-card); }
.chat-header {
    padding: 10px 20px; border-bottom: 1px solid var(--border-color); background: #fff;
    display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.chat-messages-area {
    flex: 1; padding: 20px; overflow-y: auto; background-color: #f0f2f5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.chat-message-row { display: flex; margin-bottom: 15px; align-items: flex-end; }
.message-out { justify-content: flex-end; }
.message-in { justify-content: flex-start; }

.message-bubble {
    max-width: 70%; padding: 10px 14px; border-radius: 18px;
    font-size: 0.95rem; line-height: 1.4; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.message-out .message-bubble { background: var(--primary-color); color: white; border-bottom-right-radius: 4px; }
.message-in .message-bubble { background: #ffffff; color: var(--text-main); border-bottom-left-radius: 4px; }

.message-sender { font-size: 0.75rem; font-weight: bold; margin-bottom: 4px; color: var(--primary-dark); }
.message-time { font-size: 0.65rem; text-align: right; opacity: 0.7; margin-top: 4px; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; margin-right: 8px; }

/* Media en Chat */
.chat-media-img {
    max-width: 100%; width: 250px; height: auto; border-radius: 12px;
    margin-top: 5px; cursor: pointer; border: 1px solid rgba(0,0,0,0.1);
}
.chat-media-video { max-width: 100%; width: 280px; border-radius: 12px; margin-top: 5px; }

.chat-input-area {
    padding: 10px 15px; border-top: 1px solid var(--border-color);
    background: #fff; display: flex; align-items: center; gap: 10px;
}
.btn-icon { background: none; border: none; font-size: 1.2rem; color: #777; transition: color 0.2s; padding: 5px; }
.btn-icon:hover { color: var(--primary-color); }
.message-input { border-radius: 20px; background: #f0f2f5; border: none; padding: 10px 20px; }
.message-input:focus { background: #fff; box-shadow: 0 0 0 2px var(--primary-color); }

/* ==========================================================================
   8. MODALES & PANELES
   ========================================================================== */

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 9999; backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
}
.modal-content {
    background: var(--bg-card); width: 95%; max-width: 480px;
    border-radius: var(--radius); padding: 25px;
    box-shadow: var(--shadow-lg); position: relative;
    max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column;
}
.close-modal-btn {
    position: absolute; top: 15px; right: 20px; background: none;
    border: none; font-size: 1.8rem; line-height: 1; color: var(--text-muted);
}
.close-modal-btn:hover { color: var(--danger-color); }

.rich-modal-section { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.rich-modal-section:last-child { border-bottom: none; }
.rich-list li { margin-bottom: 8px; display: flex; gap: 10px; font-size: 0.9rem; color: var(--text-main); }
.contact-box {
    background: #f9f9f9; border-left: 4px solid var(--primary-color);
    padding: 15px; border-radius: 8px; margin-bottom: 10px; display: flex; align-items: center;
}
.contact-box i { font-size: 1.5rem; margin-right: 15px; color: var(--text-muted); }

/* --- MODAL EDAD (+18/21) --- */
#age-verification-modal.modal-overlay {
    z-index: 20000 !important; 
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
}
#age-verification-modal .modal-content { border-top: 6px solid var(--primary-color); }

/* --- MODAL OXXO (v11) --- */
#oxxo-payment-modal {
    z-index: 12000 !important;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
}

/* ==========================================================================
   9. GALERÍA ESTILO INSTAGRAM (Grid 4x4)
   ========================================================================== */
.media-gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; 
    gap: 4px !important; width: 100%; margin-top: 15px;
}

.media-gallery-grid div, .gallery-item, .gallery-item-editable {
    position: relative; width: 100%; aspect-ratio: 1 / 1 !important;
    overflow: hidden; background-color: #f0f0f0; border-radius: 4px;
}

.media-gallery-grid img, .media-gallery-grid video {
    width: 100% !important; height: 100% !important;
    object-fit: cover !important; display: block;
    border: none !important; border-radius: 0 !important;
    transition: transform 0.3s ease;
}
.media-gallery-grid div:hover img { transform: scale(1.05); }

/* ==========================================================================
   10. TOASTS & EXTRAS
   ========================================================================== */

.toast-container { position: fixed; top: 90px; right: 20px; z-index: 10001; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
    pointer-events: auto; width: 320px; padding: 15px; background: white;
    border-radius: 8px; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden;
    opacity: 0; transform: translateX(50px); transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-progress {
    position: absolute; bottom: 0; left: 0; height: 3px; background: rgba(0,0,0,0.1); width: 100%;
    animation: toastTimer linear forwards;
}
@keyframes toastTimer { from { width: 100%; } to { width: 0%; } }

.toast-success { border-left: 5px solid var(--success-dark); }
.toast-success i { color: var(--success-dark); font-size: 1.2rem; }
.toast-error { border-left: 5px solid var(--danger-dark); }
.toast-error i { color: var(--danger-dark); font-size: 1.2rem; }
.toast-info { border-left: 5px solid var(--primary-color); }
.toast-info i { color: var(--primary-color); font-size: 1.2rem; }
.toast-warning { border-left: 5px solid var(--warning-dark); }
.toast-warning i { color: var(--warning-dark); font-size: 1.2rem; }

/* Botón Tema */
.theme-toggle-btn {
    position: fixed; bottom: 20px; left: 20px; width: 45px; height: 45px;
    background: #2c3e50; color: #fff; border-radius: 50%; border: none;
    box-shadow: var(--shadow-md); z-index: 20000;
    display: flex; justify-content: center; align-items: center; font-size: 1.2rem;
    cursor: pointer; transition: transform 0.2s;
}
.theme-toggle-btn:hover { transform: scale(1.1); }

/* ==========================================================================
   11. DARK MODE (ULTIMATE)
   ========================================================================== */

body.dark-mode {
    --bg-body: #0d1117; --bg-card: #161b22; --bg-input: #21262d;
    --text-main: #c9d1d9; --text-muted: #8b949e; --border-color: #30363d;
    --primary-color: #58a6ff;
    background-color: var(--bg-body); color: var(--text-main);
}
body.dark-mode #content-view { background-color: rgba(13, 17, 23, 0.95) !important; }
body.dark-mode #landing-view > .container.py-5.border-top {
    background-color: rgba(22, 27, 34, 0.9) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body.dark-mode .navbar, body.dark-mode .navbar-collapse { background-color: #161b22 !important; border-color: var(--border-color); }
body.dark-mode #public-header, body.dark-mode #app-header { background: #161b22 !important; }
body.dark-mode .nav-link { color: #c9d1d9 !important; }

body.dark-mode .card, body.dark-mode .profile-card, body.dark-mode .ad-card,
body.dark-mode .modal-content, body.dark-mode .list-group-item, body.dark-mode .contact-box,
body.dark-mode .bg-white, body.dark-mode .bg-light {
    background-color: var(--bg-card) !important; color: var(--text-main) !important; border-color: var(--border-color) !important;
}

body.dark-mode .form-control, body.dark-mode .form-select,
body.dark-mode input.form-control, body.dark-mode textarea.form-control {
    background-color: #0d1117 !important; border-color: var(--border-color) !important; color: #fff !important;
}
body.dark-mode input::placeholder, body.dark-mode textarea::placeholder { color: #8b949e !important; }

body.dark-mode .chat-messages-area { background-color: #0d1117 !important; background-image: none !important; }
body.dark-mode .chat-sidebar, body.dark-mode .chat-header, body.dark-mode .chat-input-area { background-color: #161b22 !important; border-color: var(--border-color) !important; }
body.dark-mode .message-in .message-bubble { background-color: #21262d !important; color: #fff !important; }

body.dark-mode .profile-card-header { background-color: #21262d !important; }
body.dark-mode .profile-card-footer { background-color: #161b22 !important; }
body.dark-mode .dropdown-menu { background-color: #161b22 !important; border-color: var(--border-color); }
body.dark-mode .dropdown-item { color: var(--text-main); }
body.dark-mode .dropdown-item:hover { background-color: #21262d; }
body.dark-mode .theme-toggle-btn { background-color: #fff; color: #000; }

body.dark-mode .text-muted { color: #b0b3b8 !important; }
body.dark-mode .text-dark, body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, 
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6, body.dark-mode strong, body.dark-mode b {
    color: #e6e6e6 !important;
}
body.dark-mode i.text-dark { color: #e6e6e6 !important; }
body.dark-mode #landing-view .shadow-sm {
    background-color: rgba(22, 27, 34, 0.95) !important;
    border: 1px solid #30363d !important; box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;
}

/* ==========================================================================
   12. MEDIA QUERIES (MÓVIL / RESPONSIVE)
   ========================================================================== */

@media (max-width: 991px) {
    .carousel-card { flex: 0 0 140px; }
    .navbar-collapse {
        background: var(--bg-card); padding: 15px; border-radius: 0 0 15px 15px;
        box-shadow: var(--shadow-lg); max-height: 80vh; overflow-y: auto; margin-top: 10px;
    }
    #app-header .navbar-collapse .nav-link { color: #333 !important; }
    
    /* Sidebar (se vuelve bloque completo) */
    .col-lg-3.d-none.d-lg-block {
        display: block !important; width: 100% !important;
        margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border-color);
    }
    #content-view .row { display: flex; flex-direction: column; }
    .col-lg-9 { order: 1; }
    .col-lg-3 { order: 2; }
    .col-lg-3 .sticky-top { position: static !important; z-index: 1; }
    .featured-mini-card { width: 60px !important; }
    
    /* Live Chat YT Height */
    .live-chat-container iframe { min-height: 400px; }

    /* --- CHAT MÓVIL APP MODE --- */
    .chat-layout-wrapper {
        position: fixed !important; top: 115px !important;
        left: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 100% !important; height: auto !important;
        margin: 0 !important; border: none !important; border-radius: 0 !important;
        z-index: 1025 !important; background: #fff !important;
        display: flex !important; flex-direction: column !important;
    }
    body:has(#global-sticky-ads.hide) .chat-layout-wrapper { top: 70px !important; }

    .chat-sidebar {
        flex: 0 0 75px !important; height: 75px !important; width: 100% !important;
        flex-direction: row !important; overflow-x: auto !important; overflow-y: hidden !important;
        white-space: nowrap !important; background: #f8f9fa !important;
        border-bottom: 1px solid #ddd !important; border-right: none !important; padding: 5px !important;
    }
    .online-user-item {
        display: inline-flex !important; flex-direction: column !important;
        justify-content: center !important; align-items: center !important;
        width: 85px !important; min-width: 85px !important; height: 100% !important;
        margin-right: 5px !important; border: none !important; background: transparent !important; padding: 2px !important;
    }
    .online-user-item img.avatar-small { width: 32px !important; height: 32px !important; margin: 0 0 3px 0 !important; }
    .online-user-item .user-info { display: none !important; }
    .online-user-item .btn-invite-room {
        display: block !important; font-size: 0.6rem !important; padding: 1px 4px !important; width: 90% !important;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        border-radius: 4px !important; margin-top: 2px !important;
        background-color: transparent !important; border: 1px solid var(--warning-dark) !important; color: var(--warning-dark) !important;
    }
    .chat-window { flex: 1 1 auto !important; display: flex !important; flex-direction: column !important; height: 100% !important; min-height: 0 !important; position: relative !important; }
    .chat-messages-area {
        flex: 1 1 auto !important; overflow-y: auto !important; height: 100% !important;
        padding-bottom: 20px !important; background-color: #e5ddd5 !important;
        background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 2.24 5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%239C92AC' fill-opacity='0.08' fill-rule='evenodd'/%3E%3C/svg%3E") !important;
    }
    .chat-input-area {
        flex: 0 0 auto !important; width: 100% !important; background: #fff !important;
        border-top: 1px solid #ccc !important; padding: 10px !important; position: relative !important; z-index: 20 !important;
        padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 768px) {
    /* Grids */
    #profiles-container.profile-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* Fix v11 */
        gap: 8px !important; padding: 0 5px !important;
    }
    #ads-container { grid-template-columns: 1fr !important; padding: 0 10px !important; }
    #premium-content-grid.premium-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 3px !important; }
    .media-gallery-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 2px !important; }

    /* Profile Cards Compactas (v11) */
    .profile-card-header { height: 90px !important; }
    .profile-image-wrapper { width: 75px !important; height: 75px !important; margin-bottom: -30px !important; border-width: 3px !important; }
    .profile-card-body { padding: 35px 5px 10px !important; }
    .profile-name { font-size: 0.9rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
    .profile-type { font-size: 0.7rem !important; margin-bottom: 0 !important; }
    .profile-location { font-size: 0.65rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .profile-desc { display: none !important; }
    .profile-card-footer { padding: 6px !important; flex-direction: column !important; gap: 4px !important; }
    .profile-card-footer .btn { width: 100% !important; padding: 2px 0 !important; font-size: 0.7rem !important; height: 24px !important; line-height: 1 !important; }

    /* Textos & Toast */
    .hero-content h1 { font-size: 2.2rem; }
    .toast { width: 90%; right: 5%; left: 5%; }

    /* Botón Tema Móvil */
    #theme-toggle-btn {
        bottom: 100px !important; left: 10px !important;
        width: 38px !important; height: 38px !important; font-size: 1rem !important;
        opacity: 0.6 !important;
    }
    #theme-toggle-btn:active, #theme-toggle-btn:hover { opacity: 1 !important; transform: scale(1.1); }
}

/* =========================================
   FIX FINAL: LOGO RESPONSIVO (SIN EMPALMES)
   (Reemplaza el bloque anterior con este)
   ========================================= */

/* 1. CONFIGURACIÓN BASE (Común para todos) */
.navbar-brand.centered-brand {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    z-index: 10;
}

.brand-logo-icon {
    width: auto;
    object-fit: contain;
}

.brand-text {
    font-weight: 800;
    line-height: 1;
    margin-left: 8px !important;
    white-space: nowrap;
}

/* =========================================
   2. MODO CELULAR / TABLET (< 992px)
   Aquí SÍ centramos el logo absolutamente porque el menú está oculto
   ========================================= */
/* =========================================
   2. MODO CELULAR / TABLET (< 992px)
   (CORREGIDO: Logo fijo que no se baja al abrir menú)
   ========================================= */
@media (max-width: 991px) {
    .navbar-brand.centered-brand {
        position: absolute !important;
        
        /* CENTRADO PERFECTO Y FIJO */
        top: 25px !important;       /* Exactamente la mitad del Header (70px / 2) */
        left: 50% !important;
        transform: translate(-50%, -50%) !important; 
        
        /* Evitamos que tape o sea tapado */
        z-index: 1050 !important;   /* Por encima del menú desplegable */
        max-width: 60%; 
        overflow: hidden;
        margin: 0 !important;
    }

    .brand-logo-icon {
        height: 35px; /* Tamaño ideal móvil */
    }

    /* Ocultamos texto en móvil */
    .brand-text {
        display: none !important;
    }
}

/* =========================================
   3. MODO ESCRITORIO / PC (> 992px)
   Aquí el logo vuelve a la IZQUIERDA para dejar espacio a las pestañas
   ========================================= */
@media (min-width: 992px) {
    .navbar-brand.centered-brand {
        position: static; /* Posición natural (Izquierda) */
        transform: none;  /* Quitar centrado forzado */
        margin-right: 15px !important;
    }

    .brand-logo-icon {
        height: 70px; /* Más grande en PC */
    }

    .brand-text {
        display: block !important; /* Texto visible */
        font-size: 1.1rem;
    }
    
    /* Pequeño ajuste para que las pestañas no se peguen mucho al logo */
    #main-nav {
        padding-left: 10px;
    }
}

/* =========================================
   FIX FINAL: OCULTAR LETRAS DENTRO DE LA APP
   (Evita el empalme con las pestañas de navegación)
   ========================================= */

/* 1. Ocultar texto SOLO en el header privado */
#app-header .brand-text {
    display: none !important;
}

/* 2. Ajuste opcional para el logo (icono) dentro de la app */
#app-header .brand-logo-icon {
    /* Nos aseguramos que el logo tenga buen tamaño ya que estará solo */
    height: 40px !important; 
    margin: 0 !important;
}

/* 3. Asegurar que en PC el logo se quede a la izquierda para no estorbar al menú */
@media (min-width: 992px) {
    #app-header .navbar-brand.centered-brand {
        position: static !important;
        transform: none !important;
        margin-right: 20px !important;
    }
}

/* =========================================
   PROTECCIÓN DE IMÁGENES (ANTI-ROBO BÁSICO)
   ========================================= */
img, video {
    /* Evita que el usuario pueda arrastrar la imagen al escritorio */
    -webkit-user-drag: none;
    
    /* Evita que se pueda seleccionar como texto */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    /* Evita el menú táctil de "guardar imagen" en celulares (iOS/Android) */
    -webkit-touch-callout: none; 
}

/* =========================================
   ESTILOS DEL VISOR (LIGHTBOX)
   ========================================= */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); /* Fondo muy oscuro */
    z-index: 20000; /* Por encima de todo */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox-overlay img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
    /* Mantener protecciones anti-robo */
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
}

/* =========================================
   AJUSTE DE VIDEO EN MÓVIL (VER TODO EL CONTENIDO)
   ========================================= */
@media (max-width: 768px) {
    /* 1. Ajustamos el contenedor para que no sea tan alto */
    .hero-section {
        height: auto !important;       /* Altura automática según el video */
        min-height: auto !important;   /* Quitar altura forzada de 400px */
        aspect-ratio: 16/9 !important; /* Mantener proporción de video TV */
        background: #000 !important;   /* Fondo negro por si acaso */
    }

    /* 2. Ajustamos el video para que quepa perfecto */
    .hero-bg-video {
        width: 100% !important;
        height: 100% !important;
        
        /* 'contain' obliga a que el video quepa entero sin cortarse */
        object-fit: contain !important; 
        
        /* Quitamos el centrado absoluto antiguo para que fluya normal */
        position: static !important; 
        transform: none !important;
    }
    
    /* 3. Ajuste opcional para el texto sobre el video (para que no tape todo) */
    .hero-content {
        transform: scale(0.8); /* Hacemos el texto un poco más chico */
        padding: 10px !important;
    }
}