/* ================================================================
   1. RESET, VARIABLES Y CONFIGURACIÓN BASE
   ================================================================ */
:root {
    --azul-quetzal: #16355d;
    --azul-quetzal-claro: #7bbbfb;
    --verde-quetzal: #00bfa6;
    --verde-quetzal-hover: #009688;
    --blanco: #ffffff;
    --gris-fondo: #f2f2f2;
    --gris-borde: #e0e0e0;
    --gris-texto: #555555;
    --rojo-alerta: #f56565;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gris-fondo);
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

h2, h3, h4 {
    color: var(--azul-quetzal);
}

/* ================================================================
   2. HEADER RESPONSIVO (IZQ - CENTRO - DER)
   ================================================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--azul-quetzal-claro);
    padding: 10px 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-section, .logo, .header-right {
    flex: 1;
}

/* BUSCADOR A LA IZQUIERDA */
.search-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.search-section h2 { 
    margin: 0; 
    font-size: 0.8rem; 
    color: var(--azul-quetzal); 
    text-transform: uppercase;
    letter-spacing: 1px;
}

.barra-filtros { 
    display: flex; 
    gap: 8px; 
    margin-top: 5px; 
}

.barra-filtros input, .barra-filtros select {
    padding: 8px; 
    border-radius: 6px; 
    border: 1px solid #ccc; 
    font-size: 0.85rem;
}

.barra-filtros button {
    background-color: var(--azul-quetzal); 
    color: white; 
    border: none; 
    padding: 8px 15px; 
    border-radius: 6px; 
    cursor: pointer;
}

/* LOGO AL CENTRO */
.logo {
    display: flex;
    justify-content: center;
}

.logo img { 
    height: 60px; 
    max-width: 100%;
    object-fit: contain;
}

/* BOTONES A LA DERECHA */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}

.mensaje { 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: var(--azul-quetzal); 
}

/* --- Menú Dropdown --- */
.menu { position: relative; }

#menuBtn { 
    background-color: var(--azul-quetzal); 
    color: white; 
    border: none; 
    font-size: 1.1rem; 
    cursor: pointer; 
    border-radius: 4px; 
    padding: 5px 12px; 
}

.dropdown { 
    display: none; 
    position: absolute; 
    right: 0; 
    top: 45px;
    background: white; 
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); 
    z-index: 1001; 
    width: 170px; 
    overflow: hidden;
}

.dropdown a { 
    display: block; 
    padding: 12px 15px; 
    color: var(--azul-quetzal); 
    text-decoration: none; 
    font-size: 0.9rem;
}

.dropdown a:hover { background: #f0f7ff; }

.btn-comenzar-test {
    background: #00bfa6;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-comenzar-test:hover {
    background: #00897b;
    transform: scale(1.05);
}

/* ================================================================
   3. GRID DE VACANTES
   ================================================================ */
.contenido-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
}

.titulo-seccion {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.titulo-seccion::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--verde-quetzal);
    margin: 8px auto 0;
    border-radius: 2px;
}

.vacantes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 25px;
    text-align: left;
    margin-top: 20px;
}

.vacante {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px !important;
    height: auto !important;
    min-height: 60px !important;
    border-radius: 10px !important;
    background: white;
    border: 1px solid var(--gris-borde);
    transition: 0.2s;
}

#vacantesContainer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
}

.vacante:hover {
    transform: translateX(5px);
    border-color: var(--azul-quetzal-claro);
    box-shadow: 2px 4px 10px rgba(0,0,0,0.05);
}

.empresa-tag { 
    color: var(--verde-quetzal); 
    font-weight: 700; 
    font-size: 0.8rem; 
    margin-bottom: 10px; 
    display: block;
    text-transform: uppercase;
}

.vacante h3 {
    font-size: 1rem !important;
    margin: 0 !important;
    flex: 2;
    color: var(--azul-quetzal);
}

.vacante p {
    margin: 0 !important;
    font-size: 0.85rem !important;
    flex: 1;
    text-align: right;
    color: var(--gris-texto);
}

.vacante .empresa-tag {
    font-size: 0.7rem !important;
    margin-bottom: 0 !important;
    margin-right: 15px;
}

/* ================================================================
   4. MODAL RESPONSIVO GENERAL Y PRUEBAS
   ================================================================ */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 3000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.5); 
    backdrop-filter: blur(2px);
    overflow-y: auto; 
}

.modal-content-moderno { 
    background: #fff; 
    margin: 2% auto; 
    width: 92%; 
    max-width: 900px; 
    border-radius: 18px; 
    position: relative; 
    overflow: hidden; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.modal-header-quetzal { padding: 25px 30px 5px; }
.modal-header-quetzal h2 { font-size: 1.8rem; margin: 0; }
.empresa-nombre-modal { color: var(--verde-quetzal); font-weight: bold; margin-top: 5px; font-size: 1.1rem; }

.modal-grid-container { 
    display: grid; 
    grid-template-columns: 1.5fr 1fr; 
}

.col-detalle { padding: 15px 30px 30px; }
.col-stats { 
    background: #f8fafd; 
    padding: 30px; 
    border-left: 1px solid #edf2f7; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.card-resumen-azul { 
    background: #eef7ff; 
    padding: 18px; 
    border-radius: 10px; 
    border-left: 5px solid var(--verde-quetzal); 
    margin-bottom: 20px; 
}

.btn-mision-posible { 
    width: 100%; 
    padding: 15px; 
    background: linear-gradient(135deg, var(--verde-quetzal), var(--verde-quetzal-hover)); 
    color: white; 
    border: none; 
    border-radius: 50px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    cursor: pointer; 
}

.cerrar { position: absolute; top: 15px; right: 20px; font-size: 2rem; color: #aaa; cursor: pointer; }

.modal-confirmacion {
    position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
}

.modal-contenido-confirmacion {
    background: white; padding: 30px; border-radius: 20px;
    text-align: center; max-width: 400px; width: 90%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.modal-icono { font-size: 50px; margin-bottom: 15px; }

.btn-confirmar {
    background: #00c0a5; color: white; border: none;
    padding: 12px 30px; border-radius: 10px; cursor: pointer;
    font-weight: bold; width: 100%; margin-top: 20px;
}

#modalPruebasPendientes {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

#modalPruebasPendientes .modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    position: relative;
    overflow: visible;
}

#modalPruebasPendientes .cerrar {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 26px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    line-height: 1;
    background: transparent;
    border: none;
    transition: color 0.2s ease;
    user-select: none;
    z-index: 10;
}

#modalPruebasPendientes .cerrar:hover {
    color: var(--azul-quetzal);
}

/* ================================================================
   5. COMPONENTE: TIPS
   ================================================================ */
.contenedor-tips-moderno { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    margin-top: 10px; 
}

.tip-card-discreta { 
    background: #f8faff; 
    border: 1px solid #e1e8f0; 
    border-radius: 10px; 
    padding: 15px; 
    position: relative; 
}

/* ================================================================
   6. DESCRIPCIÓN Y DETALLES
   ================================================================ */
.descripcion-vacante {
    white-space: pre-wrap; 
    line-height: 1.6;      
    text-align: justify;   
}

.caja-descripcion {
    white-space: pre-line;   
    line-height: 1.8;        
    color: #444;             
    text-align: justify;     
    font-size: 0.95rem;
    padding: 10px 0;
}

.caja-descripcion strong {
    display: inline-block;
    margin-top: 10px;
    font-size: 1rem;
    text-transform: uppercase;
}

/* ================================================================
   7. MISIONES Y DASHBOARD (ESTILOS INTELIGENTES Y SECCIONES)
   ================================================================ */
.mission-confirm-overlay {
    position: fixed; 
    inset: 0; 
    background: rgba(0, 0, 0, 0.85);
    display: flex; 
    align-items: center;
    justify-content: center;
    z-index: 50000;
    backdrop-filter: blur(5px);
    padding: 20px;
}

.mission-confirm-card {
    background: #fff; 
    padding: 40px; 
    border-radius: 25px; 
    text-align: center;
    max-width: 450px; 
    width: 100%; 
    border: 3px solid #00bfa6;
    box-shadow: 0 20px 50px rgba(0, 191, 166, 0.3);
    position: relative;
    margin: auto;
}
.mission-icon { font-size: 4rem; margin-bottom: 20px; animation: bounce 2s infinite; }

.btn-aceptar-pro {
    background: #00bfa6; color: white; border: none; padding: 15px 30px;
    border-radius: 12px; font-weight: bold; cursor: pointer; font-size: 1.1rem;
    width: 100%; margin-top: 20px; transition: 0.3s;
}
.btn-aceptar-pro:hover { transform: scale(1.05); background: #00897b; }

.btn-cancelar-pro {
    background: transparent; border: none; color: #888; cursor: pointer;
    margin-top: 15px; text-decoration: underline; font-size: 0.9rem;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

#modalBienvenida {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.modal-abierto {
    overflow: hidden;
    height: 100vh;
}

.flatpickr-calendar { z-index: 99999 !important; }
.flatpickr-input { display: none; }

#modalLogoEmpresa {
    width: 80px;      
    height: 80px;     
    object-fit: contain; 
    image-rendering: -webkit-optimize-contrast; 
    border-radius: 8px; 
}

.vacante-card-inteligente {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 5px solid #00bfa6;
    transition: transform 0.3s ease;
    margin-bottom: 20px;
}

.vacante-card-inteligente:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,191,166,0.2);
}

.badge-area {
    background: #e0f2f1;
    color: #00796b;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.badge-vibe {
    font-size: 0.75rem;
    color: #666;
    margin-left: 10px;
}

.salario-destacado {
    color: #2e7d32;
    font-weight: 700;
    display: block;
    margin-top: 5px;
}

.btn-mision {
    width: 100%;
    margin-top: 15px;
    background: #003366;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* --- DISEÑO DE DOS COLUMNAS --- */
.dashboard-flex {
    display: flex;
    gap: 30px; 
    align-items: flex-start;
    margin-top: 20px;
}

.columna-misiones {
    flex: 0 0 35%; 
    background: #f0fdfa; 
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #00bfa5;
}

.columna-publicadas {
    flex: 1;
}

.titulo-seccion-mini {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--azul-quetzal);
    border-bottom: 2px solid var(--verde-quetzal);
    padding-bottom: 10px;
    text-align: left;
}

#vacantesRecomendadas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.config-inicial-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    text-align: center;
    border: 2px solid var(--verde-quetzal);
    z-index: 100000;
}

.modal-bloqueo {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(4px);
}

.modal-contenido-quetzal {
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--verde-quetzal);
    position: relative;
    animation: aparecerModal 0.3s ease-out;
}

@keyframes aparecerModal {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Notificación Pop de Verificación */
.toast-verificado {
    position: fixed;
    top: 20px; right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-left: 5px solid #00bfa6;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

.toast-verificado.show { transform: translateX(0); }

.toast-icon-wrapper {
    background: #e0fcf8;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 20px;
}

.toast-content h4 { margin: 0; color: #16355d; font-size: 1rem; }
.toast-content p { margin: 0; color: #666; font-size: 0.85rem; }

/* ================================================================
   8. MEDIA QUERIES (ADAPTACIÓN MÓVIL)
   ================================================================ */
@media (max-width: 1000px) {
    .dashboard-flex { flex-direction: column; }
    .columna-misiones, .columna-publicadas { width: 100%; flex: none; }
}

@media (max-width: 850px) {
    .header { flex-direction: column; text-align: center; gap: 15px; }
    .search-section, .logo, .header-right { width: 100%; justify-content: center; align-items: center; }
    .modal-grid-container { grid-template-columns: 1fr; }
    .col-stats { border-left: none; border-top: 1px solid #edf2f7; }
}

@media (max-width: 480px) {
    .vacantes-grid { grid-template-columns: 1fr; }
    .barra-filtros { flex-direction: column; width: 100%; }
    .barra-filtros input, .barra-filtros select, .barra-filtros button { width: 100%; }
}

/* ================================================================
   9. COMPONENTE: SWITCH DE PRIVACIDAD DE WHATSAPP (ULTRAESPECÍFICO)
   ================================================================ */
.contenedor-privacidad-whatsapp {
    animation: aparecerModal 0.4s ease-out;
}

/* El contenedor estructural que envuelve al input y al fondo del switch */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
}

/* Escondemos por completo el checkbox nativo de HTML */
.switch-container input[type="checkbox"] {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
}

/* El fondo base del switch cuando está APAGADO (Gris) */
.switch-container .slider-round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e0 !important; /* Gris suave por defecto */
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

/* La bolita blanca interior que se desliza */
.switch-container .slider-round:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--blanco) !important;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* 🚀 EL CAMBIO DE COLOR: Cuando está PRENDIDO (Verde WhatsApp) */
.switch-container input[type="checkbox"]:checked + .slider-round {
    background-color: #25D366 !important; /* Fuerza el color verde */
}

/* 🚀 EL MOVIMIENTO: Desplaza la bolita blanca a la derecha al prenderse (20px exactos) */
.switch-container input[type="checkbox"]:checked + .slider-round:before {
    transform: translateX(20px) !important;
}

/* Bloqueo visual translúcido mientras realiza el fetch PUT silencioso al backend */
.switch-container input:disabled + .slider-round {
    opacity: 0.6;
    cursor: not-allowed;
}