/* estilos.css ACTUALIZADO - VERSIÓN FINAL CON BUSCADOR */
body { font-family: sans-serif; margin: 0; background: #121212; color: white; overflow-x: hidden; }

/* LAYOUT PRINCIPAL */
#gallery-container { padding-top: 60px; min-height: 100vh; transition: filter 0.3s ease; }

/* CLASE PARA CUANDO ESTÁ BLOQUEADO */
.is-blurred {
    filter: blur(5px) grayscale(30%); 
    pointer-events: none; 
}

/* HEADER FIJO */
header { 
    background: rgba(28, 28, 28, 0.9); backdrop-filter: blur(10px); 
    padding: 15px; position: fixed; top: 0; left: 0; width: 100%; 
    z-index: 50; display: flex; justify-content: space-between; align-items: center; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.5); box-sizing: border-box;
}
h2 { margin: 0; font-size: 18px; color: #fff; }

/* NOTIFICACIÓN DE NUEVAS FOTOS */
#update-btn {
    position: fixed; top: 75px; left: 50%; transform: translateX(-50%);
    background: #0095f6; color: white; padding: 8px 16px; border-radius: 20px;
    font-size: 14px; font-weight: bold; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 40; cursor: pointer; border: none; display: none; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* LA CUADRÍCULA (GRID) */
.wall-container { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr);
    gap: 5px; 
    padding: 5px; 
    padding-bottom: 100px; 
    max-width: 1000px; 
    margin: 0 auto;    
}

/* LAS FOTOS (MINIATURAS) */
.card { 
    position: relative; aspect-ratio: 1 / 1; 
    overflow: hidden; cursor: pointer; background: #222;
}
.card img { 
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s, opacity 0.3s; 
}
.card:active img { transform: scale(0.95); opacity: 0.8; }

/* VISOR CON ZOOM (LIGHTBOX) */
#lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); z-index: 2000;
    display: none; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}
#lightbox.active { display: flex; opacity: 1; }
#lightbox img { max-width: 100%; max-height: 80vh; object-fit: contain; box-shadow: 0 0 20px rgba(0,0,0,0.5); transform: scale(0.9); transition: transform 0.3s ease; }
#lightbox.active img { transform: scale(1); }
#lightbox-caption { color: #ccc; margin-top: 15px; font-size: 16px; text-align: center; padding: 0 20px; max-width: 80%; }
.close-lightbox { position: absolute; top: 20px; right: 20px; color: white; font-size: 30px; cursor: pointer; padding: 10px; background: rgba(0,0,0,0.5); border-radius: 50%; width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; }

/* PANTALLA DE BLOQUEO / SUBIDA (OVERLAY) */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); 
    z-index: 100; display: flex; justify-content: center; align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s; visibility: visible; opacity: 1;
}
.overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.modal { background: #262626; padding: 30px; border-radius: 15px; width: 85%; max-width: 350px; text-align: center; color: white; box-shadow: 0 10px 30px rgba(0,0,0,0.7); transform: translateY(0); transition: transform 0.3s ease; }
.overlay.hidden .modal { transform: translateY(20px); }

/* BOTONES */
input[type="file"] { display: none; }
.btn-select { display: block; background: #363636; padding: 15px; border-radius: 8px; margin: 15px 0; cursor: pointer; border: 1px dashed #666; transition: background 0.3s; }
.btn-select:active { background: #444; }
.btn-upload { width: 100%; padding: 15px; background: linear-gradient(45deg, #e91e63, #ff6b6b); color: white; border: none; border-radius: 8px; font-weight: bold; font-size: 16px; cursor: pointer; transition: opacity 0.3s; }
.btn-upload:disabled { opacity: 0.5; cursor: not-allowed; }

textarea { width: 100%; background: #333; color: white; border: none; padding: 12px; border-radius: 8px; margin-bottom: 15px; box-sizing: border-box; resize: none; font-family: sans-serif; }
textarea:focus { outline: 2px solid #e91e63; }

@keyframes popIn { from { transform: translateX(-50%) scale(0.5); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

/* ========================================== */
/* BOTONES FLOTANTES (FOTOS, MÚSICA, CHAT, MESA) */
/* ========================================== */

/* FOTOS (Derecha Arriba) */
.fab {
    position: fixed; bottom: 120px; right: 5%;
    padding: 12px 24px; border-radius: 30px;
    background: linear-gradient(45deg, #e91e63, #ff6b6b);
    color: white; font-size: 16px; font-weight: bold; border: none;
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.4);
    z-index: 60; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.2s;
}
.fab:active { transform: scale(0.95); }

/* MÚSICA (Izquierda Arriba) */
.fab-music {
    position: fixed; bottom: 120px; left: 5%;
    padding: 12px 24px; border-radius: 30px;
    background: linear-gradient(45deg, #1db954, #1ed760);
    color: white; font-size: 16px; font-weight: bold; border: none;
    box-shadow: 0 5px 15px rgba(29, 185, 84, 0.4);
    z-index: 60; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.2s;
}
.fab-music:active { transform: scale(0.95); }

/* CHAT (Derecha Abajo) */
.fab-chat {
    position: fixed; bottom: 50px; right: 5%;
    padding: 12px 25px; border-radius: 50px;
    background: linear-gradient(135deg, #0061ff, #60efff);
    color: white; font-size: 15px; font-weight: 700; border: none;
    box-shadow: 0 8px 20px rgba(0, 97, 255, 0.3);
    z-index: 60; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.3s;
}
.fab-chat:active { transform: scale(0.95); }

/* BUSCADOR DE MESA (Izquierda Abajo - NUEVO) */
.fab-search {
    position: fixed; bottom: 50px; left: 5%;
    padding: 12px 24px; border-radius: 30px;
    background: linear-gradient(45deg, #ff9966, #ff5e62);
    color: white; font-size: 16px; font-weight: bold; border: none;
    box-shadow: 0 5px 15px rgba(255, 94, 98, 0.4);
    z-index: 60; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.2s;
}
.fab-search:active { transform: scale(0.95); }

/* Ajuste móvil */
@media (max-width: 380px) {
    .fab, .fab-music, .fab-search, .fab-chat { padding: 10px 15px; font-size: 14px; }
}

/* ========================================== */
/* ESTILOS MODALES (MÚSICA, CHAT, BUSCADOR) */
/* ========================================== */

.music-modal, .chat-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 250;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.3s;
}

/* Fondo Música (Sale de abajo) */
.music-modal { background: rgba(0,0,0,0.85); align-items: end; }
.music-modal.hidden { transform: translateY(100%); pointer-events: none; }

/* Fondo Chat/Buscador (Difuminado) */
.chat-modal { background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); }
.chat-modal.hidden { opacity: 0; pointer-events: none; }

/* Contenido Modal */
.music-content {
    background: #121212; width: 100%; max-width: 500px; height: 85vh;
    border-radius: 20px 20px 0 0; padding: 20px; box-sizing: border-box;
    display: flex; flex-direction: column; position: relative;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5); border-top: 2px solid #1db954;
}

.chat-content {
    width: 95%; max-width: 400px; height: 85vh;
    background: #ffffff; border-radius: 24px; overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-music { position: absolute; top: 15px; right: 20px; background: none; border: none; color: white; font-size: 30px; cursor: pointer; }
.close-chat { background: none; border: none; color: white; font-size: 24px; cursor: pointer; opacity: 0.8; transition: 0.2s; }

/* Headers de Modales */
.chat-header {
    background: linear-gradient(135deg, #0061ff, #60efff);
    padding: 18px 20px; display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 4px 15px rgba(0, 97, 255, 0.2); z-index: 10;
}
.chat-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* --- CONTENIDO ESPECÍFICO MÚSICA --- */
#musicForm { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; margin-top: 15px; }
#musicForm input { background: #333; border: 1px solid #444; color: white; padding: 12px; border-radius: 8px; font-size: 16px; outline: none; }
.btn-music { background: #1db954; color: black; font-weight: bold; padding: 12px; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; }
#playlist-container { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }

.song-item { display: flex; gap: 10px; background: #222; padding: 10px; border-radius: 8px; align-items: center; border: 1px solid #333; position: relative; }
.song-thumb { width: 80px; height: 60px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.song-info { flex: 1; min-width: 0; text-align: left; }
.song-title { color: white; font-size: 13px; margin-bottom: 4px; word-break: break-all; }
.song-user { color: #1db954; font-size: 11px; font-weight: bold; text-transform: uppercase; margin-bottom: 2px; }
.video-frame { width: 100%; aspect-ratio: 16/9; border-radius: 8px; margin-top: 5px; }

/* Ranking y Votos */
.song-rank { font-size: 14px; color: #666; font-weight: bold; margin-right: 8px; min-width: 20px; }
.rank-1 { border: 1px solid #FFD700; background: rgba(255, 215, 0, 0.1); }
.rank-1 .song-rank { color: #FFD700; font-size: 18px; }
.rank-2 { border: 1px solid #C0C0C0; }
.rank-3 { border: 1px solid #cd7f32; }

.vote-btn { background: #333; border: 1px solid #444; color: #ccc; border-radius: 20px; padding: 5px 10px; cursor: pointer; display: flex; align-items: center; gap: 5px; margin-right: 8px; }
.vote-btn.voted-active { background: rgba(233, 30, 99, 0.2); border-color: #e91e63; color: #e91e63; }
.play-btn-small { background: none; border: 1px solid #1db954; color: #1db954; border-radius: 50%; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

/* --- CONTENIDO ESPECÍFICO CHAT --- */
#chat-box { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; background: #f4f6f8; background-image: radial-gradient(#cbd5e1 1px, transparent 1px); background-size: 20px 20px; }

.chat-bubble { max-width: 75%; padding: 10px 16px; border-radius: 18px; position: relative; font-size: 14px; line-height: 1.4; box-shadow: 0 2px 5px rgba(0,0,0,0.05); word-wrap: break-word; }
.bubble-left { align-self: flex-start; background: white; color: #1e293b; border-bottom-left-radius: 4px; }
.bubble-left .chat-user { font-weight: 800; font-size: 11px; color: #0061ff; margin-bottom: 4px; display: block; }
.bubble-left .chat-time { font-size: 10px; color: #94a3b8; float: right; margin-left: 8px; margin-top: 5px; }

.bubble-right { align-self: flex-end; background: linear-gradient(135deg, #0061ff, #2563eb); color: white; border-bottom-right-radius: 4px; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3); }
.bubble-right .chat-user { display: none; }
.bubble-right .chat-time { font-size: 10px; color: rgba(255,255,255,0.7); float: right; margin-left: 8px; margin-top: 5px; }

#chatForm { background: white; padding: 15px; border-top: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 10px; }
#chatName { border: none; border-bottom: 2px solid #f1f5f9; padding: 8px 5px; font-size: 13px; font-weight: 600; color: #475569; outline: none; background: transparent; }
.input-group { background: #f1f5f9; border-radius: 30px; padding: 5px 8px 5px 20px; display: flex; align-items: center; border: 1px solid transparent; }
.input-group:focus-within { background: white; border-color: #0061ff; }
#chatMessage { flex: 1; border: none; background: transparent; padding: 10px 0; font-size: 15px; outline: none; color: #334155; }
.btn-send { background: linear-gradient(135deg, #0061ff, #60efff); color: white; border: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; padding-left: 4px; }

/* ========================================== */
/* ESTILOS LISTA DE INVITADOS (BUSCADOR)      */
/* ========================================== */

/* Contenedor de resultados */
#search-results { margin-top: 15px; max-height: 60vh; overflow-y: auto; }

/* La barra del apellido - CORRECCIÓN DE COLOR: TEXTO OSCURO */
.apellido-group {
    background: #f1f5f9; /* Gris muy claro */
    color: #333333;      /* TEXTO NEGRO (Antes era blanco invisible) */
    border: 1px solid #e2e8f0;
    padding: 15px; margin-bottom: 8px; border-radius: 12px; cursor: pointer;
    transition: all 0.2s ease;
    display: flex; justify-content: space-between; align-items: center;
}
.apellido-group:active { background: #e2e8f0; transform: scale(0.98); }
.apellido-group span { font-weight: 700; font-size: 15px; text-transform: uppercase; }

/* Lista desplegable */
.familia-list {
    background: white; margin-top: 5px; padding: 10px; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-left: 4px solid #ff5e62;
    animation: slideDown 0.3s ease;
}

.guest-item {
    display: flex; justify-content: space-between; align-items: center;
    color: #555; /* Texto gris oscuro */
    padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px;
}
.guest-item:last-child { border-bottom: none; }

.mesa-badge {
    background: linear-gradient(45deg, #ff9966, #ff5e62); color: white;
    padding: 4px 10px; border-radius: 20px; font-weight: bold; font-size: 12px;
}

.hidden { display: none; }
@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }