@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* --- Estilos del Directorio REPAE --- */

/* 1. Contenedor Principal */
#repae-directory-container {
    width: 100%;
    max-width: 1440px;
    margin: 40px auto;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2b303a;
    padding: 0 20px;
    box-sizing: border-box;
}

@media (min-width: 992px) {
    #repae-directory-container {
        display: grid;
        grid-template-columns: 290px 1fr;
        gap: 35px;
        align-items: flex-start;
    }
}

#repae-directory-container * {
    box-sizing: border-box;
}

/* 2. Formulario de Filtros Premium */
#repae-filters {
    background: #ffffff;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f3f6;
    transition: all 0.3s ease;
}

@media (min-width: 992px) {
    #repae-filters {
        margin-bottom: 0;
        position: sticky;
        top: 120px; /* Offset para no solapar el menú de cabecera pegajoso */
        z-index: 10;
        padding: 20px 18px; /* Reducimos padding para pantallas medianas */
        border-radius: 16px;
    }
}

#repae-filters:hover {
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.06);
}

#repae-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    align-items: flex-end;
}

@media (min-width: 992px) {
    #repae-filter-form {
        display: flex;
        flex-direction: column;
        gap: 12px; /* Más compacto verticalmente */
        align-items: stretch;
    }
}

#repae-filter-form .filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 992px) {
    #repae-filter-form .filter-item {
        gap: 4px; /* Más compacto */
    }
}

#repae-filter-form label {
    font-weight: 600;
    font-size: 0.9em;
    color: #4a5568;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

@media (min-width: 992px) {
    #repae-filter-form label {
        font-size: 0.76em; /* Letra un poco más pequeña */
    }
}

#repae-filter-form input[type="text"],
#repae-filter-form select {
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95em;
    background-color: #f8fafc;
    color: #1a202c;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

@media (min-width: 992px) {
    #repae-filter-form input[type="text"],
    #repae-filter-form select {
        padding: 10px 12px; /* Campos más compactos */
        font-size: 0.9em;
        border-radius: 10px;
    }
}

#repae-filter-form input[type="text"]::placeholder {
    color: #a0aec0;
}

#repae-filter-form input[type="text"]:focus,
#repae-filter-form select:focus {
    outline: none;
    border-color: #d9534f;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(217, 83, 79, 0.12);
}

/* Custom select styling */
#repae-filter-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

@media (min-width: 992px) {
    #repae-filter-form select {
        background-position: right 10px center;
        background-size: 14px;
        padding-right: 32px;
    }
}

#repae-filter-form button#repae-filter-reset {
    padding: 14px 24px;
    background-color: #f8fafc;
    color: #d9534f;
    border: 1.5px solid rgba(217, 83, 79, 0.25);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    width: 100%;
}

@media (min-width: 992px) {
    #repae-filter-form button#repae-filter-reset {
        padding: 10px 16px;
        min-height: 40px;
        font-size: 0.9em;
        border-radius: 10px;
    }
}

#repae-filter-form button#repae-filter-reset:hover {
    background-color: #d9534f;
    color: #ffffff;
    border-color: #d9534f;
    box-shadow: 0 8px 20px rgba(217, 83, 79, 0.2);
    transform: translateY(-1px);
}

/* 3. Contenedor de Resultados (Cargando) */
#repae-results-container {
    transition: opacity 0.25s ease;
}

#repae-results-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 4. Rejilla de Tarjetas (Grid) */
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Tarjetas más pequeñas para vista rejilla */
    gap: 20px; /* Separación más compacta */
    margin-top: 0;
}

/* 5. Tarjeta de Profesional Individual Premium */
.profesional-card {
    background: #ffffff;
    border-radius: 16px; /* Bordes un poco más compactos */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f3f6;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.profesional-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-6px);
}

.profesional-card .profesional-foto {
    position: relative;
    overflow: hidden;
    background-color: #f7fafc;
    aspect-ratio: 4 / 3;
}

.profesional-card .profesional-foto a {
    display: block;
    width: 100%;
    height: 100%;
}

.profesional-card .profesional-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.profesional-card:hover .profesional-foto img {
    transform: scale(1.06);
}

/* Contenido de la tarjeta */
.profesional-card-content {
    padding: 16px; /* Reducimos padding de 24px a 16px */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.profesional-nombre-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
}

.profesional-nombre {
    font-size: 1.15em; /* Reducido de 1.3em para encajar mejor */
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.profesional-nombre a {
    text-decoration: none;
    color: #1a202c;
    transition: color 0.2s ease;
}

.profesional-nombre a:hover {
    color: #d9534f;
}

/* Icono de LinkedIn */
.profesional-linkedin-icon {
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.profesional-linkedin-icon svg {
    width: 22px;
    height: 22px;
    fill: #a0aec0;
    transition: all 0.2s ease;
}

.profesional-linkedin-icon:hover svg {
    fill: #0077b5;
    transform: scale(1.1);
}

/* Estilos de Burbuja de Nivel de Experiencia */
.profesional-card .nivel-tag {
    display: inline-block;
    background: rgba(217, 83, 79, 0.08);
    color: #d9534f;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 8px;
}

/* 6. Mensaje de no resultados */
.no-results {
    background: #ffffff;
    padding: 40px;
    text-align: center;
    border-radius: 20px;
    font-size: 1.1em;
    color: #718096;
    border: 1px solid #edf2f7;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    grid-column: 1 / -1;
}

/* 7. Modal Premium Styles */

/* Prevent background scrolling when modal is open */
body.repae-modal-open {
    overflow: hidden !important;
}

.repae-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.repae-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.repae-modal-wrapper {
    position: relative;
    background: #ffffff;
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2;
    animation: repaeModalScaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

@keyframes repaeModalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.repae-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 24px;
    font-weight: 300;
    color: #4a5568;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.repae-modal-close:hover {
    background-color: #d9534f;
    color: #ffffff;
    border-color: #d9534f;
    transform: rotate(90deg);
}

.repae-modal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.repae-modal-content::-webkit-scrollbar {
    width: 8px;
}
.repae-modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.repae-modal-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

/* Spinner and Loader */
.repae-modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 15px;
}

.repae-spinner {
    width: 48px;
    height: 48px;
    border: 3.5px solid #f1f5f9;
    border-top: 3.5px solid #d9534f;
    border-radius: 50%;
    animation: repaeSpin 0.75s linear infinite;
}

.repae-modal-loader p {
    color: #64748b;
    font-size: 1.05em;
    font-weight: 500;
    margin: 0;
}

@keyframes repaeSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.repae-modal-error {
    text-align: center;
    padding: 60px 20px;
    color: #d9534f;
    font-weight: 600;
    font-size: 1.1em;
}

/* Modal Inner Profile Layout */
.repae-modal-profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    border-bottom: 1.5px solid #f1f5f9;
    padding-bottom: 30px;
    margin-bottom: 30px;
}

.repae-modal-profile-foto {
    flex-shrink: 0;
}

.repae-modal-profile-foto img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.repae-modal-profile-title-block {
    flex-grow: 1;
}

.repae-modal-profile-name {
    font-size: 2em;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.repae-modal-profile-nivel {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Modal Body split columns */
.repae-modal-profile-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

.repae-modal-profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.repae-modal-box {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

.repae-modal-box h3 {
    font-size: 0.9em;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #0f172a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.repae-modal-contact ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.95em;
}

.repae-modal-contact ul li {
    word-break: break-all;
    line-height: 1.5;
}

.repae-modal-contact ul li strong {
    color: #475569;
    display: block;
    margin-bottom: 4px;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.repae-modal-contact ul li a {
    color: #d9534f;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.repae-modal-contact ul li a:hover {
    color: #c9302c;
    text-decoration: underline;
}

.repae-modal-tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.repae-modal-tags li {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    color: #475569;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.repae-modal-profile-main {
    font-size: 1.05em;
    line-height: 1.75;
    color: #334155;
}

.repae-modal-resena {
    background: rgba(217, 83, 79, 0.04);
    border-left: 4px solid #d9534f;
    padding: 20px 24px;
    border-radius: 0 16px 16px 0;
    margin-bottom: 30px;
    font-size: 1.1em;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.6;
}

.repae-modal-resena p {
    margin: 0;
}

.repae-modal-content-full {
    margin-top: 20px;
}

.repae-modal-content-full p {
    margin: 0 0 1.5em 0;
}

.repae-modal-content-full p:last-child {
    margin-bottom: 0;
}

/* Responsiveness for Modal */
@media (max-width: 820px) {
    .repae-modal-profile-body {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .repae-modal-profile-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding-bottom: 25px;
        margin-bottom: 25px;
    }
    .repae-modal-wrapper {
        max-height: 95vh;
        border-radius: 20px;
    }
    .repae-modal-content {
        padding: 30px 24px;
    }
}

/* Overrides para expandir el contenedor en la página de directorio (#2481) */
@media (min-width: 1200px) {
    .page-id-2481 .block-content > .container {
        max-width: 1480px !important;
        width: 100% !important;
    }
}

/* Reducir espaciado excesivo superior */
.page-id-2481 .block-content {
    padding-top: 15px !important;
}

.page-id-2481 #repae-directory-container {
    margin-top: 10px !important;
}

/* Modal Skills Grid and Headers */
.repae-modal-skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.repae-modal-section-title {
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

/* Academic details styling */
.repae-modal-profile-academic {
    margin-top: 14px;
    font-size: 1.05em;
    color: #475569;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.repae-modal-profile-academic .academic-icon {
    font-size: 1.25em;
    color: #d9534f;
}