/* IMPORTAR FUENTE PLAYFAIR DISPLAY */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800&display=swap');

/* ============================================
   VARIABLES DE COLORES MAALI - NUEVA PALETA (AJUSTADA)
   ============================================ */
:root {
    /* Base: slightly darker primary for better contrast */
    --primary: #2F2723;        /* Marrón Chocolate Profundo */
    --primary-dark: #241A17;   /* Para fondos hero/oscuros */
    --secondary: #9B8F85;      /* Marrón Topo más claro para legibilidad */
    --accent: #E7DAC7;         /* Marrón Arena (ligero ajuste) */
    --cream: #FBF8F3;          /* Blanco Mate */

    /* Accessibility helpers */
    --text-on-primary: #FBF8F3; /* color legible sobre primary */
    --text-muted: rgba(58,52,45,0.6);

    --radius: 10px;

    /* Elevations & motion */
    --elevation-1: 0 6px 22px rgba(41,33,29,0.08);
    --elevation-2: 0 10px 40px rgba(41,33,29,0.12);
    --glass: rgba(255,255,255,0.68);
    --trans-dur: 340ms;
    --trans-ease: cubic-bezier(.18,.9,.32,1);
    --muted: rgba(58,52,45,0.55);

    /* Luxury accents */
    --gold-warm: rgba(217,175,107,0.08);

    /* Typography */
    --base-font-size: 16px;
    --base-line-height: 1.65;
    --h1-size: 2rem;   /* 32px */
    --h2-size: 1.75rem; /* 28px */
    --h3-size: 1.125rem; /* 18px */
    --lead-size: 1rem; /* 16px */
    --small-size: 0.9rem;
}

html { font-size: var(--base-font-size); }
body { line-height: var(--base-line-height); }

/* ============================================
   RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Playfair Display', serif;
    background: #ffffff;
    color: var(--primary);
}

body {
    overflow-x: hidden;
}

#app {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER (para escenarios antiguos)
   ============================================ */
header {
    background: var(--primary);
    color: var(--accent);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 32px;
    margin-bottom: 5px;
    letter-spacing: 3px;
    font-weight: 700;
    color: var(--accent);
}

header p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
    color: var(--accent);
}

/* ============================================
   CONTENEDOR (para escenarios antiguos)
   ============================================ */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* ============================================
   SECCIONES (para escenarios antiguos)
   ============================================ */
section {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 30px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 26px;
    font-weight: 700;
    border-bottom: 3px solid var(--secondary);
    padding-bottom: 10px;
}

section p {
    color: var(--primary);
    margin-bottom: 15px;
    line-height: 1.8;
    font-weight: 400;
}

/* ============================================
   BOTONES GENERALES
   ============================================ */
button, .btn {
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    transition: transform var(--trans-dur) var(--trans-ease), box-shadow var(--trans-dur) var(--trans-ease), background var(--trans-dur) var(--trans-ease);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    width: 100%;
    margin: 10px 0;
}

/* Harmonize hover behaviour: translate for rectangular buttons, scale for circular FABs */
button:hover, .btn:hover { transform: translateY(-2px); box-shadow: var(--elevation-1); }

/* Circular buttons (floating) use scale */
.btn-open-sidebar, .btn-enviar-whatsapp, .btn-adjuntar { transition: transform var(--trans-dur) var(--trans-ease), box-shadow var(--trans-dur) var(--trans-ease); }
.btn-open-sidebar:hover, .btn-enviar-whatsapp:hover, .btn-adjuntar:hover { transform: scale(1.06); box-shadow: var(--elevation-2); }

.btn-primary {
    background: var(--primary);
    color: var(--cream);
}

.btn-primary:hover {
    /* kept consistent with base btn */
}

.btn-secondary {
    background: var(--secondary);
    color: #ffffff;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.btn-back {
    background: var(--accent);
    color: var(--primary);
}

.btn-back:hover {
    background: var(--secondary);
    color: #ffffff;
}

/* ============================================
   FORMULARIOS GENERALES
   ============================================ */
input, textarea, select {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: 'Playfair Display', serif;
    color: var(--primary);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(138, 124, 115, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--primary);
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

/* ============================================
   CHAT ANTIGUO (para compatibilidad)
   ============================================ */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    background: #ffffff;
    overflow: hidden;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #ffffff;
}

.message {
    padding: 12px 15px;
    border-radius: 12px;
    max-width: 85%;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación más suave para mensajes individuales */
@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.996);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msg-enter {
    animation: msgIn var(--trans-dur) var(--trans-ease) both;
    will-change: transform, opacity;
}

/* Mensajes con pequeño delay (stagger) */
.message-group[data-order] { opacity: 0; transform: translateY(6px); }
.message-group[data-order].msg-enter { opacity: 1; transform: translateY(0); transition: opacity calc(var(--trans-dur)) var(--trans-ease), transform calc(var(--trans-dur)) var(--trans-ease); }

/* Reduce motion helper */
.reduced-motion * {
    transition: none !important;
    animation: none !important;
}

.message.usuario {
    background: var(--primary);
    color: var(--cream);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.bot {
    background: var(--accent);
    color: var(--primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    font-weight: 500;
}

.input-area {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 2px solid var(--accent);
    background: #ffffff;
}

.input-area input {
    flex: 1;
    margin: 0 !important;
    padding: 10px 15px;
    border: 2px solid var(--accent);
}

.input-area button {
    width: auto;
    padding: 10px 20px;
    margin: 0;
    flex-shrink: 0;
}

/* ============================================
   PANTALLA BIENVENIDA
   ============================================ */
.pantalla-bienvenida {
    text-align: center;
    padding: 40px 20px;
}

.pantalla-bienvenida .emoji {
    font-size: 60px;
    display: block;
    margin-bottom: 20px;
}

.pantalla-bienvenida h2 {
    border: none;
    padding-bottom: 0;
    margin-bottom: 10px;
    color: var(--primary);
    font-weight: 700;
}

.pantalla-bienvenida p {
    margin-bottom: 20px;
    color: var(--primary);
}

/* ============================================
   PANTALLA MINIMALISTA (Inicio)
   ============================================ */
.pantalla-minimalista {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Hero: dark background using brand palette with subtle warm accent */
    background: linear-gradient(135deg, var(--primary-dark) 0%, rgba(47,39,35,0.95) 60%);
    padding: 40px 20px;
    color: var(--text-on-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.logo-minimalista {
    font-size: 44px;
    font-weight: 600;
    letter-spacing: 6px;
    color: var(--cream);
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
    text-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.saludo-minimalista {
    font-size: 40px; /* slightly larger for prominence */
    font-weight: 400;
    color: var(--text-on-primary);
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.6px;
    max-width: 820px;
    text-align: center;
}

.btn-minimalista {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--cream);
    font-size: 18px;
    font-weight: 500;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    padding: 10px 22px;
    transition: all var(--trans-dur) var(--trans-ease);
    text-decoration: none;
    width: auto;
    margin: 8px 0;
    box-shadow: var(--gold-warm) 0 8px 24px;
}

.btn-minimalista:hover {
    transform: scale(1.05);
    letter-spacing: 1px;
    background: var(--accent);
    color: var(--primary);
}

.link-subrayado {
    color: var(--accent);
    font-size: 22px;
    font-weight: 400;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 6px;
    transition: all 0.3s ease;
}

.link-subrayado:hover {
    letter-spacing: 1px;
}

/* ============================================
   PANTALLA LOGIN MINIMALISTA
   ============================================ */
.pantalla-login-minimalista {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--cream);
    padding: 40px 20px;
}

.logo-login {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--primary);
    margin-bottom: 50px;
    font-family: 'Playfair Display', serif;
}

.formulario-login {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 450px;
}

.logo-login { font-size: calc(var(--h1-size) - 0.5rem); }
.formulario-login { padding: 2.5rem; }

.formulario-login .form-group {
    margin-bottom: 25px;
}

.formulario-login label {
    display: block;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
}

.formulario-login input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    transition: all 0.3s ease;
}

.formulario-login input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(138, 124, 115, 0.1);
}

.btn-login-primary {
    width: 100%;
    background: var(--primary);
    color: var(--cream);
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 52, 45, 0.2);
}

.link-volver {
    display: block;
    text-align: center;
    color: var(--secondary);
    font-size: 16px;
    font-weight: 400;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.link-volver:hover {
    color: var(--primary);
}

/* ============================================
   DASHBOARD MINIMALISTA
   ============================================ */
.dashboard-container {
    padding-bottom: 70px;
    min-height: calc(100vh - 70px);
    background: var(--cream);
}

.seccion {
    display: none;
    padding: 20px;
    min-height: calc(100vh - 90px);
}

.seccion.activa {
    display: block;
}

.seccion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.seccion-header h2 {
    font-size: var(--h2-size);
    font-weight: 700;
    color: var(--primary);
    border: none;
    padding: 0;
    margin: 0;
}


.participantes-badge {
    background: var(--accent);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ============================================
   CHAT ESTILO WHATSAPP
   ============================================ */
.chat-whatsapp-container {
    background: linear-gradient(180deg, rgba(255,255,255,0.9), var(--glass));
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--elevation-1);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(58,52,45,0.04);
}

.messages-whatsapp {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--cream);
}

.message-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.message-group.bot-message {
    flex-direction: row;
}

.message-group.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.message-avatar.user-avatar {
    background: var(--accent);
    color: var(--primary);
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.user-message .message-content {
    align-items: flex-end;
}

.bot-message .message-content {
    align-items: flex-start;
}

.message-author {
    display: block; /* ensure it sits above each bubble */
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    padding: 0 12px;
    opacity: 0.95;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    /* Unified style: arena background and dark text for all messages */
    background: linear-gradient(180deg, var(--accent), rgba(231,218,199,0.98));
    color: var(--primary-dark);
    border: 1px solid rgba(58,52,45,0.06);
    font-weight: 500;
}

/* Remove role-specific color differences; keep subtle rounding where appropriate */
.message-bubble.image img {
    max-width: 320px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
}


/* Image styling inside message bubbles */
.message-bubble.image img {
    max-width: 320px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
}

.message-author { color: var(--primary); font-weight: 700; }
.message-time { color: var(--secondary); }

/* Messages container uses subtle cream background for better overall contrast */
.messages-whatsapp { background: linear-gradient(180deg, var(--cream), rgba(250,248,244,0.96)); }

/* stacked bubbles */
.message-content .message-bubble + .message-bubble { margin-top: 10px; }
.message-content .message-time { margin-top: 6px; font-size: 0.8rem; color: var(--text-muted); }


.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 12px;
}

/* ============================================
   ANIMACIÓN "ESCRIBIENDO..." (3 PUNTOS)
   ============================================ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* INPUT WHATSAPP */
.input-whatsapp {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--cream);
    border-top: 1px solid var(--accent);
}

.input-whatsapp input {
    flex: 1;
    border: none;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 24px;
    font-size: 15px;
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    margin: 0;
}

.input-whatsapp input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
}

.btn-adjuntar,
.btn-enviar-whatsapp {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    background: transparent;
    color: var(--secondary);
}

.btn-enviar-whatsapp[disabled] { cursor: not-allowed; opacity: 0.6; transform: none; }

.btn-adjuntar:hover {
    background: var(--accent);
    color: var(--primary);
    transform: scale(1.08);
}

.btn-enviar-whatsapp {
    background: var(--primary);
    color: var(--cream);
}

.btn-enviar-whatsapp:hover {
    background: var(--secondary);
    transform: scale(1.08);
}

/* ============================================
   SECCIÓN VIAJES
   ============================================ */
.viajes-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.viaje-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--primary);
}

.viaje-destino {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.viaje-duracion {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 16px;
}

.btn-viaje {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-viaje:hover {
    background: linear-gradient(180deg, rgba(47,39,35,0.98), var(--primary));
    color: var(--cream);
    box-shadow: var(--elevation-1);
    transform: translateY(-2px);
} 

/* ============================================
   SECCIÓN DOCUMENTOS
   ============================================ */
.documentos-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   ESTADO VACÍO
   ============================================ */
.empty-state {
    background: #ffffff;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.empty-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.empty-subtitle {
    font-size: 16px;
    color: var(--secondary);
    margin-bottom: 30px;
}

.btn-empty-state {
    background: var(--primary);
    color: var(--cream);
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    display: inline-block;
}

.btn-empty-state:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 52, 45, 0.2);
}

/* -------------------- SKELETONS -------------------- */
.skeleton {
    background: linear-gradient(90deg, rgba(235,228,216,0.9) 25%, rgba(250,250,250,0.9) 50%, rgba(235,228,216,0.9) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s linear infinite;
    border-radius: 12px;
    min-height: 64px;
}

.skeleton-line { height: 12px; margin: 12px 16px; background: rgba(255,255,255,0.45); border-radius: 8px; }

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* -------------------- TOAST -------------------- */
.toast {
    position: fixed;
    right: 16px;
    bottom: 90px;
    background: var(--primary);
    color: var(--cream);
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: var(--elevation-2);
    z-index: 1200;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 220ms var(--trans-ease), transform 220ms var(--trans-ease);
}
.toast.show { opacity: 1; transform: translateY(0); }



/* Subtle luxury touches */
.logo-minimalista { text-shadow: 0 3px 10px rgba(0,0,0,0.08); }
.saludo-minimalista { letter-spacing: 0.6px; }

/* ============================================
   MENÚ INFERIOR MINIMALISTA
   ============================================ */
.menu-inferior-minimalista {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    border-top: 1px solid var(--accent);
}

.menu-item-minimalista {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--secondary);
    font-family: 'Playfair Display', serif;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.menu-item-minimalista.activo {
    color: var(--primary);
    position: relative;
}

.menu-item-minimalista.activo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.menu-item-minimalista:hover {
    color: var(--primary);
}

.menu-icon-svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.menu-label-minimalista {
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   POPUP CREAR CONTRASEÑA
   ============================================ */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(58, 52, 45, 0.90);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-content {
    background: var(--cream);
    padding: 40px;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.popup-content h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 24px;
    font-weight: 700;
}

.popup-content p {
    color: var(--secondary);
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.5;
}

.popup-content .form-group {
    margin-bottom: 0;
}

.popup-content .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.popup-content .form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--secondary);
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Playfair Display', serif;
    transition: border-color 0.3s ease;
}

.popup-content .form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.popup-content .form-group small {
    color: var(--secondary);
    margin-top: 8px;
    display: block;
    font-size: 13px;
}

.btn-popup-primary {
    width: 100%;
    margin-top: 24px;
    padding: 14px;
    background: var(--primary);
    color: var(--cream);
    border: none;
    border-radius: 8px;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-popup-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 52, 45, 0.2);
}

.btn-popup-primary:active {
    transform: translateY(0);
}

/* ============================================
   SIDEBAR LATERAL
   ============================================ */
.chat-layout {
    display: flex;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

.chat-sidebar {
    width: 280px;
    background: var(--cream);
    border-right: 1px solid var(--accent);
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--elevation-1);
    transition: transform var(--trans-dur) var(--trans-ease);
}

/* Botón flotante para abrir conversaciones en móvil */
/* Hidden by default; shown only on small viewports (mobile) */
.btn-open-sidebar {
    display: none; /* keep hidden on desktop by default */
    position: fixed;
    left: 20px;
    bottom: 92px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--cream);
    border: none;
    box-shadow: var(--elevation-2);
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 1100;
    cursor: pointer;
}

/* Mobile-only: show FAB for opening sidebar */
@media (max-width: 900px) {
    .btn-open-sidebar { display: flex !important; }
}

.btn-open-sidebar:hover { transform: scale(1.06); }

/* Fondo semi-transparente cuando sidebar está abierto en móvil */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1090;
}

/* Sidebar abierto en móvil (transform y ancho) */
.chat-sidebar.mobile-open {
    transform: translateX(0);
    display: block;
    width: 86%;
    max-width: 340px;
    background: var(--cream);
    z-index: 1100;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--accent);
}

.sidebar-header h3 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: var(--primary);
    font-weight: 600;
}

.btn-nuevo-chat-lujoso {
    /* Sidebar style: full width within sidebar with subtle border */
    width: calc(100% - 36px);
    margin: 16px 18px;
    padding: 10px 14px;
    background: linear-gradient(180deg, rgba(58,52,45,0.98), rgba(47,39,35,0.98));
    color: var(--cream);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
    font-family: 'Playfair Display', serif;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--trans-dur) var(--trans-ease), box-shadow var(--trans-dur) var(--trans-ease);
    box-shadow: var(--elevation-1);
    display: block;
}

/* Compact Nuevo viaje button for the Viajes section */
.btn-nuevo-viaje {
    width: auto; /* don't span full width */
    max-width: 320px;
    margin: 16px auto; /* centered */
    padding: 10px 20px;
    background: linear-gradient(180deg, rgba(58,52,45,0.98), rgba(47,39,35,0.98));
    color: var(--cream);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
    font-family: 'Playfair Display', serif;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--trans-dur) var(--trans-ease), box-shadow var(--trans-dur) var(--trans-ease);
    box-shadow: var(--elevation-1);
    display: inline-block;
}

.empty-state { text-align: center; }

.sidebar-toggle { background: transparent; border: none; color: var(--text-on-primary); font-size: 1.1rem; cursor: pointer; display: inline-flex; align-items: center; padding: 6px; }

.chat-sidebar.mobile-open .sidebar-toggle { color: var(--text-on-primary); }



.btn-nuevo-chat-lujoso:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(58, 52, 45, 0.25);
    background: var(--secondary);
}

.viajes-list {
    padding: 0 20px;
}

.viaje-item-lujoso {
    padding: 12px 0;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.viaje-item-lujoso:hover {
    background: var(--cream);
    padding-left: 12px;
}

.viaje-item-lujoso.activo {
    background: var(--accent);
    border-left: 3px solid var(--primary);
    padding-left: 16px;
}

.viaje-info-lujoso {
    display: flex;
    flex-direction: column;
}

.viaje-destino-lujoso {
    font-weight: 600;
    color: var(--primary);
    font-size: 15px;
    margin-bottom: 4px;
}

.viaje-estado-lujoso {
    font-size: 12px;
    color: var(--secondary);
    font-weight: 400;
}

/* CHAT PRINCIPAL (derecha) */
.chat-main {
    margin-left: 280px;
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   AJUSTE DE ICONOS CHAT
   ============================================ */
.btn-adjuntar svg,
.btn-enviar-whatsapp svg {
    width: 20px !important;
    height: 20px !important;
    display: block;
    flex-shrink: 0;
}

/* ============================================
   PREFERENCIAS DE MOVIMIENTO
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    .typing-indicator span { animation: none !important; }
    .msg-enter { animation: none !important; }
}

/* ============================================
   RESPONSIVE - MÓVIL
   ============================================ */
@media (max-width: 600px) {
    /* Header antiguo */
    header h1 {
        font-size: 28px;
    }
   
    /* Secciones antiguas */
    section {
        padding: 20px 15px;
    }
   
    .message {
        max-width: 90%;
    }
   
    /* Pantalla minimalista inicio */
    .logo-minimalista {
        font-size: 36px;
        letter-spacing: 4px;
    }
   
    .saludo-minimalista {
        font-size: 32px;
    }
   
    .btn-minimalista,
    .link-subrayado {
        font-size: 18px;
    }
   
    /* Pantalla login */
    .logo-login {
        font-size: 36px;
        letter-spacing: 4px;
        margin-bottom: 40px;
    }
   
    .formulario-login {
        padding: 30px 25px;
        max-width: 100%;
    }
   
    .formulario-login label {
        font-size: 15px;
    }
   
    .formulario-login input {
        padding: 12px 14px;
        font-size: 15px;
    }
   
    .btn-login-primary {
        padding: 14px;
        font-size: 16px;
    }
   
    /* Dashboard */
    .dashboard-container {
        padding-bottom: 65px;
    }
   
    .seccion {
        padding: 12px;
    }
   
    .seccion-header {
        margin-bottom: 12px;
    }
   
    .seccion-header h2 {
        font-size: 20px;
    }
   
    .participantes-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
   
    /* Chat WhatsApp - Escala móvil reducida */
    .chat-whatsapp-container {
        height: calc(100vh - 150px);
        border-radius: 0;
    }
   
    .messages-whatsapp {
        padding: 12px;
    }
   
    .message-group {
        gap: 8px;
        margin-bottom: 12px;
    }
   
    .message-content {
        max-width: 75%;
    }
   
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
   
    .message-author {
        font-size: 12px;
        padding: 0 8px;
    }
   
    .message-bubble {
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 10px;
    }
   
    .message-time {
        font-size: 10px;
        padding: 0 8px;
    }
   
    /* Input móvil más compacto */
    .input-whatsapp {
        padding: 8px 12px;
        gap: 6px;
    }
   
    .input-whatsapp input {
        padding: 10px 14px;
        font-size: 14px;
    }
   
    .btn-adjuntar,
    .btn-enviar-whatsapp {
        width: 40px;
        height: 40px;
    }
   
    .btn-adjuntar svg,
    .btn-enviar-whatsapp svg {
        width: 18px !important;
        height: 18px !important;
    }
   
    /* Animación escribiendo más pequeña */
    .typing-indicator span {
        width: 6px;
        height: 6px;
    }
   
    /* Empty state */
    .empty-state {
        padding: 40px 20px;
    }
   
    .empty-title {
        font-size: 20px;
    }
   
    .empty-subtitle {
        font-size: 14px;
    }
   
    /* Menú inferior más compacto */
    .menu-icon-svg {
        width: 22px;
        height: 22px;
    }
   
    .menu-label-minimalista {
        font-size: 10px;
    }
   
/* Sidebar behaviour — responsive */
.chat-sidebar {
    display: none;
    transform: translateX(-8%);
}
.btn-open-sidebar {
    display: block;
}
.sidebar-backdrop { display: none; }

/* Desktop: show sidebar normally and hide mobile open button */
@media (min-width: 901px) {
    .chat-sidebar { display: block; transform: none; width: 280px; }
    .btn-open-sidebar { display: none !important; }
    /* Hide mobile-only sidebar toggle and hamburger on desktop for minimal controls */
    .sidebar-toggle { display: none !important; }

    /* Collapsed (compact) sidebar for desktop */
    .chat-sidebar.collapsed {
        width: 88px;
        transition: width var(--trans-dur) var(--trans-ease);
        overflow: visible;
    }

    .chat-sidebar.collapsed .viajes-list { display: block; }
    .chat-sidebar.collapsed .viaje-item-lujoso { padding-left: 10px; }
    .chat-sidebar.collapsed .viaje-info-lujoso { display: none; }
    .chat-sidebar.collapsed .btn-nuevo-chat-lujoso { width: calc(100% - 24px); padding: 10px; font-size: 13px; }

    /* Show a thin divider when collapsed */
    .chat-sidebar.collapsed { box-shadow: none; border-right: 1px solid rgba(58,52,45,0.04); }
}
   
    .chat-main {
        margin-left: 0;
    }
   
    .chat-layout {
        max-width: 100%;
    }
   
    /* Popup en móvil */
    .popup-content {
        padding: 30px 20px;
        width: 95%;
    }
   
    .popup-content h2 {
        font-size: 20px;
    }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (min-width: 601px) and (max-width: 1024px) {
    .chat-sidebar {
        width: 260px;
    }
   
    .chat-main {
        margin-left: 260px;
    }
   
    .chat-layout {
        max-width: 100%;
    }
}
