






/* SHEET MEJORADO APPLICATIONS */
:root {
  --sheet-bg: #ffffff;
  --sheet-text: #1a1a1a;
  --sheet-border: #eeeeee;
  --overlay-bg: rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root {
    --sheet-bg: #1a1c1e; /* Fondo oscuro profesional */
    --sheet-text: #f0f0f0;
    --sheet-border: #333333;
    --overlay-bg: rgba(0, 0, 0, 0.7); /* Más oscuro en modo noche */
  }
}

.sheet {
  position: fixed;
  left: 0;
  bottom: -100%;
  width: 100%;
  height: 70vh;
  max-height: 90vh;
  background: var(--sheet-bg);
  color: var(--sheet-text);
  z-index: 9900;
  transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  transform: translateZ(0);
  will-change: transform;
  border-radius: 20px 20px 0 0;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: pan-y;
}

.sheet.open {
  bottom: 0;
  visibility: visible;
}

/* CONTENEDOR PRINCIPAL */
.sheet-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* HEADER FIJO */
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sheet-border);
  flex-shrink: 0;
}

/* LISTA CON SCROLL */
#applicationsList {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* OVERLAY OSCURO + DIFUMINADO */
.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px); /* Efecto Glassmorphism */
  -webkit-backdrop-filter: blur(4px);
  z-index: 9899; /* Justo debajo de la sheet */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.sheet-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Estilo para los items dentro de la lista en modo oscuro */
#applicationsList div, #applicationsList p, #applicationsList span {
  color: var(--sheet-text);
}











/* ============================================
   VARIABLES Y RESET GLOBAL
   ============================================ */
:root {
    --primary: #2a7de1;
    --primary-dark: #1a5cb0;
    --secondary: #e6f2ff;
    --accent: #34c759;
    --danger: #ff3b30;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --text-lighter: #999;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 5px 15px rgba(0, 0, 0, 0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --profile-text: #111;
    --profile-text-light: #666;
    --profile-border: rgba(0,0,0,0.1);
    --profile-bg: #ffffff;
    --profile-blue: #2563eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}




body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 70px; /* Espacio para navegación móvil */;
}



a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 100% !important !important;
    margin: 0 auto;
    padding: 0 20px;
}



























/* ============================================
   ESTILOS BASE (Comunes para ambos)
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap');

.logo {
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    z-index: 10;
}

.logo-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
}

.logo-bg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.logo i, .logo span {
    z-index: 2;
    position: relative;
}

/* ============================================
   📱 LÓGICA PARA MÓVIL (Pantallas pequeñas)
   ============================================ */
@media (max-width: 767px) {
    .logo {
        gap: 6px;
        padding: 5px 12px;
        font-size: 1.2rem; /* Tamaño compacto para que quepa en el nav móvil */
    }

    .logo i {
        font-size: 1.4rem;
    }

    .logo-bg {
        /* En móvil usamos un escalado fijo para que el círculo/fondo no se rompa */
        width: 170%; 
        height: 185%;
    }
}

/* ============================================
   💻 LÓGICA PARA ESCRITORIO (Desktop)
   ============================================ */
@media (min-width: 768px) {
    .logo {
        gap: 12px;
        padding: 10px 25px; /* Más espacio para que el fondo respire */
        font-size: 1.9rem;   /* Mucho más visible en pantallas grandes */
    }

    .logo i {
        font-size: 2.1rem;
    }

    .logo-bg {
        /* En escritorio hacemos que el fondo se estire según el texto largo */
        width: 130%; 
        height: 145%;
        /* Quitamos el scale para controlar el tamaño solo con width/height */
    }

    .logo span {
        font-size: 2rem;
    }
}

/* ============================================
   EFECTOS VISUALES (Pinterest Style)
   ============================================ */
.logo span {
    font-family: 'Fredoka One', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.logo:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

















/* ============================================
   2. HEADER Y NAVEGACIÓN DE ESCRITORIO - OPTIMIZADO
   ============================================ */

/* Variables para el header */
:root {
    --header-bg: rgba(255, 255, 255, 0.85);
    --header-bg-scrolled: rgba(255, 255, 255, 0.95);
    --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --header-shadow-scrolled: 0 4px 15px rgba(0, 0, 0, 0.08);
    --primary: #2a7de1;
    --text-dark: #333;
    --bg-white: #ffffff;
    --border: #e0e0e0;
    --text-light: #666;
}

/* Header principal - OPTIMIZADO */



header {
    position: sticky;
    overflow: visible !important;
    top: 0;
    z-index: 1000;
    margin: 0;
    background: var(--header-bg);
    padding-top: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    animation: headerSlideDown 0.5s ease forwards;
}


/* Backdrop-filter activado por JS cuando NO hay scroll */
body:not(.is-scrolling) header {
    backdrop-filter: none;
    transform: translateZ(0);
}

/* Efecto scroll - OPTIMIZADO (sin backdrop-filter) */
header.scrolled {
    background: var(--header-bg-scrolled);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Logo en estado scroll - sin cilindro */


header.scrolled .logo {
    
    
    color: var(--text-dark);
    
    transform: translateZ(0);
    will-change: transform;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}



header.scrolled .logo:hover {
    background: none; /* 🔥 Mantener sin cilindro */
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

/* Texto del logo en estado scroll */
header.scrolled .logo span {
    background: linear-gradient(135deg, var(--primary) 0%, #2a7de1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   ESTILOS PARA OCULTAR LOGO
   ============================================ */

/* Estado cuando el logo está oculto */
.logo.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-20px) !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

/* Estado cuando el modal está abierto */
body.modal-open header {
    background: rgba(255, 255, 255, 0.95);
}

/* Ajustar navbar cuando el logo está oculto */
body.modal-open .navbar {
    justify-content: flex-end;
}

/* Borde superior sutil - OPTIMIZADO (simplificado) */
header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.8) 20%,
        rgba(255, 255, 255, 0.8) 80%,
        transparent
    );
    z-index: 2;
    opacity: 0.7;
}

/* Reducir opacidad del borde durante scroll */


header.scrolled::before {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}







/* Navbar contenedor escritorio */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    position: relative;
    z-index: 3;

}

/* Navegación escritorio */
.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

/* Enlaces de navegación escritorio - OPTIMIZADO */
.nav-links a {
    font-weight: 500;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
    padding: 8px 8px;
    font-size: 0.95rem;
    white-space: nowrap;
    border-radius: 6px;
    cursor: pointer;
    /* Evitar reflows */
    transform: translateZ(0);
}

.nav-links a:hover {
    color: var(--primary);
    background-color: rgba(0, 0, 0, 0.02);
}

.nav-links .active {
    color: var(--primary);
}

/* Texto iconos escritorio */
.nav-icon-text {
    display: inline-block;
}

/* Iconos navegación escritorio */
.nav-links i {
    font-size: 1.4rem;
    position: relative;
    z-index: 2;
}

/* Badges notificaciones y mensajes - OPTIMIZADO (unificado) */
.notif-icon-wrapper,
.message-badge-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-count,
.message-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-white);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
    /* Aceleración GPU */
    transform: translateZ(0);
}

/* Icono sobre el badge */
.notif-icon-wrapper i {
    position: relative;
    z-index: 2;
}

/* Buscador escritorio */
.nav-search {
    position: relative;
    width: 280px;
}

.nav-search input {
    width: 100%;
    padding: 8px 15px 8px 35px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    background: #f8f9fa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    pointer-events: none;
}

/* Botón login escritorio */
#loginBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

#loginBtn:hover {
    background: #1a6bc7;
    transform: translateY(-1px);
}

#loginBtn:active {
    transform: translateY(0);
}

/* Usuario autenticado escritorio */
#authUserBox {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid var(--primary);
    transition: border-color 0.2s ease;
}

.user-avatar:hover {
    border-color: #1a6bc7;
}

#logoutBtn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#logoutBtn:hover {
    background: #e03e4d;
}


















/* ============================================================
    (NV) - MOBILE NAV & COMPONENTES - OPTIMIZADO
   ============================================================ */

.mobile-nav {
    display: none; /* Se activa por JS o Media Query según tu lógica */
    position: fixed;
    inset: auto 0 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    
    /* --- GLASSMORPHISM OPTIMIZADO PARA GAMA BAJA --- */
    background-color: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    
    /* ACELERACIÓN POR HARDWARE (Quita el lag) */
    transform: translateZ(0);
    will-change: backdrop-filter;
    /* ---------------------------------------------- */

    border-top: 0.5px solid rgba(60, 60, 67, 0.12);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    justify-content: space-around;
    align-items: center;
    z-index: 100004; /* Mantenerlo sobre todo */
}

/* ── Variante: modal abierto ── */
body.modal-open .mobile-nav {
    pointer-events: none;
    border-radius: 0;
}

body.modal-open .mobile-nav button.active {
    background: transparent !important;
}

body.modal-open .mobile-nav button.active::after {
    opacity: 0 !important;
}

/* ── Dark mode Optimizado ── */
@media (prefers-color-scheme: dark) {
    .mobile-nav {
        background-color: rgba(28, 28, 30, 0.75) !important;
        border-top-color: rgba(84, 84, 88, 0.3);
    }
}

/* ============================================================
   BOTONES - NAVEGACIÓN (COLOR & TRAZO OPTIMIZADO)
   ============================================================ */

.mobile-nav button {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    
    /* Negro suave premium con ligera transparencia */
    color: rgba(26, 26, 26, 0.9); 
    
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease, transform 0.1s ease, opacity 0.1s ease;
}

/* Ajuste de los iconos internos (SVG/i) */
.mobile-nav button svg,
.mobile-nav button i {
    fill: transparent;
    stroke: currentColor;
    /* Un trazo de 2.2 hace que el negro resalte más sobre el cristal */
    stroke-width: 2.2; 
    transition: stroke-width 0.2s cubic-bezier(0.2, 0.9, 0.4, 1);
}

/* ESTADO ACTIVO: Resalta con tu color primario y relleno suave */
.mobile-nav button.active {
    color: var(--primary);
}

.mobile-nav button.active svg path,
.mobile-nav button.active svg circle,
.mobile-nav button.active svg rect {
    fill: currentColor;
    fill-opacity: 0.25; /* Relleno sutil para indicar selección */
    stroke-width: 2.4;   /* Un poquito más grueso cuando está activo */
}

/* MODO OSCURO: Adaptación automática */
@media (prefers-color-scheme: dark) {
    .mobile-nav button {
        color: rgba(245, 245, 247, 0.85); /* Blanco hueso suave */
    }
    
    .mobile-nav button.active {
        color: var(--primary);
    }
}

/* Feedback táctil al presionar */
.mobile-nav button:active {
    transform: scale(0.9);
    opacity: 0.7;
}

.mobile-nav button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================================
   ICONOS Y ESTADOS
   ============================================================ */

.mobile-nav .notif-icon-wrapper-inner,
.mobile-nav .message-badge-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
}

/* ============================================================
   ICONO DE INICIO
   ============================================================ */

.mobile-nav-btn .icon-home-normal {
    display: block;
}

.mobile-nav-btn .icon-home-active {
    display: none;
}

.mobile-nav-btn.active .icon-home-normal {
    display: none;
}

.mobile-nav-btn.active .icon-home-active {
    display: block;
}

.mobile-nav-btn.active .icon-home-active path:last-child {
    stroke: #ffffff;
}

/* ============================================================
   ICONO DE MENSAJES
   ============================================================ */
.message-button.active .icon-circle {
    fill: #ffffff;
    stroke: #ffffff;
    stroke-width: 1.3;
}

/* ============================================================
   AVATAR Y BADGES
   ============================================================ */

.mobile-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color 0.15s ease;
}

.mobile-nav button.active .mobile-avatar {
    border-color: var(--primary);
}

.mobile-nav .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 18px;
    border: 1.5px solid white;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .mobile-nav .badge {
        border-color: #1c1c1e;
    }
}

/* ============================================================
   SOPORTE SAFE AREA (IPHONE X+)
   ============================================================ */

@supports (padding: max(0px)) {
    .mobile-nav {
        padding-bottom: max(env(safe-area-inset-bottom), 0px);
        height: calc(60px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 360px) {
    .mobile-nav button {
        width: 44px;
        height: 44px;
    }
}




















/* ============================================
   HEADER Y BARRA DE NAVEGACIÓN (ESCRITORIO)
   ============================================ */

.navbar {
    position: relative;
    z-index: auto; /* Valor corregido: eliminado punto y coma extra */
}

/* Contenedor del buscador */
.nav-search {
    position: relative;
    z-index: 200;
}

/* ============================================
   FEED Y CONTENIDO PRINCIPAL
   ============================================ */

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    padding: 30px 0;
}

.feed {
    width: 100%;
    max-width: 100% !important !important;
    min-width: 0;
}

.sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* ============================================
   RESPONSIVE DESIGN - OPTIMIZADO
   ============================================ */

/* MÓVIL (max-width: 768px) */
@media (max-width: 768px) {
    header {
        margin: 0 12px;
        margin-top: 6px;
        max-width: calc(100% - 24px);
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .navbar {
        padding: 10px 16px;
        justify-content: center;
    }

    .logo {
        padding: 8px 16px;
        font-size: 1.5rem;
        gap: 8px;
    }

    .logo i {
        font-size: 1.6rem;
    }

    .nav-links {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    .nav-icon-text {
        display: none;
    }

    .notif-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 60vh;
        max-height: 500px;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: none;
        will-change: transform;
    }

    .notif-panel.active {
        transform: translateY(0);
    }

    .notif-content {
        max-height: calc(60vh - 120px);
        overflow-y: auto;
    }

    .nav-search {
        width: 100%;
        margin: 10px 0;
    }

    .notif-icon-wrapper {
        position: relative;
        width: 50px;
        height: 50px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .notif-icon-wrapper .notif-count {
        position: absolute;
        top: 20px;
        right: 20px;
        min-width: 22px;
        height: 22px;
        padding: 2px 6px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #ff4757;
        color: white;
        font-size: 11px;
        font-weight: bold;
        border: 2px solid var(--bg-white);
        z-index: 3;
        box-sizing: border-box;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
        will-change: transform;
    }

    .notif-icon-wrapper .message-badge {
        top: -4px;
        right: -4px;
        min-width: 22px;
        height: 22px;
        padding: 2px 6px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #ff4757;
        color: white;
        font-size: 11px;
        font-weight: bold;
        border: 2px solid var(--bg-white);
        z-index: 3;
        box-sizing: border-box;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 0 80px;
    }

    .feed,
    .sidebar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

.notif-icon-wrapper-inner {
    position: relative;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ESCRITORIO (min-width: 769px) */
@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }

    .nav-links {
        display: flex;
    }

    .nav-icon-text {
        display: inline-block;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-links a {
        font-size: 0.85rem;
        gap: 4px;
        padding: 6px 8px;
    }

    .nav-links i {
        font-size: 1rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .logo i {
        font-size: 1.3rem;
    }

    #loginBtn {
        padding: 7px 14px;
        font-size: 0.85rem;
    }

    .notif-count,
    .message-badge {
        font-size: 9px;
        min-width: 18px;
        height: 18px;
        padding: 2px 4px;
        top: -8px;
        right: -8px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .nav-search {
        width: 260px;
    }

    .nav-search input {
        padding: 7px 15px 7px 32px;
        font-size: 0.85rem;
    }

    .search-icon {
        font-size: 13px;
        left: 10px;
    }

    .notif-panel {
        position: absolute;
        top: 60px;
        right: 20px;
        width: 360px;
        max-width: 90vw;
        max-height: 65vh;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: none;
        border-radius: 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
        will-change: transform;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1001;
    }

    .notif-panel.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .notif-header {
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
        font-weight: 600;
    }

    .notif-footer {
        padding: 14px 16px;
        border-top: 1px solid var(--border);
        text-align: center;
    }

    .notif-footer a {
        color: var(--primary);
        text-decoration: none;
        font-size: 0.9rem;
    }

    .notif-footer a:hover {
        text-decoration: underline;
    }

    .notif-icon-wrapper-panel.desktop {
        width: 32px;
        height: 32px;
    }

    .notif-icon {
        width: 18px;
        height: 18px;
    }

    .notif-text {
        font-size: 0.875rem;
        line-height: 1.3;
        margin-bottom: 3px;
    }

    .notif-time {
        font-size: 0.75rem;
        color: #999;
    }

    .notif-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
    }
}

/* TABLETS (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .navbar {
        padding: 14px 20px;
    }

    .logo {
        padding: 9px 20px;
    }

    .nav-links {
        gap: 15px;
    }
}

/* PANTALLAS MUY GRANDES (4K) */
@media (min-width: 1920px) {
    .nav-links a {
        font-size: 0.8rem;
    }

    .nav-links i {
        font-size: 0.9rem;
    }

    .logo {
        font-size: 1.2rem;
    }
}

/* ============================================
   ANIMACIONES - OPTIMIZADAS
   ============================================ */
@keyframes headerSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* ============================================
   UTILIDADES DE RENDIMIENTO
   ============================================ */

body.is-scrolling header,
body.is-scrolling .mobile-nav {
    backdrop-filter: none;
}

.nav-links a,
#loginBtn,
.user-avatar,
.logo {
    will-change: transform;
    transform: translateZ(0);
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 0 80px;
    }

    .feed,
    .sidebar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .post-details {
        flex-direction: column;
        gap: 10px;
    }

    .post-actions {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .post-action-left {
        width: 100%;
        justify-content: space-between;
    }
}


























/* BURBUJA DE ALERTA*/

  .login-bubble-wrapper {
    position: fixed;
    bottom: 70px;
    right: 7px;
    z-index: 5999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: transform, opacity;
    
    /* Oculto en pantallas grandes por defecto */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  /* Mostrar solo en móviles y tablets pequeñas */
  @media (max-width: 768px) {
    .login-bubble-wrapper {
      opacity: 1;
      visibility: visible;
      pointer-events: all;
    }
  }

  /* Estado oculto por scroll */
  .login-bubble-wrapper.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(20px);
  }

  /* Estado visible por inactividad */
  .login-bubble-wrapper.visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
    transform: translateY(0);
  }

  .login-bubble {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 14px 20px;
    border-radius: 24px 24px 4px 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
    animation: bubbleAppear 0.5s cubic-bezier(0.22,1,0.36,1) both;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    max-width: 280px;
    white-space: normal;
    line-height: 1.4;
    transition: all 0.3s ease;

    position: relative;

  }

  .login-bubble:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  }


.login-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;      /* posición vertical de la punta */;
  right: 20px;        /* mueve la punta izquierda/derecha */;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid #0d47a1; /* color de la burbuja */;
}

  /* Icono de Google SVG */
  .google-icon {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .bubble-content {
    flex: 1;
  }

  .bubble-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 6px;
  }

  .bubble-title span {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 400;
  }

  .benefits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }

  .benefit-item {
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .benefit-item svg {
    width: 12px;
    height: 12px;
    fill: white;
  }

  .bubble-dot {
    width: 10px;
    height: 10px;
    background: #ff3b30;
    border-radius: 50%;
    position: absolute;
    top: -3px;
    right: -3px;
    animation: blink 1.2s ease-in-out infinite;
    border: 2px solid white;
  }

  @keyframes bubbleAppear {
    from { opacity: 0; transform: scale(0.6) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  @keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }

  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
  }

  .login-bubble.float {
    animation: float 2.5s ease-in-out infinite;
  }

  /* Pequeños ajustes para móviles muy pequeños */
  @media (max-width: 380px) {
    .login-bubble {
      max-width: 240px;
      padding: 12px 16px;
    }
    
    .benefits-list {
      gap: 4px;
    }
    
    .benefit-item {
      padding: 2px 6px;
      font-size: 10px;
    }
  }
















/* Panel de aplicaciones sheet */
.applications-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  visibility: hidden;
  pointer-events: none;
}

.applications-panel.active {
  visibility: visible;
  pointer-events: all;
}

.applications-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.applications-panel.active .applications-overlay {
  opacity: 1;
}

.applications-sheet {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 60%;
  max-width: 800px;
  height: 60vh;
  background: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.applications-panel.active .applications-sheet {
  transform: translateX(-50%) translateY(0);
}

.applications-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
  border-radius: 20px 20px 0 0;
}

.applications-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #1f2937;
  font-weight: 600;
}

.close-applications-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #6b7280;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-applications-btn:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.applications-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.applications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.application-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #f9fafb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.application-item:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
  transform: translateY(-1px);
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: white;
  font-size: 1.5rem;
}

.app-info {
  flex: 1;
}

.app-info h4 {
  margin: 0 0 5px 0;
  font-size: 1rem;
  color: #1f2937;
  font-weight: 600;
}

.app-info p {
  margin: 0 0 5px 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.app-date {
  font-size: 0.75rem;
  color: #9ca3af;
}

.app-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.app-status.pending {
  background: #fef3c7;
  color: #d97706;
}

.app-status.completed {
  background: #d1fae5;
  color: #059669;
}

.app-status.cancelled {
  background: #fee2e2;
  color: #dc2626;
}

.applications-empty,
.applications-error {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.applications-empty i,
.applications-error i {
  font-size: 3rem;
  margin-bottom: 15px;
  color: #9ca3af;
}

.applications-error i {
  color: #ef4444;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .applications-sheet {
    width: 100%;
    height: 60vh;
  }
  
  .application-item {
    padding: 12px;
  }
  
  .app-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
}

/* Animación de entrada */
@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100%);
  }
  to {
    transform: translateX(-50%) translateY(0);
  }
}







































/* ============================================
   4. PANEL DE NOTIFICACIONES (COMPARTIDO)
   ============================================ */

.notif-panel {
    position: fixed;
    top: auto;
    bottom: 60px; /* ← PEGADO AL NAVBAR INFERIOR */;
    left: 0;
    right: 0;
    height: auto;
    max-height: calc(100vh - 120px); /* ← ALTURA MÁXIMA: 100vh - 60px (navbar) - 60px (margen superior) */;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
    border-radius: 12px 12px 0 0;
    z-index: 99999;
    display: none;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%); /* ← INICIALMENTE FUERA DE PANTALLA (ABAJO) */;
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);    
    overflow: visible;
 
    will-change: transform;


}

.notif-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* ← SUBE Y SE PEGA AL NAVBAR */;
    display: flex;
}

/* Handle de arrastre iOS (opcional) */
.notif-handle {
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
    margin: 12px auto 8px;
    flex-shrink: 0;
}

/* Contenedor interno para scroll - FLEXBOX VERSION */
.notif-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    overscroll-behavior: contain; /* 🔥 evita que el scroll salga del panel */;

}



.notif-content::-webkit-scrollbar {
    width: 6px;
}

.notif-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.notif-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* 🔥 CORREGIDO: Overlay cubre toda la pantalla EXCEPTO el navbar */
.notif-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; /* ← CUBRE TODA LA PANTALLA */;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.notif-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* 🔥 IMPORTANTE: Asegurar que el nav inferior esté siempre encima */
.mobile-nav {
    z-index: 100004 !important; /* ← MÁS ALTO QUE EL PANEL Y OVERLAY */;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white; /* ← Asegurar que tenga fondo */;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform; /* ← Sombra para separación visual */;
}

/* Estructura panel */
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.notif-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.notif-actions {
    display: flex;
    gap: 10px;
}

/* Botones panel */
.notif-close,
.notif-action-btn {
    background: rgba(0, 0, 0, 0.03);
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-close:hover,
.notif-action-btn:hover {
    background: #f1f5f9;
}

/* Iconos pequeños */
.notif-icon-sm {
    width: 18px;
    height: 18px;
    fill: #64748b;
}

/* Lista notificaciones */
.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notif-item {
    position: relative;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.notif-item:last-child {
    border-bottom: none;
}




.notif-item:hover {
    background-color: #f8fafc;
}

.notif-item.unread {
    background-color: #f0f9ff;
}

.notif-item.unread:hover {
    background-color: #e0f2fe;
}

/* Contenido item */
.notif-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

/* Avatar notificación */
.notif-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Icono panel */
.notif-icon-wrapper-panel {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1f5f9;
}

.notif-item.unread .notif-icon-wrapper-panel {
    background: #dbeafe;
}

.notif-icon {
    width: 18px;
    height: 18px;
}

/* Texto notificación */
.notif-text-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.notif-text {
    margin: 0;
    font-size: 0.875rem;
    color: #1e293b;
    line-height: 1.3;
}

.notif-time {
    margin-top: 2px;
    font-size: 0.75rem;
    color: #64748b;
}

/* Badge notificación */
.notif-badge {
    margin-left: 8px;
    background: #3b82f6;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    flex-shrink: 0;
    align-self: center;
}

/* Botón eliminar */
.notif-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notif-delete:hover {
    color: #ff3b3b;
    background: rgba(255, 59, 59, 0.1);
    transform: scale(1.1);
}

/* Estados vacío/error */
.notif-empty,
.notif-error {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
}

.notif-empty.show,
.notif-error.show {
    display: flex;
}

.notif-empty-text,
.notif-error-text {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

/* Footer panel */
.notif-footer {
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-shrink: 0;
}

.notif-view-all {
    width: 100%;
    padding: 8px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.notif-view-all:hover {
    background: #2563eb;
}

/* Colores iconos SVG */
.notif-icon-wrapper-panel svg {
    fill: #475569;
}

.notif-item.unread .notif-icon-wrapper-panel svg {
    fill: #3b82f6;
}

.notif-action-btn svg,
.notif-close svg {
    fill: #64748b;
}

.notif-action-btn:hover svg,
.notif-close:hover svg {
    fill: #1e293b;
}



.notif-empty-icon svg {
    fill: #cbd5e1;
}

.notif-error-icon svg {
    fill: #f87171;
}

/* Desktop styles */
@media (min-width: 768px) {
    .notif-panel {
        top: 50%;
        left: 50%;
        bottom: auto;
        transform: translate(-50%, -50%) scale(0.9);
        width: 420px;
        height: auto;
        max-height: 85vh;
        border-radius: 12px;
        display: none;
    }

    .notif-panel.active {
        transform: translate(-50%, -50%) scale(1);
        display: flex;
    }

    .notif-handle {
        display: none;
    }

    .notif-content {
        max-height: 350px;
        height: auto;
        flex: none;
    }
}

/* Estilos específicos para el botón de cerrar */
#notifClose {
    outline: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

#notifClose:focus {
    outline: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

#notifClose:active {
    outline: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* Overlay alternativo para mejor control */
.notif-overlay-alt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9998;
    pointer-events: none;
}

.notif-overlay-alt.active {
    background-color: rgba(0, 0, 0, 0.5);
    pointer-events: all;
}




































/* ===== MODAL MENSAJES PRINCIPAL (70% iOS) ===== */
.messages-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px; /* ← RESPETA EL NAVBAR INFERIOR */;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9900;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform; /* ← EFECTO FROSTED GLASS AQUÍ */;
    transform: translateZ(0);
    will-change: transform; /* ← Soporte Safari */;
}

.messages-modal.active {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.messages-content {
    background: #fff;
    width: 100%;
    max-width: 100%;
    height: 70vh; /* ← 70% del viewport restante */;
    max-height: 70vh;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.messages-modal.active .messages-content {
    transform: translateY(0);
}

/* Header */
.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.messages-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

#messagesClose {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #555;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -8px;
}

#messagesClose:hover {
    color: #000;
}

/* Lista de contactos */
.following-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Elementos de contacto */
.chat-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
    border-bottom: 1px solid #f5f5f5;
}

.chat-user:hover {
    background: #f5f7fb;
}

.chat-user-avatar {
    position: relative;
    flex-shrink: 0;
}

.chat-user img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2a7de1;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
    z-index: 2;
}

.chat-user-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.chat-user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.chat-user strong {
    display: block;
    font-size: 15px;
    color: #222;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-unread-count {
    font-size: 12px;
    color: #ff4757;
    font-weight: bold;
    margin-left: 8px;
    flex-shrink: 0;
}

.chat-user small {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.chat-icon {
    color: #2a7de1;
    font-size: 20px;
    margin-left: 8px;
    flex-shrink: 0;
}

/* ===== MODAL TEMPORAL DE CHAT (100% pantalla) ===== */
#tempChatModal {
    opacity: 0;
    animation: chatModalFadeIn 0.25s ease-out forwards;
}

@keyframes chatModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-modal-container {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.chat-partner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2a7de1;
}

.chat-partner-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-close-button {
    background: none;
    border: none;
    font-size: 28px;
    color: #555;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -8px;
}

.chat-close-button:hover {
    color: #000;
}

/* Área de mensajes */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Burbujas de mensaje */
.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    margin: 4px 0;
}

.message-bubble.own {
    background: #0084ff;
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message-bubble.other {
    background: #e4e6eb;
    color: #050505;
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

.message-meta {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
    text-align: right;
}

/* Área de input */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}

.chat-input-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-field:focus {
    border-color: #0084ff;
}

.chat-send-button {
    background: #0084ff;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-button:hover {
    background: #0073e6;
}

/* Estados de mensajes */
.no-messages, .error-message {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 40px 20px;
    margin: auto;
}

.error-message {
    color: #ff4757;
}

/* Scroll optimizado */
.chat-messages-area::-webkit-scrollbar,
.following-list::-webkit-scrollbar {
    width: 4px;
}

.chat-messages-area::-webkit-scrollbar-thumb,
.following-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* Bloqueo de scroll */
body.messages-modal-open,
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

html.messages-modal-open,
html.modal-open {
    overflow: hidden;
}

/* Badges para botones */
.message-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
    z-index: 10;
}

/* Responsive */
@media (min-width: 768px) {
    .messages-modal {
        align-items: center;
        backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform; /* ← MÁS DESENFOQUE EN DESKTOP */;
    transform: translateZ(0);
    will-change: transform;
    }

    .messages-content {
        max-width: 420px;
        height: 85vh;
        max-height: 85vh;
        border-radius: 16px;
        transform: translateY(0) scale(0.9);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .messages-modal.active .messages-content {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    .messages-handle {
        display: none;
    }

    .chat-modal-container {
        width: 420px;
        height: 85vh;
        max-height: 85vh;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
    }
}

/* Soporte antiguo */
@supports not (backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform) {
    .messages-modal {
        background: rgba(0, 0, 0, 0.6); /* ← FONDO MÁS OSCURO SIN BACKDROP-FILTER */;
    }
}

@supports not (inset: 0) {
    .messages-modal {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
}































/* ===============================
   LOGIN LINK / GOOGLE AUTH
   =============================== */

.login-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: #0a66c2;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;

  padding: 8px 14px;
  border-radius: 999px;

  background: transparent;
  border: 1px solid transparent;

  cursor: pointer;
  user-select: none;

  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease;
}

/* Icono */
.login-link i {
  font-size: 15px;
}

/* Hover */
.login-link:hover {
  background-color: #e6f0fb;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* Click */
.login-link:active {
  transform: scale(0.96);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* Focus accesible */
.login-link:focus-visible {
  outline: none;
  border-color: #0a66c2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* ===============================
   VARIANTE BOTÓN (RECOMENDADO)
   =============================== */

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;

  background: #ffffff;
  color: #1f1f1f;

  border: 1px solid #dadce0;
  border-radius: 999px;

  padding: 8px 16px;

  font-weight: 500;
  font-size: 14px;

  cursor: pointer;
  user-select: none;

  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease;
}

/* Icono Google */
.login-btn i {
  font-size: 16px;
  color: #4285f4;
}

/* Hover */
.login-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* Click */
.login-btn:active {
  transform: scale(0.97);
}

/* Focus accesible */
.login-btn:focus-visible {
  outline: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* ===============================
   RESPONSIVE
   =============================== */

@media (max-width: 600px) {
  .login-link,
  .login-btn {
    font-size: 13px;
    padding: 7px 12px;
  }
}








/* Main content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px; /* default */;
    gap: 30px;
    padding: 30px 0;
    width: 100%;
    max-width: 1600px; /* opcional, para que crezca en desktop */;
    margin: 0 auto;    /* centra en pantalla grande */;
}




/* Stories - Estilo Apple Minimalista */
.stories-container {
    background-color: var(--bg-white);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
        0 4px 6px rgba(0, 0, 0, 0.03),
        0 1px 3px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.stories {
    display: flex;
    gap: 24px;
    min-height: 120px;
    align-items: flex-start;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 4px;
}

.story {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 auto;
    width: 90px;
    position: relative;
}

.story:hover {
    transform: translateY(-4px);
}

.story::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 4px;
    height: 4px;
    background: transparent;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.story:hover::after {
    background: var(--primary-color);
    width: 6px;
    height: 6px;
}

.story-img {
    width: 80px;
    height: 80px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
        inset 0 1px 2px rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.story:hover .story-img {
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
        inset 0 1px 2px rgba(255, 255, 255, 0.9),
        0 6px 20px rgba(0, 0, 0, 0.06),
        0 3px 6px rgba(0, 0, 0, 0.04);
    transform: scale(1.02);
}

.story-img img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 32px;
    transition: all 0.3s ease;
    filter: saturate(1.05);
}

.story:hover .story-img img {
    transform: scale(1.05);
}

.story-name {
    font-size: 13px;
    font-weight: 500;
    color: #1d1d1f;
    text-align: center;
    letter-spacing: -0.01em;
    line-height: 1.3;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(245, 245, 247, 0.8);
    backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
    border: 0.5px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.story:hover .story-name {
    background: rgba(245, 245, 247, 0.95);
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* Scrollbar minimalista */
.stories-container::-webkit-scrollbar {
    height: 4px;
}

.stories-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 2px;
}

.stories-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.stories-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.15);
}

/* MÓVIL - Ajustes responsivos */
@media (max-width: 767px) {
    .stories-container {
        border-radius: 18px;
        padding: 20px;
        margin: 0 16px 20px;
        width: calc(100% - 32px);
    }
    
    .stories {
        gap: 20px;
        padding: 2px;
        min-height: 110px;
    }
    
    .story {
        width: 80px;
    }
    
    .story-img {
        width: 70px;
        height: 70px;
        border-radius: 35px;
    }
    
    .story-img img {
        width: 56px;
        height: 56px;
        border-radius: 28px;
    }
    
    .story-name {
        font-size: 12px;
        padding: 5px 8px;
        border-radius: 10px;
    }
}

/* Tablet - Ajustes intermedios */
@media (min-width: 768px) and (max-width: 1023px) {
    .stories-container {
        border-radius: 22px;
        padding: 22px;
    }
    
    .stories {
        gap: 22px;
    }
    
    .story {
        width: 85px;
    }
}

/* Animación sutil al cargar */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

/* Retraso escalonado para animación */
.story:nth-child(1) { animation-delay: 0.05s; }
.story:nth-child(2) { animation-delay: 0.1s; }
.story:nth-child(3) { animation-delay: 0.15s; }
.story:nth-child(4) { animation-delay: 0.2s; }
.story:nth-child(5) { animation-delay: 0.25s; }
.story:nth-child(6) { animation-delay: 0.3s; }







/* TABLET */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-content {
        grid-template-columns: 1.5fr 1fr;
    }

    .stories {
        gap: 22px;
    }

    .story {
        min-width: 90px;
    }

    .story-img {
        width: 80px;
        height: 80px;
    }

    .story-img img {
        max-width: 75%;
        max-height: 75%;
    }

    .story-name {
        font-size: 0.9rem;
    }
}

/* DESKTOP GRANDE */
@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: 3fr 1fr;
    }

    .stories {
        gap: 28px;
        padding: 5px 10px;
        justify-content: space-between; /* ← distribuye stories en todo el ancho */;
    }

    .story {
        min-width: 110px;
    }

    .story-img {
        width: 90px;
        height: 90px;
        border-width: 4px;
    }

    .story-img img {
        max-width: 80%;
        max-height: 80%;
    }

    .story-name {
        font-size: 0.95rem;
        margin-top: 8px;
        width: 100%;
        text-align: center;
    }
}

/* SI HAY POCAS EPS, CENTRARLAS */
.stories:has(.story:nth-child(1):nth-last-child(4)),
.stories:has(.story:nth-child(1):nth-last-child(3)),
.stories:has(.story:nth-child(1):nth-last-child(2)) {
    justify-content: center;
}

/* EFECTO ACTIVO */
.story.active .story-img {
    border-color: var(--accent);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.story.active .story-name {
    color: var(--accent);
    font-weight: 600;
}











	.feed {
	    display: grid;
	    grid-template-columns: 1fr;
	    gap: 16px;
	    padding: 12px;
	}


/* Contenedor principal tipo Instagram */
#posts-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 12px;
}

/* En pantallas medianas: 2 columnas */
@media (min-width: 768px) {
  #posts-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* En pantallas grandes: 3 columnas */
@media (min-width: 1024px) {
  #posts-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
  }
}

/* Tarjeta individual */
.post {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(0,0,0,0.05);
}

.post:hover {
  transform: translateY(-5px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* Encabezado del post */
.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.post-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Avatar ovalado vertical */
.post-user-img {
  width: 50px;
  height: 70px;
  border-radius: 30px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #003366;
  border: 2px solid #1DA1F2;
  color: white;
  font-weight: bold;
  font-size: 20px;
  flex-shrink: 0;
}

.post-user-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Información del usuario */
.post-user-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #333;
}

.post-user-info p {
  font-size: 0.85rem;
  color: #666;
  margin: 4px 0 0 0;
}

.verified-icon {
  color: #1DA1F2;
  margin-left: 4px;
  font-size: 0.9rem;
}

/* Botón de opciones */
.post-options {
  color: #999;
  cursor: pointer;
  padding: 5px;
  font-size: 1.2rem;
}

/* Contenido del post */
.post-content {
  padding: 20px;
}

.post-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #003366;
  line-height: 1.3;
}

.post-text {
  margin-bottom: 15px;
  color: #555;
  line-height: 1.5;
  font-size: 0.95rem;
}



/* Tags */

.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 15px 0;
}

.post-tag {
  background-color: #e8f4ff;
  color: #007aff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}




/* Detalles del trabajo */
.post-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 12px;
}

.post-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555;
  font-size: 0.9rem;
}

.post-detail i {
  color: #007aff;
  width: 16px;
}

/* Acciones del post */
.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-top: 1px solid #f0f0f0;
}

.post-action-left {
  display: flex;
  align-items: center;
  gap: 25px;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #666;
  transition: color 0.3s;
  padding: 10px 12px;
  border-radius: 8px;
}

.post-action:hover {
  background-color: #f5f5f5;
}

.post-action i {
  font-size: 24px;
}

/* Botón de postularse */
.apply-btn {
  background-color: #00a86b;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.apply-btn:hover {
  background-color: #00945c;
}

/* Redes sociales para compartir */
.share-networks {
  display: flex;
  gap: 10px;
  margin-top: 5px;
}

.share-networks a i {
  font-size: 20px;
  transition: transform 0.15s ease;
  cursor: pointer;
}

.share-networks a:hover i {
  transform: scale(1.1);
}

/* Animación de like */
@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

.like-btn i.animate {
  animation: pop 0.3s ease;
}

/* Estados de loading y sin resultados */
.loading-posts, .no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}




















/* Ocultar elementos denuncia*/
.hidden-complete {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  pointer-events: none !important;
}

/* Menú 3 puntos */
.post-options {
  position: relative;
}

/* Dropdown */
.menu-dropdown {
  position: absolute;
  right: 0;
  top: 25px;
  background: white;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  z-index: 20;
  min-width: 140px;
  border: 1px solid #e0e0e0;
  display: none;
}

.menu-dropdown:not(.hidden) {
  display: block;
}

.menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  border-radius: 6px;
}

.menu-dropdown button:hover {
  background: #f5f5f5;
}

/* Modal denuncia */
#reportModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

#reportModal:not(.hidden) {
  display: flex;
}

.modal-box {
  background: white;
  padding: 20px;
  border-radius: 12px;
  max-width: 400px;
  width: 100%;
}

.modal-box textarea {
  width: 100%;
  height: 100px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 10px 0;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 15px;
}

#sendReport {
  background: #ff3b30;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
}

#closeReport {
  background: #f0f0f0;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
}

/* Bloquear scroll */
body.modal-open {
  overflow: hidden;
}

/* Modal de éxito de denuncia */
.report-success-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.report-success-modal.show {
  display: flex;
}

.success-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  border-radius: 24px;
  padding: 40px 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

/* Efecto brillo sutil */
.success-modal-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(29, 161, 242, 0.1) 0%, transparent 70%);
  z-index: 0;
}

.success-icon {
  font-size: 80px;
  color: #10b981;
  margin-bottom: 20px;
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  z-index: 1;
  text-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.success-modal-content h3 {
  color: #10b981;
  font-size: 28px;
  margin-bottom: 10px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s ease 0.2s both;
}

.success-modal-content p {
  color: #4b5563;
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 25px;
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s ease 0.3s both;
}

.success-details {
  background: rgba(16, 185, 129, 0.08);
  border-radius: 12px;
  padding: 15px;
  margin: 20px 0;
  border-left: 4px solid #10b981;
  text-align: left;
  animation: slideUp 0.5s ease 0.4s both;
}

.success-details p {
  margin: 8px 0;
  color: #374151;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.success-details i {
  color: #10b981;
  width: 18px;
}

.success-close-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  position: relative;
  z-index: 1;
  animation: slideUp 0.5s ease 0.5s both;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
}

.success-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.success-close-btn:active {
  transform: translateY(0);
}

.success-close-btn i {
  font-size: 18px;
}

/* Confetti effect */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #10b981;
  top: 0;
  opacity: 0;
}

.confetti:nth-child(odd) {
  background: #3b82f6;
}
.confetti:nth-child(even) {
  background: #8b5cf6;
}
.confetti:nth-child(3n) {
  background: #ef4444;
}
.confetti:nth-child(5n) {
  background: #f59e0b;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { 
    opacity: 0; 
    transform: scale(0.8); 
  }
  to { 
    opacity: 1; 
    transform: scale(1); 
  }
}

@keyframes bounceIn {
  0% { 
    opacity: 0; 
    transform: scale(0.3); 
  }
  50% { 
    opacity: 1; 
    transform: scale(1.05); 
  }
  70% { 
    transform: scale(0.9); 
  }
  100% { 
    transform: scale(1); 
  }
}

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

@keyframes confettiRain {
  0% { 
    opacity: 0; 
    transform: translateY(-100px) rotate(0deg); 
  }
  10% { opacity: 1; }
  100% { 
    opacity: 0; 
    transform: translateY(500px) rotate(360deg); 
  }
}

/* Añadir esta clase cuando se envía la denuncia */
.celebrate .confetti {
  animation: confettiRain 5s ease-in-out forwards;
}

/* Responsive */
@media (max-width: 480px) {
  .success-modal-content {
    padding: 30px 20px;
    width: 95%;
  }
  
  .success-icon {
    font-size: 60px;
  }
  
  .success-modal-content h3 {
    font-size: 24px;
  }
  
  .success-close-btn {
    padding: 12px 24px;
    font-size: 15px;
  }
}













        /* Sidebar */
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 25px;
        }

        .sidebar-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            padding: 25px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
        }

        .sidebar-title {
            font-size: 1.2rem;
            font-weight: 700;
            margin-bottom: 20px;
            color: var(--primary-dark);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .sidebar-title i {
            color: var(--primary);
        }

        .trending-list, .suggested-list {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .trending-item, .suggested-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border);
        }

        .trending-item:last-child, .suggested-item:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .trending-number {
            font-weight: 700;
            font-size: 1.1rem;
            color: var(--primary);
        }

        .trending-info h4 {
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 3px;
        }

        .trending-info p {
            font-size: 0.85rem;
            color: var(--text-lighter);
        }

        .suggested-user {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
        }

        .suggested-user-img {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            overflow: hidden;
            background-color: var(--secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            color: var(--primary);
        }

        .suggested-user-img img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .suggested-user-info h4 {
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 3px;
        }

        .suggested-user-info p {
            font-size: 0.85rem;
            color: var(--text-lighter);
        }

        .follow-btn {
            background-color: transparent;
            color: var(--primary);
            border: 1px solid var(--primary);
            padding: 6px 15px;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .follow-btn:hover {
            background-color: var(--secondary);
        }













/* ============================
           FILTROS
============================ */

.feed-filters {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 250px;
}

.filter-select {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-select select {
    width: 100%;
    padding: 12px 32px 12px 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select select:hover {
    border-color: #94a3b8;
}

.filter-select select:focus {
    outline: none;
    border-color: #1DA1F2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.filter-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

.chevron-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #64748b;
    pointer-events: none;
}

.search-container input {
    width: 100%;
    padding: 12px 44px 12px 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    background: white;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-container input::placeholder {
    color: #94a3b8;
}

.search-container input:hover {
    border-color: #94a3b8;
}

.search-container input:focus {
    outline: none;
    border-color: #1DA1F2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    display: none;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    align-items: center;
    justify-content: center;
}

.clear-search:hover {
    color: #64748b;
    background: #f1f5f9;
}

.clear-search svg {
    width: 16px;
    height: 16px;
    display: block;
}

.search-container input:not(:placeholder-shown) ~ .clear-search {
    display: flex;
}

/* Responsive */
@media (max-width: 768px) {
    .feed-filters {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-select select,
    .search-container input {
        padding: 10px 32px 10px 38px;
        font-size: 13px;
    }

    .filter-icon,
    .search-icon {
        left: 12px;
        width: 16px;
        height: 16px;
    }

    .chevron-icon {
        right: 12px;
        width: 14px;
        height: 14px;
    }
    
    .clear-search svg {
        width: 14px;
        height: 14px;
    }
}

/* Estados activos */
.filter-select.active select {
    border-color: #1DA1F2;
}

.search-container.active input {
    border-color: #1DA1F2;
}






















        /* Footer */
        footer {
            background-color: var(--bg-white);
            border-top: 1px solid var(--border);
            padding: 30px 0;
            margin-top: 40px;
        }

        .footer-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .footer-logo {
            font-size: 1.8rem;
            font-weight: 700;
            color: var(--primary);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .footer-links {
            display: flex;
            gap: 25px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .footer-links a {
            color: var(--text-light);
            transition: color 0.3s;
        }

        .footer-links a:hover {
            color: var(--primary);
        }

        .copyright {
            color: var(--text-lighter);
            font-size: 0.9rem;
            text-align: center;
        }

        /* Responsive */
        @media (max-width: 992px) {
            .main-content {
                grid-template-columns: 1fr;
            }
            
            .sidebar {
                order: -1;
            }
        }

 













/* ============================
   MODAL RESPONSIVO POSTULACIONES  GLOBAL
============================ */


.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 16px;
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;

  overflow: visible;
}

.modal.active {
  display: flex;
}

/* Contenedor principal del modal */

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 560px;
  border-radius: 40px 40px 20px 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  animation: modalFadeIn .3s ease;
  height: calc(90dvh - 20px);
  display: flex;
  flex-direction: column;

  /* 🔧 CAMBIO IMPORTANTE */
  overflow: visible;

  position: relative;
  margin: auto;

  z-index: 1;
}





/* Dropdown tipo burbuja */
.iti__country-list {
  position: fixed !important;          /* clave para aparecer sobre todo */;
  z-index: 999999999 !important;       /* siempre delante */;
  max-height: 280px !important;        /* límite de altura */;
  overflow-y: auto !important;         /* scroll si hay muchos países */;
  -webkit-overflow-scrolling: touch !important;

  /* ✅ Estilo burbuja */
  background: #fff !important;
  border-radius: 16px !important;      /* bordes redondeados */;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;  /* sombra suave */;
  padding: 4px 0 !important;           /* espacio interno */;
  border: 1px solid rgba(0,0,0,0.1) !important;

  /* Mantener scroll interno sin afectar tamaño */
  box-sizing: border-box !important;
}





/* Header del modal - fijo arriba */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 2px solid #f1f5f9;
  background: white;
  border-radius: 40px 40px 0 0;
  flex-shrink: 0; /* Evita que se contraiga */;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

.close-modal {
  font-size: 28px;
  cursor: pointer;
  color: #64748b;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  background: none;
  border: none;
}

.close-modal:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Área de scroll - SOLO ESTO HACE SCROLL */
.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0; /* Reset padding */;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Formulario - con padding consistente */
#applicationForm {
  padding: 24px;
}

/* Grupos de formulario */
.form-group {
  margin-bottom: 24px; /* Aumentado de 20px a 24px */;
}

.form-group:last-of-type {
  margin-bottom: 0; /* El último no necesita margen inferior */;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px; /* Aumentado de 6px a 8px */;
  letter-spacing: 0.3px;
}

/* Inputs, selects y textareas */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px; /* Aumentado padding vertical */;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px; /* Ligeramente más redondeado */;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2a7de1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* ============================
   CHECKBOXES MEJOR ALINEADOS
============================ */

.options-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
  padding: 20px; /* Aumentado de 16px a 20px */;
  border-radius: 18px; /* Más redondeado */;
  margin-top: 8px; /* Espacio con el label superior */;
  border: 1px solid #eef2f6; /* Sutil borde */;
}



.checkbox-label {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important; /* Aumentado de 12px a 14px */;
  margin: 0 !important;
  cursor: pointer;
  width: 100%;
  padding: 4px 0;
}

.checkbox-label span {
  flex: 1;
  color: #1e293b;
  font-size: 0.95rem;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  width: 20px; /* Ligeramente más grande */;
  height: 20px;
  margin: 0 !important;
  flex-shrink: 0;
}

/* Fallback para navegadores antiguos */
.checkbox-label input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 22px; /* Aumentado */;
  height: 22px; /* Aumentado */;
  border: 2px solid #cbd5e1;
  border-radius: 7px; /* Más redondeado */;
  background: white;
  transition: all 0.2s ease;
  position: relative;
}

.checkbox-label input[type="checkbox"]:checked {
  background-color: #2a7de1;
  border-color: #2a7de1;
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 15px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ============================
   BOTÓN SUBIR PDF MEJORADO
============================ */

/* Contenedor del botón y nombre del archivo */
.form-group:has(.btn-upload) {
  margin-bottom: 0; /* El padding del modal-actions dará el espacio */;
}

.btn-upload {
  width: 100%;
  padding: 14px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  font-size: 1rem;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px; /* Espacio con el nombre del archivo */;
}

.btn-upload:hover {
  border-color: #2a7de1;
  background: #f1f5f9;
  color: #2a7de1;
}

/* Indicador de archivo PDF */
#pdfFileName {
  display: inline-block;
  padding: 10px 16px; /* Aumentado padding */;
  background: #f1f5f9;
  border-radius: 40px; /* Más redondeado */;
  font-size: 0.9rem;
  color: #0f172a;
  font-style: normal !important;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid #e2e8f0;
  font-weight: 500; /* Un poco más de peso */;
}

/* ============================
   BOTONES DE ACCIÓN - MEJOR POSICIONADOS
============================ */

.modal-actions {
  display: flex;
  gap: 12px;
  padding: 20px 24px 24px; /* Padding superior e inferior mejorado */;
  background: white;
  border-top: 2px solid #f1f5f9;
  flex-shrink: 0; /* Evita que se contraiga */;
  margin-top: auto; /* Empuja hacia abajo */;
}

.btn-cancel,
.btn-submit {
  flex: 1;
  padding: 14px 20px;
  border-radius: 16px; /* Más redondeado */;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-align: center;
}

.btn-cancel {
  background: #f1f5f9;
  color: #475569;
}

.btn-cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-submit {
  background: #2a7de1;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.btn-submit:hover {
  background: #1e5bbf;
  transform: translateY(-2px); /* Más elevación */;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* ============================
   MODAL DE PDF - CENTRADO CORRECTAMENTE
============================ */

#pdfModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
}

#pdfModal .pdf-modal-content {
  background: white;
  width: 100%;
  max-width: 900px;
  border-radius: 28px; /* Más redondeado */;
  position: relative;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  animation: modalZoom 0.3s ease;
  max-height: 85vh;
  transform: translateY(0);
}

.close-pdf-modal {
  position: absolute;
  top: 16px; /* Aumentado de 12px a 16px */;
  right: 16px; /* Aumentado de 12px a 16px */;
  width: 42px; /* Ligeramente más grande */;
  height: 42px;
  border-radius: 50%;
  background: white;
  border: none;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform; /* Sombra más pronunciada */;
  z-index: 10;
  transition: all 0.2s ease;
  line-height: 1;
}

.close-pdf-modal:hover {
  background: #f1f5f9;
  color: #0f172a;
  transform: rotate(90deg) scale(1.05);
}

.pdf-iframe {
  width: 100%;
  height: 70vh;
  min-height: 500px;
  border: none;
  display: block;
}

/* ============================
   SCROLLBAR PERSONALIZADA
============================ */

.modal-body::-webkit-scrollbar {
  width: 8px; /* Un poco más ancha */;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
  margin: 10px 0; /* Margen para no tocar bordes */;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid #f1f5f9; /* Efecto de padding */;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================
   ANIMACIONES
============================ */

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(20px);
  }
}

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

/* ============================
   MEDIA QUERIES - MÓVIL
============================ */

@media (max-width: 640px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    border-radius: 40px 40px 0 0;
    max-height: calc(92dvh - 20px);
    animation: slideUp 0.3s ease;
    transform: translateY(0);
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .modal-header {
    padding: 16px 20px;
    border-radius: 40px 40px 0 0;
  }

  .modal-header h2 {
    font-size: 1.2rem;
  }

  #applicationForm {
    padding: 20px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .options-group {
    padding: 16px;
    gap: 12px;
  }

  .checkbox-label {
    gap: 12px !important;
  }

  .btn-upload {
    padding: 14px;
    margin-bottom: 10px;
  }

  .modal-actions {
    padding: 16px 20px 20px;
    gap: 10px;
  }

  .btn-cancel,
  .btn-submit {
    padding: 16px;
    border-radius: 14px;
  }


  /* Modal PDF en móvil */


#pdfModal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: -10px;   /* controla qué tan abajo aparece */;

  padding: 12px;
  padding-bottom: 1px;

  z-index: 999999;
  align-items: flex-end;
}


#pdfModal .pdf-modal-content {
  border-radius: 24px 24px 0 0;
  max-height: 90vh;

  transform: translateY(90px); /* baja el modal */;
}


  .close-pdf-modal {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .pdf-iframe {
    height: 75vh;
    min-height: auto;
  }
 }



@media (max-width: 380px) {
  .modal-header {
    padding: 14px 16px;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  #applicationForm {
    padding: 16px;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .options-group {
    padding: 14px;
  }

  .btn-upload {
    padding: 12px;
  }

  .modal-actions {
    padding: 14px 16px 18px;
    flex-direction: column; /* Botones en columna en pantallas muy pequeñas */;
  }

  .btn-cancel,
  .btn-submit {
    width: 100%;
    padding: 14px;
  }
}

/* ============================
   SOPORTE PARA NOTCH
============================ */

@supports (padding: max(0px)) {
  .modal-content {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .modal-actions {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  #pdfModal .pdf-modal-content {
    margin-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================
   UTILIDADES
============================ */

::placeholder {
  color: #94a3b8;
  opacity: 1;
}















/* ==========================
   ALERTA PERSONALIZADA
========================== */
.custom-alert {
  position: fixed;         /* Siempre visible */;
  top: 20px;               /* Desde arriba */;
  left: 50%;               /* Centrado horizontal */;
  transform: translateX(-50%);
  background-color: #f87171; /* Rojo suave tipo error */;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 999999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  opacity: 0;             /* Inicialmente invisible */;
  pointer-events: none;   /* No bloquea clicks */;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Animación de entrada */
.custom-alert.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Animación de salida */
.custom-alert.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}


















/* ===== MODAL PERFIL COMPACTO ===== */










/* ============================================
   MODAL DE PERFIL MÓVIL (SHEET) - VERSIÓN OPTIMIZADA
   Scroll interno fluido, sin desbordamiento del fondo
============================================ */

/* ============================================
   VARIABLES DE ESTILO
============================================ */
:root {
  /* Colores base */
  --profile-text: #333;
  --profile-text-light: #666;
  --profile-border: rgba(0, 0, 0, 0.08);
  --profile-bg: #fff;
  --profile-blue: #405DE6;
  --profile-primary: #2563eb;
  --ios-backdrop: rgba(0, 0, 0, 0.5);

  /* Avatar */
  --avatar-bg: #2a7de1;
  --avatar-bg-dark: #1e5bb8;

  /* Sombras */
  --profile-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);

  /* Bordes */
  --ios-radius-large: 20px;

  /* Animaciones */
  --ios-animation-timing: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ios-animation-timing-open: cubic-bezier(0.28, 0.11, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --profile-text: #ffffff;
    --profile-text-light: #a0a0a0;
    --profile-border: rgba(255, 255, 255, 0.1);
    --profile-bg: #1a1a1a;
    --profile-blue: #6c8eff;
  }
}

/* ============================================
   CONTENEDOR PRINCIPAL DEL MODAL
============================================ */
.profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px; /* Respeta el nav inferior */;
  background-color: transparent;
  z-index: 10000;
  opacity: 0;
  
  display: flex;
  align-items: flex-end;
  justify-content: center;
  will-change: opacity, background-color;
 
  

  pointer-events: none;
}

.profile-modal.active {
  opacity: 1;
 
  pointer-events: auto;
 
}

/* ============================================
   BACKDROP (con efecto frosted glass)
============================================ */
.profile-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px;
  z-index: 1;
  background-color: transparent;
  transition: background-color 0.3s var(--ios-animation-timing);
  cursor: pointer;
  /* Frosted glass */
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
}

.profile-modal.active .profile-modal-backdrop {
  background-color: var(--ios-backdrop);
  animation: backdropFadeIn 0.3s var(--ios-animation-timing) forwards;
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
}

.profile-modal:not(.active) .profile-modal-backdrop {
  animation: backdropFadeOut 0.25s var(--ios-animation-timing) forwards;
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
}

/* ============================================
   CONTENIDO DEL MODAL (tarjeta deslizante)
============================================ */
.profile-modal-content {
  width: 100%;
  height: 80vh;
  box-sizing: border-box;
  max-width: 440px;
  background: var(--profile-bg);
  border-radius: var(--ios-radius-large) var(--ios-radius-large) 0 0;
  padding: 16px 16px 24px;
  transform: translateY(100%);
  transition: transform 0.45s var(--ios-animation-timing-open),;
              opacity 0.2s var(--ios-animation-timing);
  will-change: transform;
  overflow: hidden;           /* Importante: el scroll va en un contenedor interno */;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  opacity: 1;
}

.profile-modal.active .profile-modal-content {
  transform: translateY(0);
}

.profile-modal-content.dragging {
  transition: none !important;
}

.profile-modal-content.closing {
  transform: translateY(0);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s var(--ios-animation-timing);
}

/* ============================================
   CONTENEDOR SCROLLABLE INTERNO
   (Aquí es donde se desplaza el contenido)
============================================ */
.profile-scroll-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Evita que al llegar al borde se desplace el fondo */
  overscroll-behavior: contain;
  /* Mejora el desplazamiento táctil */
  touch-action: pan-y;
  /* Reserva espacio para la barra de scroll evitando saltos */
  scrollbar-gutter: stable;
  padding-top: 24px;
  scrollbar-width: none;      /* Oculta scrollbar en Firefox */;
  -ms-overflow-style: none;    /* Oculta scrollbar en IE/Edge */;
  flex: 1;
  min-height: 0;               /* Necesario para flex child con overflow */;
}

.profile-scroll-content::-webkit-scrollbar {
  display: none;               /* Oculta scrollbar en Chrome/Safari */;
}

/* ============================================
   DRAG HANDLE (para cerrar arrastrando)
============================================ */
.profile-drag-handle {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 60px;
  z-index: 10;
  cursor: grab;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 15px;
  touch-action: pan-y;         /* Evita que el gesto de arrastre compita con el scroll */;
  -webkit-tap-highlight-color: transparent;
  user-select: none;           /* Evita selección de texto al arrastrar */;
}

.profile-drag-handle::before {
  content: '';
  width: 36px;
  height: 5px;
  background: rgba(150, 150, 150, 0.8);
  border-radius: 3px;
  transition: all 0.2s ease;
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
}

@media (hover: hover) {
  .profile-drag-handle:hover::before {
    background: rgba(100, 100, 100, 1);
    width: 40px;
  }
}

.profile-drag-handle.active {
  cursor: grabbing;
}

.profile-drag-handle.active::before {
  background: var(--profile-blue);
  width: 45px;
  height: 6px;
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .profile-drag-handle {
    width: 140px;
    height: 70px;
    top: -25px;
  }
}

/* ============================================
   BOTONES SUPERIORES (cerrar/compartir)
============================================ */
.profile-top-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.btn-share,
.profile-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--profile-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--profile-text);
  font-size: 1.1rem;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
}

.profile-close {
  font-size: 1.8rem;
  font-weight: 300;
}

.btn-share:hover,
.profile-close:hover {
  background: #fff;
  transform: scale(1.05);
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
}

.btn-share:active {
  transform: scale(0.95);
}

/* ============================================
   HEADER CON AVATAR (se oculta al hacer scroll en móvil)
============================================ */
.profile-header {
  text-align: center;
  margin: 40px 0 20px;
  padding: 0 8px;
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: opacity, transform;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-header.scrolled {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
  width: 120px;
  height: 120px;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--profile-bg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  background: var(--profile-primary);
}

.avatar-loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.avatar-initials {
  opacity: 1;
  background: linear-gradient(45deg, var(--avatar-bg), var(--avatar-bg-dark));
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.avatar-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: var(--profile-primary);
  border: 3px solid var(--profile-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: white;
  font-size: 0.9rem;
}

.avatar-edit-btn:hover {
  transform: scale(1.1);
}

/* ============================================
   NOMBRE CON BADGE VERIFICADO
============================================ */
.profile-name-container {
  margin-bottom: 16px;
}

.profile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--profile-text);
}

.verified-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #1da1f2;
  border-radius: 50%;
  color: white;
}

.verified-badge svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   ESTADÍSTICAS COMPACTAS
============================================ */
.profile-stats-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.stat-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--profile-text);
  margin-bottom: 2px;
}

.stat-label-btn {
  background: none;
  border: none;
  color: var(--profile-blue);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.stat-label-btn:hover {
  background: rgba(64, 93, 230, 0.1);
}

.stat-divider {
  width: 1px;
  height: 30px;
  background: #e0e0e0;
}

/* ============================================
   BIOGRAFÍA COMPACTA
============================================ */
.bio-container {
  position: relative;
  margin: 0 auto 16px;
  max-width: 380px;
}

.profile-bio {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--profile-border);
  font-size: 0.85rem;
  resize: none;
  min-height: 70px;
  background: #fafafa;
  line-height: 1.4;
  font-family: inherit;
  color: #333;
}

.profile-bio:focus {
  outline: none;
  border-color: var(--profile-blue);
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  color: #333;
}

.bio-counter {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 0.75rem;
  color: var(--profile-text-light);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 3px;
  backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
}

/* ============================================
   REDES SOCIALES COMPACTAS
============================================ */
.profile-socials {
  margin: 16px 0;
  padding: 0 4px;
}

.social-input {
  display: flex;
  align-items: center;
  background: #fafafa;
  border-radius: 10px;
  border: 1px solid var(--profile-border);
  margin-bottom: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.social-input:focus-within {
  border-color: var(--profile-blue);
  background: white;
}

.social-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-width: 90px;
  background: rgba(64, 93, 230, 0.05);
  border-right: 1px solid var(--profile-border);
  color: var(--profile-text);
  font-weight: 500;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.social-label i,
.social-label svg {
  width: 14px;
  height: 14px;
}

.x-icon {
  fill: #000;
}

.social-input input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.85rem;
  color: var(--profile-text);
}

.social-input input::placeholder {
  color: #999;
  font-size: 0.85rem;
}

.btn-add-social {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px dashed var(--profile-border);
  border-radius: 10px;
  color: var(--profile-blue);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-add-social:hover {
  border-color: var(--profile-blue);
  background: rgba(64, 93, 230, 0.05);
}

/* ============================================
   ACCIONES FIJAS EN LA PARTE INFERIOR (sticky)
============================================ */
.profile-actions {
  position: sticky;
  bottom: 0;
  background: var(--profile-bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
  /* Sombra sutil para separar del contenido */
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.btn-follow,
.btn-save-profile,
.btn-logout-profile {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: none;
}

.btn-follow {
  background: linear-gradient(45deg, #2563eb, #3b82f6);
  color: white;
}

.btn-follow:hover:not([data-state="loading"]) {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.btn-follow[data-state="loading"] {
  opacity: 0.8;
  cursor: not-allowed;
}

.btn-save-profile {
  background: linear-gradient(45deg, #10b981, #059669);
  color: white;
}

.btn-save-profile:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.btn-logout-profile {
  background: #1f2937;
  border: 1px solid #ef4444;
  color: #ef4444;
}

.btn-logout-profile:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: #ef4444;
}

/* ============================================
   FOOTER COMPACTO (mensajes de estado)
============================================ */
.profile-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--profile-border);
}

.profile-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 184, 148, 0.1);
  color: #00b894;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  animation: profileFadeIn 0.3s ease;
}

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

/* ============================================
   VERSIÓN ESCRITORIO (pantallas ≥768px)
============================================ */
@media (min-width: 768px) {
  .profile-modal {
    bottom: 0;
    align-items: center;
    justify-content: center;
    backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
  }

  .profile-modal-backdrop {
    bottom: 0;
    background-color: var(--ios-backdrop);
    backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
    transform: translateZ(0);
    will-change: transform;
  }

  .profile-modal-content {
    height: auto;
    max-height: 85vh;
    max-width: 440px;
    border-radius: var(--ios-radius-large);
    margin: 0 auto;
    position: relative;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.4s var(--ios-animation-timing-open),;
                opacity 0.4s var(--ios-animation-timing-open);
    padding: 24px;
  }

  .profile-modal.active .profile-modal-content {
    transform: scale(1);
    opacity: 1;
  }

  .profile-modal-content.closing {
    transform: scale(1);
    opacity: 0;
  }

  .profile-modal-content.dragging {
    transform: translateY(var(--drag-translate, 0)) scale(1);
  }

  /* En escritorio el header no se oculta al hacer scroll */
  .profile-header.scrolled {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .profile-top-actions {
    top: 20px;
    right: 20px;
  }
}

/* ============================================
   AJUSTES MÓVIL COMPACTOS (≤767px)
============================================ */
@media (max-width: 767px) {
  .profile-modal-content {
    height: calc(80vh - 60px);
    max-height: calc(80vh - 60px);
    padding-bottom: 20px;
  }

  .profile-scroll-content {
    padding-top: 16px;
  }

  .avatar-wrapper {
    width: 90px;
    height: 90px;
    margin-bottom: 12px;
  }

  .avatar-edit-btn {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .profile-name {
    font-size: 1.4rem;
  }

  .verified-badge {
    width: 18px;
    height: 18px;
  }

  .verified-badge svg {
    width: 10px;
    height: 10px;
  }

  .profile-stats-container {
    gap: 16px;
    margin-bottom: 12px;
  }

  .stat-number {
    font-size: 1.1rem;
  }

  .stat-label-btn {
    font-size: 0.75rem;
  }

  .bio-container {
    margin-bottom: 12px;
  }

  .profile-bio {
    font-size: 0.75rem;
    min-height: 55px;
    padding: 10px 12px;
  }

  .bio-counter {
    font-size: 0.65rem;
    bottom: 5px;
    right: 6px;
  }

  .profile-socials {
    margin: 12px 0;
  }

  .social-label {
    min-width: 75px;
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .social-input input {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .btn-add-social {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .profile-actions {
    padding: 12px 16px;
  }

  .btn-follow,
  .btn-save-profile,
  .btn-logout-profile {
    padding: 10px 14px;
    font-size: 0.8rem;
  }

  .profile-footer {
    margin-top: 12px;
    padding-top: 12px;
  }
}

/* ============================================
   MODO OSCURO
============================================ */
@media (prefers-color-scheme: dark) {
  .profile-modal.active .profile-modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
  }

  .btn-share,
  .profile-close {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .profile-avatar-img {
    border-color: #2d2d2d;
  }

  .profile-bio {
    background: #2d2d2d;
    color: #fff;
  }

  .profile-bio:focus {
    background: #3d3d3d;
    color: #fff;
  }

  .profile-bio::placeholder {
    color: #aaa;
  }

  .social-input {
    background: #2d2d2d;
    border-color: rgba(255, 255, 255, 0.1);
  }

  .social-input:focus-within {
    background: #2d2d2d;
    border-color: var(--profile-blue);
  }

  .social-label {
    background: rgba(108, 142, 255, 0.12);
    border-right-color: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .social-input input {
    color: #fff;
  }

  .social-input input::placeholder {
    color: #aaa;
  }

  .x-icon {
    fill: #fff;
  }

  .stat-label-btn {
    color: var(--profile-blue);
  }

  .stat-label-btn:hover {
    background: rgba(108, 142, 255, 0.15);
  }

  .btn-follow {
    background: linear-gradient(45deg, #6c8eff, #b399ff);
  }

  .btn-logout-profile {
    background: #2d2d2d;
  }

  .profile-drag-handle::before {
    background: #666;
  }

  .profile-drag-handle:hover::before {
    background: #888;
  }

  .profile-drag-handle.active::before {
    background: var(--profile-blue);
  }

  .stat-divider {
    background: rgba(255, 255, 255, 0.1);
  }

  .bio-counter {
    background: rgba(30, 30, 30, 0.9);
  }
}

/* ============================================
   ACCESIBILIDAD
============================================ */
.btn-follow:focus-visible,
.btn-save-profile:focus-visible,
.btn-logout-profile:focus-visible,
.profile-close:focus-visible,
.btn-share:focus-visible {
  outline: 2px solid var(--profile-blue);
  outline-offset: 2px;
}

/* ============================================
   COMPATIBILIDAD CON NAVEGADORES
============================================ */

/* Safari/WebKit - backdrop-filter */
@supports (-webkit-touch-callout: none) {
  .profile-modal-backdrop {
    transform: translateZ(0);
    will-change: transform;
    backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform;
  }
}

/* Firefox - corrección de background */
@-moz-document url-prefix() {
  .profile-modal-content {
    background: var(--profile-bg) !important;
  }
}

/* Fallback para navegadores sin backdrop-filter */
    transform: translateZ(0);
    will-change: transform) or (backdrop-filter: none;
    transform: translateZ(0);
    will-change: transform)) {
  .profile-modal-backdrop {
    background: rgba(0, 0, 0, 0.7) !important;
  }

  .profile-modal-content {
    background: var(--profile-bg) !important;
    border: 1px solid var(--profile-border);
  }
}

/* ============================================
   UTILIDADES Y RESET
============================================ */
button,
.btn-share,
.profile-close {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.profile-bio {
  -webkit-user-select: auto;
  user-select: auto;
}

/* Optimización de rendimiento */
.profile-modal-content,
.profile-modal-backdrop {
  contain: layout style paint;
}

/* Retina */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .profile-drag-handle::before {
    height: 4.5px;
  }
}































/*MODAL SEGUIDORES*/

.followers-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 15000;
}

.followers-content {
  background: #fff;
  width: 92%;
  max-width: 420px;
  max-height: 70vh;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.followers-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.followers-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
}

.followers-list {
  padding: 10px;
  overflow-y: auto;
}

/* Item */
.follower-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
}

.follower-item:hover {
  background: #f5f5f5;
}

.follower-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}









/* MODAL SEGUIDOS - ENCAPSULADO COMPLETO (PASO 1) */
#followingModal.following-modal {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.55) !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 15000 !important;
  /* Reset agresivo para evitar CSS global */
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: visible !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100vw !important;
  height: 100vh !important;
  box-sizing: border-box !important;
}

#followingModal.following-modal .following-content {
  background: #fff !important;
  width: 92% !important;
  max-width: 420px !important;
  max-height: 70vh !important;
  border-radius: 18px !important;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  /* Reset agresivo */
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  position: relative !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#followingModal.following-modal .following-header {
  padding: 14px 16px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 1px solid #eee !important;
  flex-shrink: 0 !important;
  /* Reset */
  margin: 0 !important;
  background: transparent !important;
  position: relative !important;
  min-height: 50px !important;
}

#followingModal.following-modal .following-close {
  background: none !important;
  border: none !important;
  font-size: 1.6rem !important;
  cursor: pointer !important;
  color: #777 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  display: inline-block !important;
}

/* LISTA ENCAPSULADA - CON ALTURA GARANTIZADA */
#followingModal.following-modal #followingList.following-list {
  padding: 10px !important;
  overflow-y: auto !important;
  min-height: 200px !important;
  height: auto !important;
  display: block !important;
  /* Reset completo y forzado */
  flex: unset !important;
  position: static !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: white !important;
  border: none !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  /* Garantizar que sea visible */
  max-height: 60vh !important;
}

/* ITEMS ENCAPSULADOS - VISIBLES POR DEFECTO */
#followingModal.following-modal #followingList.following-list .following-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  min-height: 60px !important;
  box-sizing: border-box !important;
  margin-bottom: 5px !important;
  /* Reset y forzar visibilidad */
  position: relative !important;
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  transition: background 0.2s !important;
  visibility: visible !important;
  opacity: 1 !important;
  /* Evitar colapso */
  flex-shrink: 0 !important;
}

#followingModal.following-modal #followingList.following-list .following-item:hover {
  background: #f5f5f5 !important;
}

/* ELEMENTOS INTERNOS - FORZADOS */
#followingModal.following-modal #followingList.following-list .following-item .following-avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid #28a745 !important;
  flex-shrink: 0 !important;
  display: block !important;
}

#followingModal.following-modal #followingList.following-list .following-item .following-info {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden;
  display: block !important;
  position: relative !important;
}

#followingModal.following-modal #followingList.following-list .following-item .following-info .following-name {
  font-weight: 600 !important;
  font-size: 14px !important;
  color: #333 !important;
  margin-bottom: 2px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis !important;
  display: block !important;
  line-height: 1.2 !important;
}

#followingModal.following-modal #followingList.following-list .following-item .following-info .following-username {
  font-size: 12px !important;
  color: #666 !important;
  margin-bottom: 4px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis !important;
  display: block !important;
  line-height: 1.2 !important;
}

#followingModal.following-modal #followingList.following-list .following-item .following-btn {
  background: #28a745 !important;
  color: white !important;
  border: none !important;
  padding: 6px 12px !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  transition: background 0.2s !important;
  display: inline-block !important;
  line-height: 1 !important;
}

#followingModal.following-modal #followingList.following-list .following-item .following-btn:hover {
  background: #218838 !important;
}

/* BORDES DE DEBUG - QUITAR CUANDO FUNCIONE */
#followingModal.following-modal {
  border: 4px solid blue !important;
}

#followingModal.following-modal .following-content {
  border: 3px solid green !important;
}

#followingModal.following-modal #followingList.following-list {
  border: 2px solid red !important;
  background: #f0f8ff !important; /* Fondo azul claro para ver área */;
}

#followingModal.following-modal #followingList.following-list .following-item {
  border: 1px solid orange !important;
  background: #fffaf0 !important; /* Fondo claro para items */;
}

/* REGLA NUCLEAR PARA BLOQUEAR CSS GLOBAL */
#followingModal.following-modal * {
  display: unset !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  width: auto !important;
  min-width: auto !important;
  max-width: none !important;
  position: static !important;
  float: none !important;
  clear: none !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* LUEGO APLICAMOS NUESTROS ESTILOS ESPECÍFICOS ENCIMA */
#followingModal.following-modal {
  display: none !important; /* El JS lo cambiará a flex */;
}
#followingModal.following-modal .following-content {
  display: flex !important;
}
#followingModal.following-modal #followingList.following-list {
  display: block !important;
}
#followingModal.following-modal #followingList.following-list .following-item {
  display: flex !important;
}









/*BOTONES DE LOGOUT Y GUARDAR*/

#saveProfileBtn.has-changes {
  background-color: #007bff;
  color: white;
}

#saveProfileBtn.saved {
  background-color: #28a745;
  color: white;
}

#saveProfileBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



































.charly-note {
    background-color: #2a7de1; /* azul llamativo */;
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 250px;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

.charly-note strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}










/* =============================
   BOTÓN FLOTANTE PUBLICAR
============================= */
#publishBtn {
  position: fixed;
  bottom: 100px;
  right: 20px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  z-index: 1000;
  transition: transform 0.2s ease;
}

#publishBtn:hover {
  transform: scale(1.05);
}

/* =============================
   MODAL PRINCIPAL
============================= */
.modal-overlay {
  position: fixed;
  top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  max-height: 90vh;
  overflow-y: auto;
}

/* =============================
   FORMULARIO CREAR POSTS
============================= */
#createPostSection {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#createPostSection input,
#createPostSection textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  box-sizing: border-box;
}

#createPostSection button {
  padding: 12px;
  border: none;
  border-radius: 6px;
  background-color: #28a745;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s ease;
}

#createPostSection button:hover {
  background-color: #218838;
}

/* =============================
   BOTÓN CERRAR
============================= */
.btn-cerrar {
  margin-top: 15px;
  padding: 10px;
  background: #dc3545;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-cerrar:hover {
  background: #c82333;
}

/* =============================
   RESPONSIVE
============================= */
@media (max-width: 600px) {
  .modal-content {
    width: 95%;
    padding: 15px;
  }

  #publishBtn {
    bottom: 60px;
    right: 15px;
    padding: 10px 20px;
    font-size: 14px;
  }

  #createPostSection input,
  #createPostSection textarea {
    font-size: 13px;
    padding: 8px;
  }

  #createPostSection button,
  .btn-cerrar {
    font-size: 14px;
    padding: 10px;
  }
}























/* ============================================
   🔍 SEARCH SYSTEM - iPhone Style
   Sistema de búsqueda estilo iOS
============================================ */

/* --------------------------------------------
   📱 VARIABLES DE DISEÑO iOS
-------------------------------------------- */
:root {
  /* 🎨 Colores iOS */
  --ios-primary: #007AFF;
  --ios-primary-active: #0056CC;
  --ios-secondary: #5856D6;
  --ios-success: #34C759;
  --ios-warning: #FF9500;
  --ios-surface: #F2F2F7;
  --ios-surface-elevated: #FFFFFF;
  --ios-label-primary: #000000;
  --ios-label-secondary: #8E8E93;
  --ios-label-tertiary: #C7C7CC;
  --ios-separator: #C6C6C8;
  --ios-backdrop: rgba(0, 0, 0, 0.4);
  --ios-handle: #C7C7CC;

  /* Dark mode */
  --ios-handle-dark: #48484A;

  /* 📐 Bordes y sombras */
  --ios-radius: 12px;
  --ios-radius-small: 10px;
  --ios-radius-large: 22px;
  --ios-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --ios-shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* ✨ Efectos y animaciones */
  --ios-blur: none;
  --ios-animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
  --ios-animation-timing-smooth: cubic-bezier(0.2, 0, 0, 1);
  --ios-animation-timing-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ios-animation-timing-drag: cubic-bezier(0.32, 0.72, 0, 1);
  --ios-animation-timing-open: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ios-animation-timing-close: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------
   🎬 ANIMACIONES GLOBALES
-------------------------------------------- */
@keyframes slideUpFromBottom {
  0% { transform: translateY(100%); }
  70% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

@keyframes slideDownToBottom {
  0% { transform: translateY(0); }
  30% { transform: translateY(-15px); }
  100% { transform: translateY(100%); }
}

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

@keyframes pulseScale {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes fadeInBackdrop { 
  from { opacity: 0; } 
  to { opacity: 1; } 
}

@keyframes fadeOutBackdrop { 
  from { opacity: 1; } 
  to { opacity: 0; } 
}

@keyframes spin { 
  to { transform: rotate(360deg); } 
}

@keyframes backdropFadeIn { 
  from { background-color: transparent; } 
  to { background-color: var(--ios-backdrop); } 
}

@keyframes backdropFadeOut { 
  from { background-color: var(--ios-backdrop); } 
  to { background-color: transparent; } 
}

/* 🎯 Animaciones del drag handle */
@keyframes gentle-expand {
  0% { width: 48px; opacity: 0.8; }
  100% { width: 64px; opacity: 1; }
}

@keyframes pulse-expand {
  0% { width: 48px; }
  70% { width: 76px; }
  100% { width: 72px; }
}

@keyframes pulse-glow {
  0% { 
    transform: translateZ(0);
    will-change: transform; }
  10% { box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform; }
  10% { box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform; }
}

@keyframes success-expand {
  0%, 100% { width: 48px; }
  30% { width: 12px; opacity: 0.7; }
  60% { width: 80px; opacity: 1; }
  80% { width: 48px; }
}

/* --------------------------------------------
   🖥️ BÚSQUEDA DESKTOP
-------------------------------------------- */
.nav-search {
  position: relative;
  width: 280px;
  margin-left: 20px;
  z-index: 200;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ios-label-tertiary);
  font-size: 15px;
  z-index: 2;
}

#userSearchInput {
  width: 100%;
  padding: 14px 42px 14px 40px;
  background: var(--ios-surface);
  border: none;
  border-radius: var(--ios-radius-large);
  color: var(--ios-label-primary);
  font-size: 17px;
  font-weight: 400;
  transition: all 0.2s var(--ios-animation-timing);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  letter-spacing: -0.41px;
}

#userSearchInput:focus {
  outline: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  background: var(--ios-surface-elevated);
  transform: scale(1.02);
}

#userSearchInput::placeholder {
  color: var(--ios-label-tertiary);
  font-weight: 400;
}

/* --------------------------------------------
   ❌ BOTÓN CERRAR
-------------------------------------------- */
.search-close {
  position: relative;
  margin-left: -25px;
  background: none;
  border: none;
  color: var(--ios-primary);
  font-size: 17px;
  cursor: pointer;
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ios-radius-small);
  transition: all 0.2s var(--ios-animation-timing);
  z-index: 25;
  pointer-events: auto;
}

.search-close::before {
  content: "";
  position: absolute;
  top: -6px;
  bottom: -6px;
  left: -6px;
  right: -6px;
  border-radius: 50%;
  pointer-events: none;
}

/* --------------------------------------------
   📱 MODAL DE BÚSQUEDA MÓVIL
-------------------------------------------- */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px;
  background-color: transparent;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  will-change: opacity, background-color;
  overflow: hidden;
  pointer-events: none;
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: fadeInBackdrop 0.3s var(--ios-animation-timing) forwards;
}

/* 🔲 Backdrop del modal */
.search-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  background-color: transparent;
  transition: background-color 0.3s var(--ios-animation-timing);
}

.search-modal.active .search-modal-backdrop {
  background-color: var(--ios-backdrop);
  animation: backdropFadeIn 0.3s var(--ios-animation-timing) forwards;
}

/* 📦 Contenido del modal */
.search-modal-content {
  width: 100%;
  height: calc(80vh - 60px);
  max-height: calc(80vh - 64px);
  background: var(--ios-surface);
  border-radius: var(--ios-radius-large) var(--ios-radius-large) 0 0;
  overflow: hidden;
  transform: translateY(100%);
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  position: relative;
  z-index: 2;
  will-change: transform;
  transition: transform 0.45s var(--ios-animation-timing-open);
}

.search-modal.active .search-modal-content {
  transform: translateY(0);
}

.search-modal-content.dragging {
  transition: none !important;
}

/* --------------------------------------------
   🎯 HEADER DEL MODAL
-------------------------------------------- */
.search-modal-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  padding-top: 24px;
  min-height: 60px;
  background: var(--ios-surface-elevated);
  border-bottom: 0.5px solid var(--ios-separator);
  position: relative;
  backdrop-filter: none;
  z-index: 20;
  animation: fadeInUp 0.4s var(--ios-animation-timing) 0.2s both;
}

.search-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ios-label-primary);
  margin: 0;
  letter-spacing: -0.41px;
  flex-grow: 1;
  text-align: center;
}

/* --------------------------------------------
   🔍 BARRA DE BÚSQUEDA MÓVIL
-------------------------------------------- */
.search-input-container {
  padding: 16px;
  background: var(--ios-surface-elevated);
  border-bottom: 0.5px solid var(--ios-separator);
  position: relative;
  display: flex;
  align-items: center;
  animation: fadeInUp 0.4s var(--ios-animation-timing) 0.15s both;
  will-change: transform, opacity;
}

.search-input-icon {
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ios-label-tertiary);
  font-size: 15px;
  z-index: 2;
  animation: fadeInUp 0.4s var(--ios-animation-timing) 0.2s both;
}

#userSearchInputMobile {
  width: 100%;
  height: 48px;
  line-height: 48px;
  padding: 0 42px 0 40px;
  background: var(--ios-surface);
  border: none;
  border-radius: var(--ios-radius-large);
  color: var(--ios-label-primary);
  font-size: 17px;
  font-weight: 400;
  transition: all 0.2s var(--ios-animation-timing);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  letter-spacing: -0.41px;
  animation: fadeInUp 0.4s var(--ios-animation-timing) 0.1s both;
  -webkit-appearance: none;
  appearance: none;
}

#userSearchInputMobile:focus {
  outline: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  background: var(--ios-surface-elevated);
  transform: scale(1.01);
}

#userSearchInputMobile::placeholder {
  color: var(--ios-label-tertiary);
  font-weight: 400;
}

/* 🧹 Botón limpiar búsqueda */
.search-clear-btn {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--ios-label-tertiary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 2;
}

/* --------------------------------------------
   🖱️ HANDLE DE DRAG - iOS Style
   Expansión horizontal, NO vertical
-------------------------------------------- */
.search-drag-handle {
  position: absolute;
  top: -10px;
  left: 41%;
  transform: translateX(-50%);
  width: 80px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: grab;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

/* Línea visible del handle */
.search-drag-handle .drag-handle-bar {
  width: 48px;
  height: 4px;
  background: var(--ios-handle, #C7C7CC);
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, width;
  position: relative;
}

/* 🖱️ Hover - expansión horizontal */
@media (hover: hover) {
  .search-drag-handle:hover .drag-handle-bar {
    background: var(--ios-primary, #007AFF);
    width: 56px;
    transform: none;
  }

  .search-drag-handle:hover {
    transform: translateX(-50%) scale(1.08);
  }
}

/* 👆 Drag activo - expansión controlada */
.search-drag-handle.drag-active .drag-handle-bar {
  background: var(--ios-primary, #007AFF);
  width: 64px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  animation: gentle-expand 0.3s ease-out;
}

/* 📱 Touch activo - expansión con pulso */
.search-drag-handle.touch-active .drag-handle-bar {
  background: var(--ios-primary-active, #0056CC);
  width: 72px;
  animation: 
    pulse-expand 0.3s ease-out,
    pulse-glow 0.3s ease;
}

/* ✅ Feedback de éxito - expansión temporal */
.search-drag-handle.close-success .drag-handle-bar {
  background: var(--ios-success, #34C759);
  animation: success-expand 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ⚡ Scroll rápido */
.search-drag-handle.velocity-high .drag-handle-bar {
  background: var(--ios-warning, #FF9500);
  width: 68px;
  transition: width 0.15s linear;
}

/* 🎨 Variante minimalista */
.search-drag-handle.minimal .drag-handle-bar {
  width: 36px;
  height: 3px;
  opacity: 0.7;
}

/* --------------------------------------------
   🖼️ RESULTADOS DESKTOP
-------------------------------------------- */
.desktop-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 340px;
  background: var(--ios-surface-elevated);
  border-radius: var(--ios-radius-large);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
  border: 0.5px solid var(--ios-separator);
  max-height: 480px;
  overflow: hidden;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px) scale(0.96);
  transform-origin: top center;
  transition: all 0.3s var(--ios-animation-timing);
  backdrop-filter: none;
}

.desktop-search-results.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: fadeInUp 0.25s var(--ios-animation-timing) forwards;
}

.desktop-search-results::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom,;
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 1;
}

/* --------------------------------------------
   👤 TARJETAS DE USUARIO
-------------------------------------------- */
.search-result-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--ios-surface-elevated);
  border-bottom: 0.5px solid var(--ios-separator);
  cursor: pointer;
  transition: all 0.2s var(--ios-animation-timing);
  animation: fadeInUp 0.4s var(--ios-animation-timing) forwards;
  opacity: 0;
}

.search-result-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin-right: 12px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ios-primary), var(--ios-secondary));
  transition: transform 0.3s var(--ios-animation-timing);
}

.search-avatar {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  object-fit: cover;
  background: linear-gradient(135deg, #E1E1E6, #D1D1D6);
  transition: all 0.3s var(--ios-animation-timing);
  opacity: 1;
}

.search-result-info {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}

.search-result-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--ios-label-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-result-profession {
  font-size: 15px;
  color: var(--ios-primary);
  margin-bottom: 4px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-bio {
  font-size: 13px;
  color: var(--ios-label-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------
   📋 CONTENEDORES DE RESULTADOS
-------------------------------------------- */
.search-results-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ios-surface);
  overscroll-behavior-y: contain;
  height: calc(80vh - 130px);
  animation: fadeInUp 0.4s var(--ios-animation-timing) 0.05s both;
}

.search-results-container::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

/* --------------------------------------------
   📊 ESTADOS DE BÚSQUEDA
-------------------------------------------- */
.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
  animation: fadeInUp 0.6s var(--ios-animation-timing) 0.2s both;
}

.search-empty-icon {
  font-size: 60px;
  margin-bottom: 20px;
  opacity: 0.6;
  filter: grayscale(1);
  animation: pulseScale 2s var(--ios-animation-timing) infinite;
}

.search-empty-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--ios-label-primary);
  margin-bottom: 8px;
}

.search-empty-text {
  font-size: 16px;
  color: var(--ios-label-secondary);
  max-width: 280px;
  line-height: 1.4;
}

.search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  animation: fadeInUp 0.4s var(--ios-animation-timing) both;
}

.search-spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--ios-surface);
  border-top-color: var(--ios-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

/* --------------------------------------------
   💡 SUGERENCIAS
-------------------------------------------- */
.search-suggestions {
  padding: 20px 16px;
  background: var(--ios-surface-elevated);
  border-top: 0.5px solid var(--ios-separator);
  position: sticky;
  bottom: 0;
  backdrop-filter: none;
  animation: fadeInUp 0.4s var(--ios-animation-timing) 0.3s both;
}

.suggestions-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ios-label-secondary);
  margin-bottom: 12px;
  padding-left: 4px;
}

.suggestions-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-tag {
  background: var(--ios-surface-elevated);
  color: var(--ios-primary);
  border: 0.5px solid var(--ios-separator);
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s var(--ios-animation-timing);
  animation: fadeInUp 0.4s var(--ios-animation-timing) forwards;
  opacity: 0;
}

.suggestion-tag:hover {
  background: var(--ios-primary);
  color: white;
  border-color: var(--ios-primary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    transform: translateZ(0);
    will-change: transform;
}

/* --------------------------------------------
   🔧 CLASES DE CONTROL
-------------------------------------------- */
body.search-modal-open,
body.dragging-active {
  overflow: hidden;
  touch-action: none;
}

.search-modal.active {
  z-index: 99999 !important;
}

/* --------------------------------------------
   📐 OPTIMIZACIONES DE RENDIMIENTO
-------------------------------------------- */
.search-modal-content,
.search-modal-backdrop,
.search-drag-handle,
.search-result-item,
.suggestion-tag {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* --------------------------------------------
   📱 RESPONSIVE - TABLETS
-------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .search-drag-handle {
    width: 90px;
    height: 48px;
  }

  .search-drag-handle .drag-handle-bar {
    width: 52px;
  }
}

/* --------------------------------------------
   📱 RESPONSIVE - MÓVILES
-------------------------------------------- */
@media (max-width: 768px) {
  .nav-search {
    display: none;
  }

  .search-modal {
    padding-top: env(safe-area-inset-top);
  }

  .search-modal-header {
    padding-top: calc(env(safe-area-inset-top) + 24px);
    min-height: calc(60px + env(safe-area-inset-top));
  }

  .search-input-container {
    padding-top: calc(12px + env(safe-area-inset-top));
  }

  .search-results-container {
    height: calc(80vh - 130px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Ajustes táctiles para móviles */
  @media (hover: none) and (pointer: coarse) {
    .search-drag-handle {
      width: 100px;
      height: 52px;
      top: 2px;
    }

    .search-drag-handle .drag-handle-bar {
      width: 56px;
    }

    .search-drag-handle.drag-active .drag-handle-bar {
      width: 72px;
    }

    .search-drag-handle.touch-active .drag-handle-bar {
      width: 84px;
    }
  }
}

/* --------------------------------------------
   🌙 MODO OSCURO
-------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ios-primary: #0A84FF;
    --ios-primary-active: #0056CC;
    --ios-secondary: #5E5CE6;
    --ios-success: #34C759;
    --ios-warning: #FF9500;
    --ios-surface: #000000;
    --ios-surface-elevated: #1C1C1E;
    --ios-label-primary: #FFFFFF;
    --ios-label-secondary: #8E8E93;
    --ios-label-tertiary: #48484A;
    --ios-separator: #38383A;
    --ios-backdrop: rgba(0, 0, 0, 0.6);
    --ios-handle: #48484A;
  }

  .desktop-search-results::before {
    background: linear-gradient(to bottom,;
      rgba(28, 28, 30, 0.8) 0%,
      rgba(28, 28, 30, 0) 100%);
  }

  .search-drag-handle .drag-handle-bar {
    background: var(--ios-handle-dark, #48484A);
  }

  .search-drag-handle.drag-active .drag-handle-bar,
  .search-drag-handle.touch-active .drag-handle-bar {
    background: var(--ios-primary, #0A84FF);
  }
}




































/* ===============================
   OCULTAR LA X NATIVA DEL INPUT SEARCH
============================================== */

/* Chrome, Edge, Safari */
#userSearchInput::-webkit-search-cancel-button,
#userSearchInputMobile::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* Firefox */
#userSearchInput::-moz-search-clear-button,
#userSearchInputMobile::-moz-search-clear-button {
  display: none;
}

/* Internet Explorer */
#userSearchInput::-ms-clear,
#userSearchInputMobile::-ms-clear {
  display: none;
}


















/* 🔥 AÑADE ESTO AL FINAL DE TU CSS */

/* Reducir z-index del header */
header {
  z-index: 100; /* Reducir de 1000 a 100 */;
}

/* Aumentar z-index del dropdown */
.desktop-search-results {
  z-index: 1100 !important; /* Mayor que el header original */;
  transform: translateZ(0); /* Forzar capa GPU */;
}










/* Spinner de carga */
#auth-loading {
  position: fixed;
  inset: 0;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #334155;
  border-top: 3px solid #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }











.view-all-applications-container {
  position: relative;
  display: inline-block;
}

.view-all-applications {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f3f4f6;
  border-radius: 20px;
  color: #1f2937;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.view-all-applications:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.applications-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  background: #ef4444;
  color: white;
  border-radius: 10px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}






