/* =========================================
   STYLE.CSS - Lado Cliente (Público)
   ========================================= */

/* --- 1. CONFIGURACIÓN GENERAL --- */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-bottom: 60px; /* Espacio para el footer absoluto */
}

/* Headers Públicos */
header { 
    margin-bottom: 20px; 
    text-align: center; 
}

h1 { 
    margin-bottom: 5px; 
    color: #fff; 
}

p.instrucciones { 
    color: #bbb; 
    font-size: 0.9rem; 
    margin-bottom: 10px; 
}

/* --- 2. COMPONENTES VISUALES --- */

/* Hero Banner */
.hero { 
    width: 100%; 
    padding: 40px 20px; 
    margin-bottom: 20px; 
    background: linear-gradient(to bottom, #2c3e50, #1a1a1a); 
    border-radius: 10px;
    text-align: center; 
}

/* Grid de Eventos */
.grid-eventos { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 30px; 
    width: 100%; 
    max-width: 1200px; 
    padding: 20px;
}

/* Tarjeta de Evento */
.card-evento { 
    display: flex; 
    flex-direction: column;
    background: #333; 
    border-radius: 10px; 
    overflow: hidden; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-evento:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); 
}

.card-img { 
    width: 100%; 
    height: 200px; 
    object-fit: cover; 
    background: #222; 
}

.card-body { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    padding: 20px; 
}

.card-title { 
    margin-bottom: 10px; 
    font-size: 1.2rem; 
    font-weight: bold; 
    color: #6feaf6; 
}

.card-info { 
    flex: 1; 
    margin-bottom: 15px; 
    font-size: 0.9rem; 
    color: #bbb; 
}

.card-price {
    margin-top: 5px; 
    color: #2ecc71; 
    font-weight: bold;
}

/* Botones Públicos */
.btn-comprar { 
    display: block; 
    width: 100%; /* Por defecto ancho completo en cards */
    padding: 10px; 
    background: #2ecc71; 
    color: white; 
    border: none; 
    border-radius: 5px; 
    font-weight: bold; 
    text-align: center; 
    cursor: pointer;
    transition: background 0.2s; 
}
.btn-comprar:hover { 
    background: #27ae60; 
}

/* Mensajes de Estado (NUEVO) */
.loading-msg { text-align: center; width: 100%; color: #aaa; margin-top: 20px; }
.empty-msg   { text-align: center; width: 100%; color: #bbb; margin-top: 20px; }
.error-msg   { text-align: center; width: 100%; color: #e74c3c; margin-top: 20px; }

/* --- 3. SALA INTERACTIVA --- */

/* Navegación de Pisos */
.pisos-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-piso {
    padding: 10px 20px;
    background: #333;
    color: #aaa;
    border: 1px solid #555;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-piso:hover { 
    background: #444; 
    color: white; 
}

.btn-piso.active {
    background: #6feaf6;
    color: #111;
    border-color: #6feaf6;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(111, 234, 246, 0.3);
}

/* Escenario */
.pantalla {
    width: 100%; 
    max-width: 600px;
    height: 70px; 
    margin: 15px 0 30px 0; 
    display: flex; 
    justify-content: center; 
    align-items: center;
    background-color: #fff; 
    color: #333; 
    font-weight: bold; 
    letter-spacing: 5px;
    border-radius: 5px; 
    transform: rotateX(-45deg);
    box-shadow: 0 3px 10px rgba(255, 255, 255, 0.7);
}

/* Contenedor de Butacas */
.teatro-container {
    display: flex; 
    flex-direction: column; 
    align-items: center;
    gap: 8px; 
    width: 100%; 
    padding-bottom: 20px;
    overflow-x: auto; 
}

.fila { 
    display: flex; 
    justify-content: center; 
    gap: 6px; 
}

/* Butacas */
.butaca {
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 25px; 
    height: 20px; 
    flex-shrink: 0;
    background-color: #444451; 
    border-top-left-radius: 6px; 
    border-top-right-radius: 6px;
    color: transparent; /* Texto oculto hasta hover */
    font-size: 10px; 
    cursor: pointer; 
    transition: all 0.2s ease;
}

.butaca:hover:not(.ocupada) { 
    transform: scale(1.2); 
    background-color: #7bc4ff; 
    z-index: 10; 
}

.butaca.seleccionada { 
    background-color: #6feaf6; 
    box-shadow: 0 0 10px #6feaf6; 
}

.butaca.ocupada { 
    background-color: #555; 
    cursor: not-allowed; 
}

.pasillo, .espacio { 
    width: 25px; 
    height: 20px; 
    flex-shrink: 0; 
}

/* Leyenda */
.leyenda {
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap;
    gap: 20px; 
    margin-top: 30px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 5px; 
}

.leyenda div { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 0.8rem; 
}

.muestra { width: 15px; height: 15px; border-radius: 3px; }
.muestra.libre { background-color: #444451; }
.muestra.tuya { background-color: #6feaf6; }
.muestra.ocupada { background-color: #555; }

.btn-sala-container { 
    margin-top: 20px; 
    margin-bottom: 40px; 
    text-align: center; 
}

.btn-pagar-sala { 
    width: auto; 
    padding: 15px 40px; 
    font-size: 1.2rem; 
}

/* --- 4. CHECKOUT --- */
.container-box {
    width: 100%; 
    max-width: 500px; 
    margin: 0 auto;
    padding: 30px; 
    background: #333; 
    border-radius: 10px;
}

.resumen-compra { 
    margin-bottom: 20px; 
    padding-bottom: 20px; 
    border-bottom: 1px solid #555; 
}

.resumen-grupo { margin-bottom: 5px; }

.resumen-total { 
    margin-top: 10px; 
    font-size: 1.2rem; 
}

.total-price { 
    font-weight: bold; 
    font-size: 1.5rem; 
}

.form-group { margin-bottom: 15px; }

.form-input { 
    width: 100%; 
    padding: 10px; 
    background: #222; 
    color: white; 
    border: 1px solid #555; 
    border-radius: 5px; 
    outline: none;
}

.form-input:focus { border-color: #6feaf6; }

.btn-pagar {
    display: block;
    width: 100%; 
    margin-top: 20px; 
    padding: 15px; 
    background-color: #009ee3; /* Azul Mercado Pago */
    color: white;
    border: none; 
    border-radius: 5px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    cursor: pointer; 
    transition: background 0.3s; 
}

.btn-pagar:hover { background-color: #007eb5; }
.btn-pagar:disabled { background-color: #555; cursor: not-allowed; }

.link-cancelar { 
    display: block; 
    margin-top: 15px; 
    color: #bbb; 
    font-size: 0.9rem; 
}

/* --- 5. PANTALLA ÉXITO Y QR --- */
.qr-container { margin: 20px 0; }
.qr-img { width: 200px; border-radius: 10px; }
.loader { margin: 20px 0; font-size: 1.1rem; color: #aaa; }

/* --- 6. MODO ESCÁNER (Portero) --- */
body.scanner-mode {
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    padding: 0;
}

.scanner-wrapper { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    width: 100%; 
}

.input-code-portero { 
    margin-bottom: 20px; 
    font-size: 1.5rem; 
    text-align: center; 
    text-transform: uppercase; 
    letter-spacing: 5px; 
}

#reader { 
    width: 300px; 
    height: 300px; 
    margin-bottom: 20px; 
    background: #222; 
    border: 2px solid #444; 
    border-radius: 10px; 
    overflow: hidden; 
}

.result-box { 
    display: none; 
    width: 90%; 
    max-width: 300px; 
    margin-top: 20px; 
    padding: 20px; 
    background: #333; 
    border-radius: 10px; 
    text-align: center; 
}

.result-box.success { border-left: 5px solid #2ecc71; }
.result-box.error   { border-left: 5px solid #e74c3c; }
.result-box.warning { border-left: 5px solid #f39c12; }

/* Detalles del ticket en scanner */
.ticket-detail-event { 
    background: #222; 
    padding: 5px; 
    border-radius: 5px; 
    margin-bottom: 10px; 
}
.ticket-detail-event small { color: #aaa; }
.ticket-detail-event strong { color: #6feaf6; font-size: 1.1rem; }

.ticket-detail-user { 
    font-size: 1.2rem; 
    color: #fff; 
    margin-bottom: 10px;
}

.ticket-detail-seats { 
    margin-top: 10px; 
    padding: 10px; 
    background: #444; 
    border-radius: 5px; 
}
.seat-list { 
    font-size: 1.5rem; 
    color: #2ecc71; 
    font-weight: bold; 
}

.btn-scan-next { 
    width: auto; 
    margin-top: 20px; 
    padding: 10px 30px; 
}

.btn-outline { 
    margin-top: 30px; 
    padding: 8px 15px; 
    background: transparent; 
    color: #aaa; 
    border: 1px solid #555; 
    border-radius: 5px; 
    cursor: pointer; 
}
.btn-outline:hover { 
    border-color: #888; 
    color: #fff; 
}