/* ================================================================
   1. RESET Y CONFIGURACIÓN GLOBAL
   Elimina márgenes por defecto y asegura el cálculo de tamaños.
   ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ajuste para que el Footer siempre esté abajo */
html, body {
    height: 100%; 
    display: flex;
    flex-direction: column;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.5;
    background-color: #f4f4f4;
    color: #333;
    /* Evita el scroll horizontal accidental en celulares */
    overflow-x: hidden; 
}

body > * {
    flex-shrink: 0; 
}

/* ================================================================
   2. HEADER (Encabezado)
   Configuración base para PC.
   ================================================================ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #7bbbfb;
    padding: 0.5rem 1rem;
    height: 90px;
    width: 100%;
    position: relative;
    z-index: 1000;
}

.search-section {
    flex: 1; 
    text-align: left;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo img {
    height: 80px;
    display: block;
}

nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.search-section h2 { 
    font-size: 0.9rem; 
    margin-bottom: 0.2rem; 
}

/* Agrupador para los inputs y el botón de búsqueda */
.busqueda-controles {
    display: flex;
    gap: 5px;
    align-items: center;
}

.search-section input, 
.search-section select, 
.search-section button {
    padding: 0.3rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.search-section button {
    background-color: #00bfa6;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

nav button {
    background-color: #ffffff;
    color: #003366;
    border: 1.5px solid #003366;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

nav button:hover {
    background-color: #003366;
    color: white;
}

/* ================================================================
   3. MODALES, PANEL DIVIDIDO Y UI
   ================================================================ */
.modal, .modal-vacantes {
    display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%;
    overflow-y: hidden; background-color: rgba(0, 0, 0, 0.6); z-index: 9999;
    overflow-y: auto; /* 🔥 permite scroll si se necesita */
}

.modal-content {
    background-color: white; margin: 1.5% auto; padding: 1rem 1.5rem;
    width: 90%; max-width: 750px; border-radius: 12px; position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); display: flex; flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
}

#modalVacantes .modal-content { max-width: 850px; height: 90vh; overflow: hidden; }

.close { position: absolute; top: 0.8rem; right: 1rem; font-size: 1.5rem; cursor: pointer; color: #666; z-index: 10; }

/* ================================================================
   3. PANEL DIVIDIDO (70% Vacantes / 30% Servicios)
   ================================================================ */

.contenedor-principal { 
    flex-grow: 1; 
    display: flex; 
    /* 🚩 Cambiamos el orden visual: Vacantes a la derecha, Servicios a la izquierda */
    flex-direction: row-reverse; 
    gap: 40px; 
    padding: 30px 50px; 
    max-width: 1400px; 
    margin: 0 auto; 
    width: 100%; 
}

/* 🚩 COLUMNA VACANTES (AHORA MÁS GRANDE: 70%) */
.columna-vacantes-recientes { 
    flex: 1.7; /* Ocupa la mayor parte del espacio */
}

/* 🚩 COLUMNA SERVICIOS (AHORA MÁS PEQUEÑA: 30%) */
.columna-servicios { 
    flex: 0.8; /* Se reduce proporcionalmente */
    position: sticky; /* Opcional: para que se quede fijo al bajar */
    top: 110px;
}

/* AJUSTE DE CARDS DE SERVICIO PARA EL ESPACIO PEQUEÑO */
.servicio-item-horizontal {
    display: flex; 
    flex-direction: column; /* Cambiamos a vertical para aprovechar el ancho menor */
    background: #fff; 
    border-radius: 12px; 
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    border-left: none;
    border-top: 5px solid #00bfa6; /* Movemos la línea verde arriba */
    height: auto; 
    transition: transform 0.3s;
}

.servicio-item-horizontal img { 
    width: 100%; 
    height: 100px; 
    object-fit: cover; 
}

.texto-servicio { 
    padding: 15px; 
}

/* AJUSTE DEL RECUADRO DE VACANTES PARA EL ESPACIO GRANDE */
.recuadro-vacantes { 
    background: #ffffff; 
    border: 1px solid #ddd; 
    border-radius: 12px; 
    padding: 25px; 
    height: 600px; /* Le damos más altura para ver más vacantes */
    overflow-y: auto; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
}

.titulo-seccion { font-size: 1.2rem; color: #003366; margin-bottom: 15px; border-bottom: 2px solid #00bfa6; padding-bottom: 5px; display: inline-block; }

.vacante-resumen { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid #f0f0f0; }

.lista-vacantes { flex-grow: 1; margin-top: 15px; padding-right: 5px; overflow-y: auto; }

.lista-vacantes::-webkit-scrollbar { width: 8px; }

.lista-vacantes::-webkit-scrollbar-thumb { background: #00bfa6; border-radius: 10px; }

.vacante-card { background: #fdfdfd; border: 1px solid #e8e8e8; border-left: 5px solid #00bfa6; border-radius: 10px; padding: 1.2rem; margin-bottom: 1rem; cursor: pointer; transition: all 0.3s ease; }

.vacante-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0, 191, 166, 0.15); background-color: #fff; }

.vacante-card h3 { color: #003366; font-size: 1.1rem; margin-bottom: 0.5rem; }

.formulario-moderno h2 { text-align: center; color: #003366; font-size: 1.4rem; margin-bottom: 0.3rem; }

.form-seccion { background: #fdfdfd; border: 1px solid #e8e8e8; border-radius: 10px; padding: 0.8rem; margin-bottom: 0.7rem; }

.form-seccion h3 { font-size: 0.85rem; color: #003366; margin-bottom: 0.6rem; border-left: 4px solid #00bfa6; padding-left: 8px; text-transform: uppercase; }

.form-row { display: flex; gap: 10px; }

.formulario-moderno input, .formulario-moderno textarea { width: 100%; border: 1px solid #d1d1d1; border-radius: 6px; padding: 8px; margin-bottom: 6px; font-size: 0.85rem; }

.btn-moderno, .btn-registrar { background: linear-gradient(135deg, #00bfa6, #00897b); color: white; font-weight: bold; width: 100%; padding: 10px; border-radius: 25px; border: none; cursor: pointer; text-transform: uppercase; }

.badge-estado { display: inline-block; background: #e3f2fd; color: #003366; padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; margin-top: 10px; }

.skeleton-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; }

.skeleton-text { height: 15px; background: #e0e0e0; border-radius: 4px; position: relative; overflow: hidden; }

.skeleton-text::after { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent); animation: loading-shimmer 1.5s infinite; }

@keyframes loading-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ================================================================
   4. NUEVOS ESTILOS PARA MODALES DE NOTIFICACIÓN Y CONFIRMACIÓN
   ================================================================ */

.modal-confirmacion {
    position: fixed; inset: 0; 
    background: rgba(0, 0, 0, 0.7); 
    display: none; align-items: center; justify-content: center; 
    z-index: 30000;
    backdrop-filter: blur(4px); /* Efecto de desenfoque moderno */
}

.modal-contenido-confirmacion {
    background: white; padding: 30px; border-radius: 20px;
    text-align: center; max-width: 400px; width: 90%;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    animation: zoomInQuetzal 0.3s ease-out; /* Animación de entrada */
}

.modal-icono { font-size: 3.5rem; margin-bottom: 15px; display: block; }

.btn-confirmar {
    background: #00bfa6; color: white; border: none;
    padding: 12px 30px; border-radius: 12px; cursor: pointer;
    font-weight: bold; width: 100%; margin-top: 20px;
    transition: transform 0.2s;
}

.btn-confirmar:hover { transform: scale(1.03); }

@keyframes zoomInQuetzal {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* ================================================================
   5. FOOTER Y ESTILOS ESPECÍFICOS
   ================================================================ */

.footer {
    background-color: #7bbbfb;
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    width: 100%;
    margin-top: auto; 
}

#resetModal .modal-content { max-width: 400px; margin: 10% auto; padding: 1.5rem; }

#resetModal h2 { text-align: center; color: #003366; font-size: 1.3rem; margin-bottom: 1rem; border-bottom: 2px solid #00bfa6; padding-bottom: 5px; display: inline-block; align-self: center; }

#resetModal input { width: 100%; border: 1px solid #d1d1d1; border-radius: 6px; padding: 10px; margin-top: 15px; margin-bottom: 10px; font-size: 0.9rem; }

#resetModal #resetMensaje { font-size: 0.8rem; text-align: center; margin-top: 10px; min-height: 1.2rem; }

#enviarReset { margin-top: 10px; background: linear-gradient(135deg, #00bfa6, #00897b); color: white; font-weight: bold; width: 100%; padding: 12px; border-radius: 25px; border: none; cursor: pointer; text-transform: uppercase; transition: 0.3s; }

.closeReset { position: absolute; top: 0.5rem; right: 0.8rem; font-size: 1.2rem; cursor: pointer; color: #999; }

.password-rules-container { max-height: 0; overflow: hidden; opacity: 0; transition: all 0.5s ease; background: #f8f9fa; border-radius: 8px; padding: 0 10px; }

.password-rules-container.visible { max-height: 200px; opacity: 1; padding: 10px; margin-top: 10px; }

.rule-hidden { opacity: 0; height: 0; margin: 0 !important; pointer-events: none; }

.strength-bar { width: 100%; height: 6px; background: #e0e0e0; border-radius: 3px; margin-top: 8px; overflow: hidden; }

.strength-bar div { height: 100%; width: 0%; transition: 0.4s ease; }

.password-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}



/* --- Botón de Contraseña Profesional --- */
.toggle-pass-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #64748b; /* Gris pizarra elegante */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    outline: none;
}

.toggle-pass-btn:hover {
    color: #00bfa6; /* Verde Quetzal al interactuar */
}

/* Tamaño de los iconos SVG */
.toggle-pass-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Espacio interno para que el texto no choque con el icono */
.password-box input {
    padding-right: 45px !important;
}

.btn-secundario-mini { background: #f8f9fa; border: 1px solid #d1d5db; color: #4b5563; padding: 6px 12px; font-size: 0.75rem; border-radius: 20px; cursor: pointer; font-weight: 600; transition: all 0.2s ease; }

.btn-secundario-mini:hover { background: #00bfa6; color: white; border-color: #00bfa6; transform: translateY(-1px); }

.modal-confirm { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 20000; }

.confirm-content { background: white; padding: 30px; border-radius: 15px; text-align: center; max-width: 400px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }

.confirm-icon { font-size: 3rem; margin-bottom: 10px; }

.confirm-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }

.btn-danger { background: #ff4757; color: white; padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; }

.btn-cancel { background: #f1f2f6; color: #2f3542; padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; }

.custom-alert-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 30000; }

.custom-alert-box { background: white; padding: 30px; border-radius: 20px; text-align: center; max-width: 400px; width: 90%; box-shadow: 0 15px 35px rgba(0,0,0,0.3); }

.alert-icon { font-size: 3.5rem; margin-bottom: 15px; }

.alert-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.btn-principal { background: #00bfa6; color: white; border: none; padding: 12px; border-radius: 10px; font-weight: bold; cursor: pointer; font-size: 1rem; }

.btn-link { background: none; border: none; color: #777; cursor: pointer; text-decoration: underline; }

/* ================================================================
   6. 📱 MEDIA QUERIES (AJUSTES ESPECÍFICOS PARA CELULAR)
   ================================================================ */
@media (max-width: 600px) {
    header {
        flex-direction: column; height: auto; padding: 10px; gap: 10px;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh; /* 🔥 evita que se salga de pantalla */
        padding: 1rem;
        border-radius: 10px;
    }

    /* Formularios más compactos */
    .formulario-moderno input,
    .formulario-moderno textarea {
        font-size: 0.8rem;
        padding: 7px;
    }

    @media (max-width: 600px) {

    .columna-servicios {
        position: static; /* 🔥 quita sticky en móvil */
        width: 100%;
    }

    .servicio-item-horizontal {
        width: 100%;
        min-height: auto;
    }

    .texto-servicio {
        padding: 12px;
    }
}

    .form-seccion {
        padding: 0.6rem;
    }

    /* Filas en vertical */
    .form-row {
        flex-direction: column;
        gap: 5px;
    }

    .logo { position: static; transform: none; margin-bottom: 5px; }
    .logo img { height: 60px; margin: 0 auto; }
    .search-section { width: 100%; text-align: center; }
    .busqueda-controles { flex-direction: column; width: 100%; gap: 8px; }
    .search-section input, .search-section select, .search-section button { width: 100%; font-size: 0.75rem; padding: 8px; }
    nav { width: 100%; justify-content: center; gap: 8px; }
    .contenedor-principal {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }

     .columna-vacantes-recientes {
        width: 100%;
    }
    .servicio-item-horizontal { flex-direction: column; height: auto; }
    .servicio-item-horizontal img { width: 100%; height: 120px; }
    .recuadro-vacantes {
        height: auto; /* 🔥 evita altura fija problemática */
        max-height: 400px;
    }
}

.vacante-card {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.privacidad-contenedor {
    margin: 15px 0;
    font-size: 14px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
    color: #4a5568;
}

.checkbox-container input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00bfa5; /* El verde de Quetzal */
}

.checkbox-container a {
    color: #00bfa5;
    text-decoration: underline;
    font-weight: bold;
}

input[name="aceptoPrivacidad"]:disabled ~ .checkmark {
    background-color: #e2e8f0; /* Color gris de bloqueado */
    cursor: not-allowed;
}

#modalPrivacidad {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Oscurece el fondo */
    justify-content: center;
    align-items: center;
    z-index: 9999 !important; /* 🚩 Esto lo obliga a estar al frente de todo */
}

/* También asegúrate de que el contenido del modal sea visible */
#modalPrivacidad .modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Efecto visual para campos autocompletados */
.campo-autollenado {
    animation: brilloVerde 2s ease-in-out;
    border: 1px solid #4caf50 !important;
    background-color: #f1f8e9 !important;
}

@keyframes brilloVerde {
    0% { box-shadow: 0 0 0px #4caf50; }
    50% { box-shadow: 0 0 10px #4caf50; }
    100% { box-shadow: 0 0 0px #4caf50; }
}

/* --- Estilos para el Nuevo Diseño de Vacantes --- */

/* Contenedor principal de las tarjetas */
.tablero-vacantes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}
/* La tarjeta individual */
.vacante-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.vacante-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 191, 166, 0.1);
    border-color: #00bfa6;
}

/* Cabecera de la tarjeta (empresa y status) */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.label-empresa {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.badge-status {
    background: #e6fffa;
    color: #00897b;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Título y Ubicación */
.vacante-card h3 {
    color: #003366;
    font-size: 1.15rem;
    margin-bottom: 8px;
    flex-grow: 1; /* Empuja el footer hacia abajo */
}

.vacante-card .ubicacion {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vacante-card .ubicacion i {
    color: #00bfa6; /* Icono verde */
}

/* Pie de la tarjeta (Botón) */
.card-footer {
    display: flex;
    justify-content: space-between; /* 🔥 separa */
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
    gap: 10px; /* espacio extra por si se comprime */
}

.sueldo-tag {
    color: #2e7d32;
    font-weight: bold;
    font-size: 1.1rem;
    margin-right: 10px; /* 🔥 pequeño respiro */
}

.btn-ver-detalle {
    background: #003366;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-ver-detalle:hover {
    background: #00bfa6;
    transform: translateY(-2px);
}

.item-previa-cv {
    display: inline-flex; /* Cambiamos a inline-flex para alinear icono y texto */
    align-items: center;
    background: #ffffff;
    color: #004d40;
    padding: 8px 14px;
    border-radius: 25px;
    border: 1px solid #b2dfdb;
    margin: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    max-width: 95%; /* Evita que se salga del contenedor si es muy larga */
    word-break: break-word; /* Rompe palabras si es necesario */
}

/* Color diferente para Educación para diferenciarlos rápido */
#listaEducacionPrevia .item-previa-cv {
    border-color: #bbdefb;
    color: #01579b;
}

#resumenAnalisisCV {
    max-height: 280px;
    overflow-y: auto;
    background: #fdfdfd;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #eceff1;
}