/* Variables y Estilos Base */
:root {
    /* Paleta de Colores: Cálida y Apetitosa */
    --color-espresso: #2B1812; /* Muy oscuro, casi negro */
    --color-mocha: #4A332A;
    --color-caramelo: #C87A38; /* Acento naranja/caramelo */
    --color-latte: #E8D5C4;
    --color-crema: #F9F4EE; /* Fondo claro principal */
    --color-blanco: #FFFFFF;

    /* Tipografía */
    --font-principal: 'Poppins', sans-serif;
    --font-secundaria: 'Inter', sans-serif;

    /* Transiciones */
    --transition-suave: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset Básico */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-secundaria);
    background-color: var(--color-crema);
    color: var(--color-espresso);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    /* Un gradiente radial sutil para dar más vida al fondo crema */
    background-image: radial-gradient(circle at 100% 0%, rgba(200, 122, 56, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 0% 100%, rgba(74, 51, 42, 0.05) 0%, transparent 50%);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-principal);
    font-weight: 600;
    color: var(--color-espresso);
}

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

/* --- Estilos para el Mapa de Mesas Interactivo (Dinámico) --- */
.mesa-element {
    position: absolute;
    cursor: grab;
    user-select: none;
    transition: transform 0.1s, filter 0.2s;
    /* Contenedor invisible base donde JS posicionará las cosas */
    width: 100px; 
    height: 100px;
}

.mesa-element:active {
    cursor: grabbing;
}

.mesa-element:hover {
    transform: scale(1.05);
}

/* El elemento central (La mesa física) */
.mesa-centro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--color-latte);
    border: 2px solid var(--color-mocha);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-espresso);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 2;
}

/* Formas y Tamaños de Mesa */
.mesa-centro-redonda {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.mesa-centro-cuadrada {
    width: 45px;
    height: 45px;
    border-radius: 8px;
}

.mesa-centro-larga {
    width: 90px;
    border-radius: 8px;
}

/* Las Sillas Dinámicas */
.silla-element {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--color-mocha);
    border-radius: 50%;
    z-index: 1;
    box-shadow: inset -2px -2px 4px rgba(0,0,0,0.2);
}

/* Estado Ocupada */
.mesa-centro-ocupada {
    background-color: #E74C3C !important;
    color: white !important;
    border-color: #C0392B !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.5) !important;
}

.silla-ocupada {
    background-color: #C0392B !important;
}

/* Evitar selección de texto accidental al interactuar con el mapa */
.mapa-page h2, 
.mapa-page p, 
#mesa-modal-overlay,
#decor-modal-overlay {
    user-select: none;
    -webkit-user-select: none;
}

/* --- Tooltip --- */
.map-tooltip {
    background: rgba(43, 24, 18, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid var(--color-caramelo);
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    color: white;
    width: 200px;
    pointer-events: none;
}

/* --- Badge de Tiempo --- */
.mesa-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--color-caramelo);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 5;
}

/* --- Animación de Latido (Pulse) --- */
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}
.mesa-centro-ocupada {
    background-color: #E74C3C !important;
    color: white !important;
    border-color: #C0392B !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.5) !important;
    animation: pulse-red 2s infinite;
}

/* --- Decoraciones --- */
.decor-element {
    position: absolute;
    cursor: grab;
    user-select: none;
    z-index: 1;
}

.decor-element:active {
    cursor: grabbing;
}

.decor-planta {
    width: 40px;
    height: 40px;
    background: #27AE60;
    border-radius: 50%;
    border: 3px solid #1E8449;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.decor-planta::after {
    content: '🌿';
    font-size: 1.2rem;
}

.decor-muro {
    width: 120px;
    height: 12px;
    background: #95A5A6;
    border: 2px solid #7F8C8D;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.decor-puerta {
    width: 80px;
    height: 20px;
    background: rgba(43, 24, 18, 0.8);
    border: 2px dashed #C87A38;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
}
.decor-puerta::after {
    content: 'ENTRADA';
}

.decor-ventana {
    width: 100px;
    height: 12px;
    background: rgba(135, 206, 235, 0.5); /* Azul cristalino */
    border: 2px solid #3498DB;
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.8), 0 5px 15px rgba(0,0,0,0.1);
}

/* Custom Alerts (Toasts) */
.toast-msg {
    background: var(--color-espresso);
    color: var(--color-crema);
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-weight: 600;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid var(--color-caramelo);
}
.toast-msg.show {
    transform: translateX(0);
    opacity: 1;
}

/* Modales y Menús Desplegables Modernos (Glassmorphism) */
.glass-dropdown {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
    background: transparent;
    color: #fff;
    border: none;
    padding: 10px 16px;
    text-align: left;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dropdown-item.danger {
    color: #FF6B6B;
}

.dropdown-item.danger:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #FF8787;
}
