/* =========================================================
   PORTAL THEME (UNIFICADO)
   - Variables + temas
   - Base
   - Layout portal
   - Jobs cards + modal
   - Navbar + theme picker
   ========================================================= */

/* ===========================
   TEMA CLARO (default)
   =========================== */
:root{
  --brand:#2563eb;
  --brand-2:#38bdf8;
  --brand-3:#4ad17c;

  --bg-page:#f5f7fb;
  --panel:#e2f7f0;
  --panel-2:#f9fafb;

  --text:#0b1220;
  --muted:#475569;

  --line:rgba(2,6,23,.08);
  --shadow: 0 14px 36px rgba(2,6,23,.08);

  --radius:16px;
}

/* ===========================
   TEMA OSCURO
   =========================== */
html[data-theme="dark"]{
  --bg-page:#69c8e0;
  --panel:#27a8f3;
  --panel-2:#7dc1c4;

  --text:#1a1b1b;
  --muted:#333435;

  --line:rgba(183,196,216,.26);
  --shadow:0 12px 28px rgba(10,20,40,.35);
}

/* ===========================
   TEMA INDIGO
   =========================== */
html[data-theme="indigo"]{
  --brand:#c2ccf3;
  --brand-2:#79c0ff;
  --brand-3:#22c55e;

  --bg-page:#184ce7;
  --panel:#2559f3;
  --panel-2:#05175a;

  --text:#e8eefc;
  --muted:#b8c2e6;

  --line:rgba(124,138,196,.28);
  --shadow:0 12px 28px rgba(20,57,204,.35);
}

/* ===========================
   TEMA SAND
   =========================== */
html[data-theme="sand"]{
  --brand:#d97706;
  --brand-2:#f59e0b;
  --brand-3:#16a34a;

  --bg-page:#f5efe6;
  --panel:#ffffff;
  --panel-2:#faf6ee;

  --text:#2b2b2b;
  --muted:#6b7280;

  --line:rgba(0,0,0,.08);
  --shadow:0 14px 36px rgba(50,35,0,.08);
}

/* ===========================
   BASE
   =========================== */
html,body{
  background:var(--bg-page);
  color:var(--text);
  overflow-x:hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*{
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

/* ===========================
   THEME PICKER
   =========================== */
.theme-picker{
  position:fixed;
  right:16px;
  top:12px;
  z-index:1030;
  display:inline-flex;
  align-items:center;
  gap:6px;
  border-radius:999px;
  padding:6px 10px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  box-shadow:var(--shadow);
  font-size:10px;
}
.theme-picker select{
  background:transparent;
  color:var(--text);
  border:0;
  outline:0;
  font-size:10px;
  font-weight:600;
  appearance:none;
  cursor:pointer;
}
.theme-picker select option{ color:#0b1220; }

/* ===========================
   HEADER / PROGRESS (si aplica)
   =========================== */
.progress{
  background:rgba(56,189,248,.15);
  height:8px;
  border-radius:999px;
  overflow:hidden;
}
.progress .progress-bar{
  background:linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* ===========================
   JOBS WRAPPER
   =========================== */
main#jobs{
  background:var(--panel);
  border-radius:18px;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  padding:1.25rem 1.25rem 1.75rem !important;
}

/* ===========================
   JOB CARD
   =========================== */
#list .job-card{ text-align:left !important; }

.job-card{
  position:relative;
  border-radius:14px;
  border:1px solid var(--line);
  background:linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  box-shadow:var(--shadow);
  padding:1rem .9rem .75rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;

  max-width:100%;
  min-height:440px;
  margin:.18rem 0;

  display:flex;
  flex-direction:column;
}
.job-card:hover{
  transform:translateY(-3px);
  box-shadow:0 12px 26px rgba(15,23,42,.16);
  border-color:var(--brand);
  background:var(--panel);
}

/* ===========================
   ✅ IMAGEN UNIFICADA EN TODAS LAS CARDS
   - marco fijo
   - imagen arriba centrada
   - no “explota” aunque sea gigante
   =========================== */
/* ✅ IMAGEN UNIFICADA EN TODAS LAS CARDS (más chica) */
#list .job-card .job-media{
  position:relative;
  height: 260px;          /* antes 320px */
  flex: 0 0 260px;        /* antes 320px */
  display:flex;
  align-items:flex-start;
  justify-content:center;
  overflow:hidden;
  padding-top:8px;
}

/* La imagen dentro del marco, pero no ocupa todo el alto */
#list .job-card .job-media .job-media__img{
  width: 100%;
  height: auto;           /* <- clave: no fuerza 100% */
  max-height: 220px;      /* <- limita el tamaño real */
  object-fit: contain;
  object-position: top center;
  display:block;
}




/* fallback avatar */
.job-media__avatar{
  width:32px;
  height:32px;
  border-radius:8px;
  background:var(--brand);
  color:var(--panel);
  display:grid;
  place-items:center;
  font-weight:600;
  font-size:.72rem;
}

/* fav */
.job-media__fav{
  padding:1px 5px;
  border-radius:999px;
  background:var(--panel) !important;
  border-color:var(--line) !important;
  box-shadow:var(--shadow);
}
.job-media__fav i{ font-size:.75rem; }

/* status */
.job-media__status{ font-weight:600; font-size:.6rem; }
.job-media__status .badge.bg-success{ background-color:#16a34a !important; color:#fff !important; }
.job-media__status .badge.bg-danger{  background-color:#dc2626 !important; color:#fff !important; }
.job-media__status .badge.bg-warning{ background-color:#fbbf24 !important; color:#111827 !important; }

/* text */
.job-title{
  font-weight:700;
  color:var(--text);
  font-size:1.12rem;
  margin-bottom:.2rem !important;
  line-height:1.32;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.job-company{
  color:var(--brand);
  font-size:.85rem;
  margin-bottom:.16rem;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
  font-weight:500;
}
.job-meta{
  color:var(--muted);
  font-size:.75rem;
  margin:0 0 .22rem;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}
.tag{
  background:rgba(63,81,181,.04);
  color:var(--brand);
  padding:.12rem .5rem;
  border-radius:999px;
  font-size:.65rem;
  border:1px solid rgba(148,163,253,.35);
}

/* footer */
.job-footer{
  margin-top:auto;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:.4rem;
}
.job-footer .small{
  font-size:.8rem;
  line-height:1.35;
  color:var(--muted);
}
.job-footer .label{
  font-weight:600;
  color:var(--text);
  margin-right:3px;
}
.job-footer .btn-sm{
  font-size:.72rem;
  padding:.18rem .42rem;
  border-radius:6px;
  min-width:auto;
  white-space:nowrap;
}
.job-footer .btn-outline-primary{
  border-color:#e5e7eb;
  background-color:#f9fafb;
  color:#111827;
}
.job-footer .btn-outline-primary:hover{
  background-color:#e5e7eb;
  border-color:#e5e7eb;
  color:#111827;
}
.job-footer .btn-primary{
  background-color:var(--brand);
  border-color:var(--brand);
}
.job-footer .btn-primary:hover{
  filter:brightness(.95);
}

@media (max-width: 767.98px){
  #list .job-card .job-media{
    height: 210px;
    flex: 0 0 210px;
  }
  #list .job-card .job-media .job-media__img{
    max-height: 180px;
  }
}


/* empty */
.empty{
  padding:2.1rem 1rem;
  text-align:center;
  color:var(--muted);
  border:2px dashed var(--line);
  border-radius:14px;
  background:var(--panel);
  font-size:.82rem;
}

/* ===========================
   MODAL DETALLE (vista_prueba)
   =========================== */
.modal-job-dialog{ max-width:880px; }

.modal-job .modal-content{
  background:var(--panel);
  color:var(--text);
  border-radius:20px;
  border:1px solid var(--line);
  box-shadow:0 24px 70px rgba(15,23,42,.35);
  overflow:hidden;
}
.modal-job__header{
  background:linear-gradient(135deg, rgba(37,99,235,.98), rgba(15,23,42,.98));
  color:#fff;
  padding:16px 22px;
  border-bottom:none;
}
.modal-job__avatar{
  width:54px;
  height:54px;
  border-radius:16px;
  background:rgba(15,23,42,.18);
  display:grid;
  place-items:center;
  font-weight:700;
  font-size:1.05rem;
}
.modal-job__header h5{
  font-size:1.25rem;
  font-weight:700;
  margin-bottom:2px;
}
.modal-job__header .modal-subtitle,
.modal-job__header .modal-infobar{
  font-size:.8rem;
  color:rgba(226,232,240,.9);
}
.modal-job__header .modal-infobar{ font-size:.72rem; }

#mdStatus{
  border-radius:999px;
  font-size:.68rem;
  padding:.16rem .65rem;
  border:none;
}
#mdStatus.badge-active{ background:#16a34a !important; }
#mdStatus.badge-paused{ background:#fbbf24 !important; color:#111827 !important; }
#mdStatus.badge-closed{ background:#64748b !important; }

.modal-body{
  padding:18px 22px 10px;
  font-size:.9rem;
  line-height:1.7;
}
#mdTags{
  display:flex;
  flex-wrap:wrap;
  gap:.35rem;
  margin-bottom:10px;
}
#mdTags .tag{ font-size:.7rem; }

.modal-section{ margin-bottom:18px; }
.modal-section__title{
  font-size:.78rem;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.13em;
  color:var(--brand);
  margin-bottom:4px;
  display:flex;
  align-items:center;
  gap:6px;
}
.modal-section__content,
.modal-section__list{
  font-size:.9rem;
  color:var(--text);
  line-height:1.7;
}
.modal-section__list{
  padding-left:1.1rem;
  margin-bottom:0;
}
.modal-section__list li{ margin-bottom:4px; }

.modal-job__footer{
  padding:12px 22px 14px;
  border-top:1px solid var(--line);
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--panel-2);
}
.modal-job__footer .small{
  font-size:.75rem;
  color:var(--muted);
}

@media (max-width: 767.98px){
  .modal-job-dialog{ max-width:100%; margin:.5rem; }
  .modal-job__header{ padding:12px 14px; }
  .modal-body{ padding:14px 14px 8px; }
  .modal-job__footer{
    padding:10px 14px 12px;
    flex-direction:column;
    align-items:flex-start;
  }
}

/* ===========================
   NAV LINKS (hover + active)
   =========================== */
.navbar-nav .nav-link{
  color:var(--text) !important;
  border-radius:12px;
  padding:.45rem .85rem;
  margin:0 .15rem;
  border:1px solid transparent;
  position:relative;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease, color .18s ease, border-color .18s ease;
}
.navbar-nav .nav-link:hover{
  background:linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border-color:var(--line);
  box-shadow:var(--shadow);
  transform:translateY(-1px);
}
.navbar-nav .nav-link.active{
  background:var(--brand) !important;
  color:#fff !important;
  border-color:rgba(255,255,255,.18);
  box-shadow:0 10px 22px rgba(15,23,42,.18);
  font-weight:700;
}
.navbar-nav .nav-link::after{
  content:"";
  position:absolute;
  left:14px;
  right:14px;
  bottom:6px;
  height:2px;
  background:var(--brand);
  border-radius:999px;
  transform:scaleX(0);
  transform-origin:left;
  transition:transform .18s ease;
  opacity:.9;
}
.navbar-nav .nav-link:hover::after{ transform:scaleX(1); }
.navbar-nav .nav-link.active::after{
  background:rgba(255,255,255,.9);
  transform:scaleX(1);
}
.navbar-nav .nav-link:focus-visible{
  outline:3px solid rgba(63,81,181,.35);
  outline-offset:2px;
}

/* Extra: “Postular” como botón suave */
#lnkPostular{ border:1px solid var(--brand); }
#lnkPostular:hover{
  border-color:var(--brand);
  box-shadow:0 12px 26px rgba(15,23,42,.16);
}
/* =========================================================
   JOB CARD: barra superior (estado + fav) arriba de la imagen
   ========================================================= */

#list .job-card .job-media{
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;

  /* mantenemos el marco fijo */
  height: 260px !important;
  flex: 0 0 260px !important;

  overflow: hidden !important;
  padding: 8px 0 0 !important;
}

/* La barra arriba (ya no overlay) */
#list .job-card .job-media__top{
  position: relative !important;  /* quita absolute */
  top: auto !important;
  right: auto !important;
  left: auto !important;

  width: 100% !important;
  padding: 0 8px !important;

  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 6px !important;

  z-index: 3 !important;
  order: 0 !important;            /* <- arriba */
}

/* Imagen debajo */
#list .job-card .job-media .job-media__img{
  order: 1 !important;            /* <- debajo */
  width: 100% !important;
  height: auto !important;
  max-height: 200px !important;   /* un poco más chica para que entre con la barra */
  object-fit: contain !important;
  object-position: top center !important;
  display: block !important;
}

/* Avatar fallback debajo también */
#list .job-card .job-media__avatar{
  order: 1 !important;
}
/* Alto del carrusel (marco) */
/* Marco del carrusel (achica el contenedor) */
/* === SOLO VIDEO DEL HERO (mismo tamaño que las imágenes) === */

/* HERO: el video ocupa EXACTAMENTE lo mismo que las imágenes */
#heroCarousel .carousel-item{
  height: 420px;           /* igual que tus imágenes */
}

#heroCarousel video.hero-video{
  width: 100% !important;
  height: 420px !important;
  object-fit: cover;       /* se ve “como imagen” (sin deformar) */
  display: block;
}

/* Mobile (igual que tus imágenes en mobile) */
@media (max-width: 991px){
  #heroCarousel .carousel-item{ height: 260px; }
  #heroCarousel video.hero-video{ height: 260px !important; }
}
