/* =========================================================================
   VARIABLES GLOBALES
   ========================================================================= */
:root{
  --sidebar-width: 250px;   /* ancho único para TODOS los sidebars */
  --toggle-size: 36px;      /* diámetro del botón burbuja */
}

/* =========================================================================
   LAYOUT BASE
   ========================================================================= */
body {
  font-family: 'Onest', sans-serif;
  background-color: #fdf4ee;
  color: #000;
  margin: 0;
  padding: 0;
  display: flex;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.sidebar {
  width: var(--sidebar-width);
  background-color: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sidebar .logo {
  width: 100px;
  margin-bottom: 30px;
}
.sidebar .menu-item {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 180px;
  height: 50px;
  margin: 10px 0;
  padding: 0 20px;
  text-decoration: none;
  color: #0044ff;
  border: 2px solid #0044ff;
  border-radius: 30px;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  transition: background-color 0.3s, color 0.3s;
  box-sizing: border-box;
}
.sidebar .menu-item.active,
.sidebar .menu-item:hover {
  background-color: #0044ff;
  color: #fff;
}

/* =========================================================================
   BOTÓN BURBUJA (toggle del sidebar)
   ========================================================================= */
.sidebar-wow-toggle{
  position: fixed;
  top: 20px;
  left: calc(var(--sidebar-width) - (var(--toggle-size) / 2));
  width: var(--toggle-size);
  height: var(--toggle-size);
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  cursor: pointer;
  transition: left .3s ease, transform .3s ease, background .3s ease;
}
.sidebar-wow-toggle:hover { background: #f0f0f0; transform: scale(1.1); }
.sidebar-wow-toggle i { font-size: 16px; transition: transform 0.3s ease; }
.rotated-icon { transform: rotate(180deg); }

/* Estado con sidebar oculto */
.custom-sidebar-hidden { display: none !important; }
.custom-sidebar-hidden + .sidebar-wow-toggle{ left: 12px; }

/* Expansión del main cuando se oculta el sidebar */
.custom-main-expanded {
  margin-left: 0 !important;
  width: calc(100% - 12px);
  transition: all 0.3s ease;
}

/* En móviles, forzamos la burbuja a 12px para evitar desalineados */
@media (max-width: 900px){
  .sidebar { display: none; }
  .sidebar-wow-toggle{ left: 12px; }
}

/* =========================================================================
   CONTENIDO PRINCIPAL
   ========================================================================= */
.main-content {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
}

/* =========================================================================
   TOP BAR (Nuevo candidato)
   ========================================================================= */
.filters-top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  background-color: #0044ff;
  border-radius: 20px;
  padding: 20px 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.filters-top-bar .new-btn {
  background-color: #cdff30;
  color: #000;
  font-weight: bold;
  border: none;
  padding: 10px 25px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}
.filters-top-bar .new-btn:hover { background-color: #b6ea2a; }

/* =========================================================================
   TÍTULO DE PÁGINA
   ========================================================================= */
.title-container {
  background-color: #0044ff;
  border-radius: 20px;
  padding: 20px 30px;
  margin-bottom: 20px;
}
.page-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

/* =========================================================================
   TABLA: #candidatesTable
   ========================================================================= */
#candidatesTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  background-color: #fff;
  border-radius: 20px;
  padding: 20px 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  table-layout: auto;
}
#candidatesTable thead th,
#candidatesTable tbody td {
  padding-left: 24px;
  padding-right: 24px;
  white-space: nowrap;
}
#candidatesTable thead th {
  background-color: transparent;
  text-align: left;
  padding-top: 12px;
  padding-bottom: 12px;
  font-weight: 600;
  color: #000;
  border-bottom: 2px solid #f0f0f0;
  font-size: 14px;
}
#candidatesTable tbody tr {
  position: relative;
  background: linear-gradient(to right, #ffffff 0%, #ffffff 100%);
  background-size: 200% 100%;
  background-position: left center;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.04);
  transition: background-position 1s ease, transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}
#candidatesTable tbody tr:hover {
  background: linear-gradient(to right, #e6f0ff 0%, #ffffff 100%);
  background-size: 200% 100%;
  background-position: right center;
  box-shadow: 0 0 20px rgba(0, 68, 255, 0.2), 0 0 40px rgba(0, 68, 255, 0.1);
  z-index: 2;
  position: relative;
}
#candidatesTable tbody td {
  padding-top: 12px;
  padding-bottom: 12px;
  font-size: 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f9f9f9;
}
#candidatesTable tbody td:nth-last-child(2),
#candidatesTable tbody td:last-child {
  padding-left: 50px;
  padding-right: 50px;
}

/* Alineaciones específicas (Country / WhatsApp) */
#candidatesTable tbody td:nth-child(3),
#candidatesTable tbody td:nth-child(4),
#candidatesTable thead th:nth-child(3),
#candidatesTable thead th:nth-child(4){
  text-align: center;
}

/* =========================================================================
   FILTROS POR COLUMNA
   ========================================================================= */
.column-filter {
  cursor: pointer;
  margin-left: 8px;
  color: #0044ff;
  font-size: 14px;
}
.filter-dropdown {
  position: absolute;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 10px;
  z-index: 1000;
  width: 200px;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 5px;
}
.filter-dropdown input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}
.filter-dropdown .checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-dropdown .checkbox-list label {
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* =========================================================================
   BOTONES-ICONO
   ========================================================================= */
.icon-button {
  background-color: #eaf0ff;
  border: none;
  border-radius: 50%;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.3s, box-shadow 0.3s;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.icon-button i { color: #0044ff; }
.icon-button.whatsapp i { color: #25D366; }
.icon-button.linkedin i { color: #0077b5; }
.icon-button:hover {
  transform: scale(1.2) rotate(1deg);
  background-color: #dce9ff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =========================================================================
   ANIMACIONES
   ========================================================================= */
@keyframes fadeInSlide {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes blink{
  0%, 80%, 100% { opacity:.2; transform: translateY(0); }
  40% { opacity:1; transform: translateY(-2px); }
}

/* =========================================================================
   CONTROLES DE TABLA (DataTables + búsqueda)
   ========================================================================= */
.table-controls-wrapper {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  margin: 0 1.5rem 1rem !important;
  gap: 1rem !important;
  width: 100%;
}

/* Lados izquierdo/derecho del toolbar */
.left-controls {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex: 1;
}
.right-controls {
  display: flex !important;
  justify-content: flex-end !important;
  width: 230px !important;
  flex: 1;
}

/* Input de búsqueda (limpio y compacto) */
.name-search-input {
  padding: 6px 12px !important;
  border-radius: 999px !important;
  border: 1px solid #ccc !important;
  height: 34px !important;
  font-size: 13px !important;
  width: 200px !important;
  outline: none !important;
  background-color: #fff !important;
  font-family: 'Onest', sans-serif !important;
  transition: all 0.3s ease !important;
  box-shadow: none !important;
  margin-right: 25px;
}
.name-search-input:focus {
  border-color: #f5cfdb !important;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.25) !important;
}
.name-search-input::placeholder { color: #000 !important; opacity: 0.4 !important; }

/* Select redondo (DataTables length) */
.dataTables_length {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.5rem !important;
  font-size: 14px !important;
  width: 100% !important;
}
.dataTables_length label {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  font-size: 14px;
}

/* Estilo del select + caret SVG inline */
.dataTables_length select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 6px 12px;
  width: 80px;
  font-size: 13px;
  font-family: 'Onest', sans-serif;
  text-align-last: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M1 1L5 5L9 1' stroke='%230044FF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}
.dataTables_length select:hover { box-shadow: 0 0 4px rgba(0, 68, 255, 0.15); }

/* =========================================================================
   HOVERS EN FILAS (otras tablas con mismo patrón)
   ========================================================================= */
#accountTable tbody tr:hover,
#candidatesTable tbody tr:hover,
#opportunityTable tbody tr:hover { cursor: pointer; }

/* =========================================================================
   UTILERÍA
   ========================================================================= */
.gray-x { color: #999; font-size: 16px; }

/* =========================================================================
   CHIPS DE ESTADO
   ========================================================================= */
.status-chip{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:86px; height:28px; padding:0 10px;
  border-radius:999px; font-size:12px; font-weight:600;
  border:1px solid transparent; text-transform:lowercase;
}
.status-active  { background:#E6F5EC; border-color:#BDE5CD; color:#146C2E; }
.status-inactive{ background:#FDE8E7; border-color:#F5B5B0; color:#B42318; }
.status-unhired { background:#EEF1F5; border-color:#D6DBE3; color:#374151; }

/* Loader de 3 puntos dentro del chip */
.status-chip.loading{
  background:transparent; border-color:transparent; min-width:42px; height:20px; padding:0;
}
.status-chip.loading .dot{
  width:6px; height:6px; border-radius:50%;
  background:#9AA3AF; margin:0 2px; display:inline-block;
  animation: blink 1s infinite ease-in-out;
}
.status-chip.loading .dot:nth-child(2){ animation-delay:.2s; }
.status-chip.loading .dot:nth-child(3){ animation-delay:.4s; }

/* =========================================================================
   FILTROS (Status / Model) — pill style como el buscador
   ========================================================================= */
.filters-bar{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Select redondo y limpio, mismo alto del input de búsqueda */
.filter-select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  height: 34px;                     /* = .name-search-input */
  padding: 6px 36px 6px 12px;       /* espacio para el caret */
  border-radius: 999px;             /* pill */
  border: 1px solid #ccc;
  background-color: #fff;
  font-family: 'Onest', sans-serif;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  outline: none;
  transition: all .3s ease;
  box-shadow: none;

  /* caret SVG igual a los selects de DataTables */
  background-image: url("data:image/svg+xml;charset=UTF-8,<svg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M1 1L5 5L9 1' stroke='%230044FF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
  text-align-last: left;            /* texto alineado como un input */
}

/* Hover / focus para sensación “input” */
.filter-select:hover{
  box-shadow: 0 0 4px rgba(0, 68, 255, 0.15);
}
.filter-select:focus{
  border-color: #f5cfdb;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.25);
}

/* Tamaños responsivos coherentes con el buscador */
@media (min-width: 901px){
  .filter-select{ min-width: 160px; }
}
@media (max-width: 900px){
  .filter-select{ min-width: 140px; }
}
/* Sidebar needs to be a column so the profile can pin to bottom */
.sidebar {
  display: flex;
  flex-direction: column;
}

/* Profile tile styles */
.profile-tile{
  margin-top: auto;               /* pins to bottom of the column */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .3s ease;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 4px 14px rgba(0,0,0,.08) inset, 0 2px 10px rgba(0,0,0,.04);
  color: inherit;
}
body.dark-mode .profile-tile{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
}
.profile-tile:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,.10);
}

/* Avatar circle */
.profile-avatar{
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 42px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.85), rgba(255,255,255,.35));
  border: 1px solid rgba(255,255,255,.5);
}
.profile-avatar img{
  width: 100%;
  height: 100%;
  display: none;          /* toggled ON by JS if we have an avatar */
  object-fit: cover;
}
.profile-initials{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: .3px;
  user-select: none;
}

/* Name + email */
.profile-meta{ display:flex; flex-direction:column; line-height: 1.1; }
.profile-name{ font-weight: 700; font-size: 14px; }
.profile-email{ font-size: 12px; opacity: .75; }

/* Respect your sidebar collapse if you have one */
.custom-sidebar-hidden .profile-tile{ display: none; }

/* Si *algo* lo oculta, que al menos el tile se vea */
.profile-tile { display: flex !important; }
/* Sidebar: full-height column pinned to the viewport */
.sidebar{
  position: sticky;      /* stays put while main content scrolls */
  top: 0;
  height: 100vh;         /* fill viewport height */
  display: flex;
  flex-direction: column;
  overflow-y: auto;      /* sidebar scrolls if it has a lot of items */
  padding-bottom: 14px;  /* breathing room for the sticky tile */
}
/* Profile tile: always visible at bottom-left of the sidebar */
.profile-tile{
  position: sticky;
  bottom: 12px;          /* distance from the bottom edge */
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .3s ease;
  background: rgba(255,255,255,.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 4px 14px rgba(0,0,0,.08) inset, 0 2px 10px rgba(0,0,0,.04);
  color: inherit;
  z-index: 1;            /* sit above sidebar content if it overlaps */
}

/* If your sidebar can collapse, keep hiding it there */
.custom-sidebar-hidden .profile-tile{ display:none; }
/* —— Cute initials avatar —— */
.profile-tile .profile-avatar{
  --size: 42px;
  --radius: 999px;
  --ring: 2px;
  --bg1: #5da8ff;         /* top-left gradient */
  --bg2: #2563eb;         /* bottom-right gradient (brand blue) */
  --glow: rgba(37,99,235,.28);

  width: var(--size);
  height: var(--size);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: radial-gradient(120% 120% at 20% 15%, var(--bg1), var(--bg2));
  box-shadow:
    0 8px 24px var(--glow),
    inset 0 1px 0 rgba(255,255,255,.35);
  transform: translateZ(0); /* smoother */
}

/* subtle glass ring */
.profile-tile .profile-avatar::before{
  content:"";
  position:absolute; inset:0;
  border-radius: inherit;
  padding: var(--ring);
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.25));
  -webkit-mask:
    radial-gradient(#000 70%, transparent 71%) content-box,
    radial-gradient(#000 70%, transparent 71%);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events:none;
}

/* tiny glossy highlight */
.profile-tile .profile-avatar::after{
  content:"";
  position:absolute;
  inset:auto 6px 55% 6px;
  height: 36%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0));
  filter: blur(1px);
  pointer-events:none;
}

/* initials */
.profile-tile .profile-initials{
  display:grid; place-items:center;
  width:100%; height:100%;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .6px;
  color:#fff;
  text-shadow:
    0 1px 0 rgba(0,0,0,.15),
    0 8px 18px rgba(0,0,0,.18);
  user-select:none;
}

/* never show image */
.profile-tile .profile-avatar img{ display:none !important; }

/* gentle micro-interaction */
.profile-tile .profile-tile:hover .profile-avatar,
.profile-tile:hover .profile-avatar{
  transform: translateY(-1px);
  box-shadow:
    0 12px 28px var(--glow),
    inset 0 1px 0 rgba(255,255,255,.38);
}
/* ===== Floating Logout Button (bottom-right) ===== */
.logout-fab {
  position: fixed;
  bottom: 20px;
  right: 24px;
  z-index: 10001;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #ffffff;
  color: #0044ff;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  font-family: 'Onest', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.logout-fab i {
  font-size: 14px;
}

.logout-fab:hover {
  background: #fdf4ee;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

.logout-fab:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

@media (max-width: 900px) {
  .logout-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
  }
}