/* Reset CSS básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    padding: 20px;
}

/* Barra de navegación */
.navbar {
    background-color: #333;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 5px;
}

.navbar a {
    display: inline-block;
    color: #FFF;
    text-align: center;
    padding: 14px 20px;
    text-decoration: none;
    transition: background-color 0.3s;
    margin-right: -5px;
}

.navbar a:hover {
    background-color: #ddd;
    color: #000;
}

.navbar a.active {
    background-color: #ff004a;
    color: #FFF;
}

/* Contenido principal */
h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

/* Contenedor de talentos */
.talentos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: left;
}

.talento-card {
    background-color: white;
    border-radius: 8px;
    width: 250px;
    text-align: center;
    transition: box-shadow 0.3s;
    height: 300px;
}

.talento-card:hover {
    box-shadow: 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.talento-card:hover .talento-foto img {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.talento-foto {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 300px;
}

.talento-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.talento-nombre-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 10px;
    font-size: 1.3em;
    border-radius: 5px;
}

.talento-links {
    position: absolute;
    top: 247px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: right; /* Centrar los enlaces horizontalmente */
    align-items: center;
    padding: 5px;
    margin-right: 5px;
}

.talento-links a {
    color: #fff;
    text-decoration: none;
    margin: 0;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    transition: background 0.3s;
}

.talento-links a:hover {
    background: rgba(255, 255, 255, 0.4);
}

.talento-links a i {
    font-size: 1.8em; /* Ajusta el valor según lo que necesites */
    font-weight: bold;
}

/* Estilos para la vista de detalles */
.seccion {
    margin-bottom: 30px;
}

.seccion h2 {
    margin-bottom: 10px;
    font-size: 1.5em;
}

.seccion p {
    font-size: 1.1em;
    line-height: 1.6;
}

.seccion ul {
    list-style: none;
    padding: 0;
}

.seccion ul li {
    margin-bottom: 8px;
}

.seccion ul li a {
    text-decoration: none;
    color: #007bff;
}

.seccion ul li a:hover {
    color: #0056b3;
}

/* Estilo del buscador (barra lateral) */
:root {
  --buscador-width: 250px;
  --flap-width: 5px;  /* Ajusta este valor para que la solapa sea del ancho deseado */
}

/* Estilo del buscador (barra lateral) */
.buscador {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--buscador-width);
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  z-index: 1000;
  height: 100%;
  background-color: #FFF;
}

.buscador h2 {
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    text-align: center;
    margin-bottom: 20px;
}

.buscador h3 i {
    color: #ff004a;
}

.buscador-form {

}

.buscador-form input {
    margin-top: 8px;
}

/* Cuando esté colapsado, se desplaza dejando visible una solapa */
.buscador.collapsed {
  transform: translateX(calc(-1 * (var(--buscador-width) - var(--flap-width))));
}

/* Botón de toggle */
.buscador-toggle {
  position: fixed;
  top: 50%;
  /* La posición left se actualizará vía JS, pero se establece un valor por defecto */
  left: var(--buscador-width);
  padding: 8px;
  background-color: #ff004a;
  color: #fff;
  border: none;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  z-index: 1001;
  transition: left 0.3s ease;
}

/* Cuando el buscador está colapsado, el botón se mueve a la solapa */
.buscador.collapsed + .buscador-toggle {
  left: var(--flap-width);
}

/* Contenedor del contenido principal, se desplaza según el estado del buscador */
#main-content {
  transition: margin-left 0.3s ease;
  margin-left: var(--buscador-width);
}

/* Si el buscador está colapsado, reducimos el margen principal */
body.sidebar-collapsed #main-content {
  margin-left: var(--flap-width);
}

/* Estilos para el formulario interno */
.buscador form.buscador-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.buscador .buscador-input {
    padding: 8px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
    margin-bottom: 5px;
}

.buscador .buscador-button {
    padding: 8px;
    background-color: #ff004a;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

/* Estilos para los tags seleccionados */
#selectedTags {
  margin-top: 10px;
}
.selected-tag {
  display: inline-block;
  background: #ff004a;
  color: #fff;
  padding: 5px 10px;
  margin: 2px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
}
.selected-tag .remove-tag {
  margin-left: 5px;
  font-weight: bold;
}

/* Estilos para el listado de tags disponibles */
.tags-list {
  margin-top: 10px;
}
.tags-list .tag {
  display: inline-block;
  background: #eee;
  color: #333;
  padding: 5px 10px;
  margin: 2px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 14px;
}
.tags-list .tag:hover {
  background: #ddd;
}

/* 
   Todo lo relacionado con crear_tag.php va dentro de .crear-tag-page 
   para que no afecte a otras secciones.
*/

.crear-tag-page {
    /* Podrías agregar un fondo distinto si quisieras, o un padding global */
    background: #f9f9f9;
    padding: 20px;
}

.crear-tag-container {
    max-width: 600px;
    margin: 30px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Título */
.crear-tag-container h1 {
    margin-top: 0;
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.crear-tag-container h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

/* Mensaje de éxito */
.crear-tag-exito {
    margin-bottom: 20px;
    font-size: 14px;
    color: #FFF;
    padding: 10px;
    background: #84a920;
    border-radius: 5px;
}

/* Formulario */
.crear-tag-form {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.crear-tag-form label {
    font-weight: bold;
    padding-top: 10px;
}

.crear-tag-form input[type="text"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 380px;
    box-sizing: border-box;
    font-size: 25px;
}

.crear-tag-form button {
    align-self: flex-start;
    padding: 15px 20px;
    background: #ff004a;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}
.crear-tag-form button:hover {
    background: #d3003a;
}


/* Contenedor global de esta página */
.crear-talento-page {
  background: #f9f9f9;
  padding: 20px;
}

/* Contenedor principal */
.crear-talento-container {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.crear-talento-container h1 {
  margin-top: 0;
  font-size: 1.8em;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

/* Formulario */
.crear-talento-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.form-group label {
  display: block;
}

/* Campos de texto */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group select {
  width: 315px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

.label-edad {
    position: absolute;
    margin-left: 446px;
    display: flex;
    font-size: 13px;
}

.form-group input[type="checkbox"] {
    margin-left: 5px; /* Espacio entre el input y el checkbox */
}

/* Botón de submit */
.actions {
  margin-top: 20px;
}
.btn-submit {
  padding: 10px 20px;
  background: #ff004a;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.btn-submit:hover {
  background: #d3003a;
}

.btn-talento {
    width: 100%;
    font-size: 18px;
    font-weight: bold;
}

/* Performance and UX fixes */
.talento-card {
    position: relative;
    overflow: hidden;
}

.talento-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.talento-card-link:focus-visible {
    outline: 3px solid #ff004a;
    outline-offset: 2px;
}

.talento-card .talento-foto {
    height: 100%;
}

.talento-card .talento-nombre-overlay {
    pointer-events: none;
}

.talento-card .talento-links {
    z-index: 2;
    pointer-events: none;
}

.talento-card .talento-links a {
    pointer-events: auto;
    position: relative;
    z-index: 3;
}

.talentos-loader,
.talentos-feedback {
    width: 100%;
    padding: 16px 0;
    text-align: center;
    color: #666;
}

.talentos-sentinel {
    width: 100%;
    height: 1px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 12px;
}

.navbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-brand {
    display: none;
    color: #FFF;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 0.04em;
}

.navbar-links {
    display: flex;
    align-items: stretch;
}

.navbar-menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    color: #FFF;
    font-size: 20px;
    cursor: pointer;
}

.talento-nombre-overlay {
    font-size: 1.02em;
    line-height: 1.15;
    max-width: calc(100% - 64px);
}

.talento-links {
    top: auto;
    left: auto;
    right: 6px;
    bottom: 8px;
    width: auto;
}

@media (max-width: 900px) {
    body {
        padding: 12px;
    }

    .navbar {
        display: block;
        padding: 0;
        overflow: hidden;
    }

    .navbar-header {
        padding: 14px 16px;
    }

    .navbar-brand {
        display: inline-flex;
        align-items: center;
    }

    .navbar-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .navbar-links {
        display: none;
        flex-direction: column;
        border-top: 1px solid rgba(255,255,255,0.12);
    }

    .navbar.is-open .navbar-links {
        display: flex;
    }

    .navbar a {
        display: block;
        margin-right: 0;
        text-align: left;
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    .buscador-toggle {
        display: none;
    }

    .buscador {
        position: static;
        width: 100%;
        height: auto;
        margin-bottom: 12px;
        padding: 16px;
        box-shadow: none;
        border-radius: 8px;
        transform: none !important;
    }

    .buscador h2 {
        display: none;
    }

    #main-content {
        margin-left: 0;
    }

    body.sidebar-collapsed #main-content {
        margin-left: 0;
    }

    .talentos-container {
        gap: 12px;
    }

    .talento-card {
        width: 100%;
        height: auto;
    }

    .talento-foto {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .talento-foto img {
        object-position: center top;
    }

    .talento-nombre-overlay {
        font-size: 0.92em;
        max-width: calc(100% - 58px);
        padding: 5px 8px;
    }

    .talento-links a i {
        font-size: 1.4em;
    }
}

/* Mobile navbar and filter order adjustment */
@media (max-width: 900px) {
    body {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .navbar {
        order: 1;
        margin-bottom: 0;
    }

    .buscador {
        order: 2;
        margin-bottom: 0;
    }

    #main-content {
        order: 3;
    }

    .navbar-links {
        width: 100%;
    }

    .navbar-links a {
        width: 100%;
        padding: 14px 16px;
    }
}

/* Navbar/sidebar alignment fixes */
body.home-page .navbar {
    width: calc(100% - var(--buscador-width) - 0px);
    margin-left: calc(var(--buscador-width) + 0px);
    transition: width 0.3s ease, margin-left 0.3s ease;
}

body.home-page.sidebar-collapsed .navbar {
    width: calc(100% - var(--flap-width) - 0px);
    margin-left: calc(var(--flap-width) + 0px);
}

.ver-talento-page .navbar {
    width: 100%;
    margin-left: 0;
}

@media (max-width: 900px) {
    body.home-page .navbar,
    body.home-page.sidebar-collapsed .navbar,
    .ver-talento-page .navbar,
    .interior-page .navbar,
    .navbar {
        margin-left: 0;
        width: 100%;
    }

    .navbar-header {
        width: 100%;
    }

    .navbar-brand {
        display: inline-flex;
        align-items: center;
        color: #FFF;
        font-weight: bold;
        letter-spacing: 0.04em;
        text-decoration: none;
        pointer-events: none;
    }

    .navbar-links {
        width: 100%;
        padding: 0;
    }

    .navbar-links a,
    .navbar a {
        display: block;
        width: 100%;
        padding: 14px 16px;
        margin-right: 0;
        text-align: left;
    }
}

/* Desktop navbar width fix */
.navbar-header {
    width: auto;
    flex: 0 0 auto;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    color: #FFF;
    font-weight: bold;
    letter-spacing: 0.04em;
    pointer-events: none;
}

.navbar-links {
    flex: 0 0 auto;
    width: auto;
    justify-content: flex-start;
}

.navbar-links a {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .navbar-header {
        width: 100%;
        flex: none;
    }

    .navbar-links {
        width: 100%;
        flex: none;
    }

    .navbar-links a {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 900px) {
    .ver-talento-page {
        display: block;
    }

    .ver-talento-page .navbar {
        order: initial;
        margin-bottom: 12px;
    }

    .interior-page {
        display: block;
    }

    .interior-page .navbar {
        order: initial;
        margin-bottom: 12px;
    }
}
