@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&family=Courier+Prime&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body {
    /* Fondo neutro sobre tu mapa */
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), 
                url('../assets/MapINCOMELEC2SinLogo.svg'); 
    
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #fff;
}

.app-container {
    display: flex;
    gap: 40px;
    width: 100%;
    max-width: 1000px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Panel Izquierdo: Gris Neutro --- */
.control-panel {
    flex: 1;
    min-width: 350px;
    background: rgba(30, 30, 30, 0.75); 
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1); 
    transition: transform 0.3s ease;
}

.control-panel:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.2); }

/* Logo */
.logo-header {
    max-width: 180px;
    height: auto;
    margin: 0 auto 15px auto;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); 
}

.brand h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
    color: #fff;
    letter-spacing: 0.5px;
}

.subtitle { 
    color: #ccc;
    font-size: 0.85rem; 
    margin-bottom: 35px; 
    display: block; 
    text-align: center;
    font-weight: 300;
}

/* --- Inputs --- */
.form-group { margin-bottom: 25px; }
.form-group label { 
    display: block; 
    color: #ddd; 
    font-size: 0.8rem; 
    margin-bottom: 8px; 
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input {
    width: 100%;
    padding: 12px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid #666;
    color: #fff;
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s;
}

input::placeholder { color: #888; }

input:focus { 
    border-bottom: 2px solid #006F32; 
}

/* --- Botón Principal --- */
.btn {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background-color: #006F32; 
    color: white;
    border: none;
    border-radius: 6px; 
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn:hover { 
    transform: translateY(-2px); 
    background-color: #005a28;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* =========================================
   CAMBIO: Panel Derecho Organizado
   ========================================= */

.preview-panel {
    flex: 1;
    min-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centrado vertical */
    position: relative;
}

.preview-header {
    width: 100%;
    max-width: 340px; /* Ancho exacto del ticket */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px; /* Pegadito al ticket */
    padding: 0 5px;
}

.preview-header h2 {
    font-size: 0.85rem; /* Pequeño y técnico */
    color: #aaa; /* Gris sutil */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

/* Botón de descarga discreto */
.btn-icon {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #aaa;
    width: 32px; height: 32px;
    border-radius: 6px; /* Cuadrado redondeado */
    cursor: pointer;
    transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
}

.btn-icon:hover { 
    background: #006F32; 
    border-color: #006F32;
    color: #fff;
    transform: scale(1.05);
}

/* TICKET con detalle de marca */
#ticketViewer {
    background: #fff;
    width: 100%;
    max-width: 340px;
    padding: 30px 25px;
    color: #333; 
    font-family: 'Courier Prime', monospace;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    min-height: 480px;
    position: relative;
    /* Detalle verde INCOMELEC arriba del papel */
    border-top: 4px solid #006F32; 
    
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), 95% 100%, 90% calc(100% - 12px), 85% 100%, 80% calc(100% - 12px), 75% 100%, 70% calc(100% - 12px), 65% 100%, 60% calc(100% - 12px), 55% 100%, 50% calc(100% - 12px), 45% 100%, 40% calc(100% - 12px), 35% 100%, 30% calc(100% - 12px), 25% 100%, 20% calc(100% - 12px), 15% 100%, 10% calc(100% - 12px), 5% 100%, 0 calc(100% - 12px));
}

.ticket-title { 
    text-align: center; 
    font-weight: 700; 
    font-size: 14px; 
    margin-bottom: 15px; 
    text-transform: uppercase; 
    letter-spacing: 1px;
}
.ticket-separator { border-top: 1px dashed #999; margin: 15px 0; }
.ticket-qr { text-align: center; margin-top: 25px; }
.ticket-qr img { width: 130px; height: 130px; mix-blend-mode: multiply; }

.loader { width: 18px; height: 18px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block;}
@keyframes spin { to { transform: rotate(360deg); } }

/* =======================================================
   CUSTOM SELECT2 (DROPDOWN DE LUJO - DARK MODE)
   ======================================================= */

/* Caja principal del Select2 */
.select2-container--default .select2-selection--single {
    background-color: transparent !important; 
    border: none !important;
    border-bottom: 1px solid #666 !important; 
    border-radius: 0 !important;
    height: 40px !important; 
    padding-top: 5px;
}

/* Texto seleccionado */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fff !important; 
    font-size: 1.05rem; 
    padding-left: 0;
}

/* Flecha */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 35px !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #aaa transparent transparent transparent !important;
    top: 50%;
}

/* Menú desplegable (El cuadro que se abre) */
.select2-dropdown {
    background-color: #333 !important; 
    border: 1px solid #555 !important; 
    color: #fff !important; 
    z-index: 9999;
}

/* Input de búsqueda */
.select2-search__field {
    background-color: #222 !important; 
    color: #fff !important; 
    border: 1px solid #555 !important; 
    border-radius: 4px;
}

/* Opciones de la lista */
.select2-results__option { 
    padding: 10px; 
    font-size: 0.95rem; 
}

/* Hover y Seleccionado (VERDE INCOMELEC) */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #006F32 !important; 
    color: white !important;
}

/* Opción previamente seleccionada */
.select2-container--default .select2-results__option--selected {
    background-color: #444 !important;
}

