/* ==========================================================================
   SMSGTPRO - PREMIUM GLASSMORPHISM, MICRO-INTERACTIONS & ADVANCED OVERLAYS
   ========================================================================== */

/* Refinamiento de Cristal en Cabecera y Navegación */
.gt-header {
    background: rgba(14, 20, 29, 0.84);
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
}

.gt-bottom-tabs {
    background: rgba(14, 20, 29, 0.86);
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

/* Modales con Entrada Cinemática */
.gt-modal-content {
    background: linear-gradient(160deg, rgba(24, 34, 48, 0.96) 0%, rgba(14, 20, 29, 0.98) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(28px) scale(0.94); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Menús Desplegables (Dropdown 3 Puntos) */
.gt-dropdown {
    position: absolute;
    top: 56px;
    right: 14px;
    background: rgba(20, 28, 40, 0.94);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 225px;
    padding: 8px;
    z-index: 3000;
    transform-origin: top right;
    animation: gtDropdownPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gtDropdownPop {
    from { opacity: 0; transform: scale(0.88) translateY(-8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

#chat-menu {
    position: absolute;
    top: 58px;
    right: 12px;
    min-width: 235px;
    z-index: 3500;
}

.dropdown-item {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    color: var(--gt-text);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(2px);
}

.dropdown-item:active {
    transform: scale(0.97);
}

.dropdown-item i {
    font-size: 19px;
    color: var(--gt-cyan);
    filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.3));
}

.dropdown-item.danger {
    color: var(--gt-danger);
}

.dropdown-item.danger:hover {
    background: rgba(255, 71, 87, 0.12);
}

.dropdown-item.danger i {
    color: var(--gt-danger);
    filter: drop-shadow(0 0 6px rgba(255, 71, 87, 0.35));
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 6px 4px;
}

/* Capas Táctiles de Historias */
#visor-historias-full {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#story-tap-layer {
    position: absolute;
    top: 64px;
    bottom: 120px;
    left: 0;
    right: 0;
    z-index: 2;
    touch-action: none;
}

/* Menú Flotante FAB y Overlay */
.gt-fab-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: rgba(2, 5, 9, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gt-fab-menu {
    position: fixed;
    right: 16px;
    bottom: calc(150px + env(safe-area-inset-bottom));
    width: min(325px, calc(100vw - 32px));
    max-height: 62vh;
    overflow-y: auto;
    background: rgba(18, 26, 38, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    z-index: 999;
    transform-origin: bottom right;
    animation: gtFabPop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes gtFabPop {
    from { opacity: 0; transform: scale(0.82) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.gt-fab-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gt-fab-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.gt-fab-item:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.gt-fab-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gt-grad-primary);
    color: #03060a;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(0, 229, 255, 0.3);
}

.gt-fab-sep {
    padding: 14px 14px 6px;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--gt-cyan);
    font-weight: 800;
    text-transform: uppercase;
}

.gt-fab.abierto {
    z-index: 1000;
    transform: rotate(135deg) scale(1.05);
    box-shadow: 0 10px 28px rgba(255, 71, 87, 0.5);
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    color: #fff;
}

/* ==========================================================================
   CONTROLES DE PRIVACIDAD E INTERRUPTORES (SWITCH iOS PRO)
   ========================================================================== */
.gt-priv-opt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    margin: 4px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    color: var(--gt-text);
    font-weight: 600;
    font-size: 14.5px;
    transition: all 0.2s ease;
}

.gt-priv-opt:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.gt-priv-opt input[type="radio"] {
    accent-color: var(--gt-cyan);
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.gt-priv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    margin: 6px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gt-switch {
    position: relative;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
    cursor: pointer;
}

.gt-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.gt-switch-slider {
    position: absolute;
    inset: 0;
    background: #1e2938;
    border-radius: 999px;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
}

.gt-switch-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 2px;
    top: 2px;
    background: #ffffff;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.gt-switch input:checked + .gt-switch-slider {
    background: linear-gradient(135deg, var(--gt-cyan), var(--gt-emerald));
    border-color: transparent;
    box-shadow: 0 0 14px rgba(0, 245, 155, 0.35);
}

.gt-switch input:checked + .gt-switch-slider::before {
    transform: translateX(22px);
    background: #03060a;
}

/* ==========================================================================
   REGLAS DE FILTRADO INTELIGENTE Y UTILIDADES
   ========================================================================== */
.gt-bubble {
    -webkit-touch-callout: none;
}

#lista-conversaciones[data-filtro="no_leidos"] .gt-chat-entry:not(:has(.gt-unread-pill)) {
    display: none;
}

#lista-conversaciones[data-filtro="grupos"] .gt-chat-entry:not(.es-grupo) {
    display: none;
}

/* Estilizado para la lista de selección de miembros en Crear Grupo */
#grupo-selector-contactos li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--gt-text);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

#grupo-selector-contactos li:hover {
    background: rgba(255, 255, 255, 0.07);
}

#grupo-selector-contactos input[type="checkbox"] {
    accent-color: var(--gt-cyan);
    width: 18px;
    height: 18px;
    cursor: pointer;
}