/* Tailwind base is loaded via CDN. Here we add small custom utilities. */
:root { --ring: 0 0% 0%; }
body { font-feature-settings: "cv02","cv03","cv04","cv11"; }

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.nav-link { color: #0B2F6B; }
.nav-link:hover { text-decoration: underline; }

.mobile-link { padding: 8px 0; color:#0B2F6B; }

.btn-primary { background:#2541B2; color:white; font-weight:700; padding:.75rem 1rem; border-radius:1rem; box-shadow:0 8px 20px rgba(37,65,178,.25); }
.btn-primary:hover { filter:brightness(1.05); transform: translateY(-1px); }
.btn-secondary { background:#FFB703; color:#0B2F6B; font-weight:700; padding:.65rem 1rem; border-radius:1rem; }
.btn-secondary:hover { filter:brightness(1.05); }

.card { background:white; border-radius:1.25rem; padding:1rem; box-shadow:0 10px 30px rgba(0,0,0,.08); border:1px solid #eef2f7; }
.card-title { font-weight:800; color:#0B2F6B; margin-bottom:.5rem; }

.icon-badge { width:40px; height:40px; display:grid; place-items:center; border-radius:9999px; background:#E9EEFF; color:#2541B2; margin-bottom:.5rem; }

.pill { width:32px; height:8px; border-radius:9999px; background:white; opacity:.6; }
.pill.active { opacity:1; background:#FFB703; }

.tabs { display:flex; gap:.5rem; }
.tab { padding:.5rem .75rem; border-radius:.75rem; font-weight:700; color:#0B2F6B; background:#E9EEFF; }
.tab.active { background:#2541B2; color:#fff; }

.form-input { padding:.6rem .75rem; border:1px solid #dbe1ea; border-radius:.75rem; outline:none; }
.form-input:focus { border-color:#2541B2; box-shadow:0 0 0 3px rgba(37,65,178,.15); }

/* Fancy hover for candidate cards */
.card-candidato {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  box-shadow: 0 12px 30px rgba(0,0,0,.12);
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.card-candidato img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform .5s ease;
  display: block;
}

.card-candidato:hover img {
  transform: scale(1.05);
}

.card-candidato .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 40%);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  color: white;
}

.card-candidato .menu {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(11,47,107,.8);
  transform: translateY(100%);
  transition: transform .35s ease;
}

.card-candidato:hover .menu {
  transform: translateY(0);
}

.menu button {
  background: white;
  color: #0B2F6B;
  font-weight: 800;
  border-radius: 9999px;
  padding: .5rem .9rem;
  margin: .25rem;
  box-shadow: 0 10px 20px rgba(0,0,0,.2);
}

@media (max-width: 1023px) {
  .card-candidato {
    max-width: 280px;
  }
}

@media (max-width: 640px) {
  .card-candidato {
    max-width: 100%;
  }
}

/* Simple swiper */
.swiper-wrapper { display:flex; width:100%; transition: transform .6s ease; }
.swiper-slide { flex: 0 0 100%; }


/* Responsive refinements */
@media (max-width: 640px) {
  .swiper { height: 52vh; }
  .card { padding: .85rem; }
  #searchInput { width: 100%; }
  #candidatos .flex { flex-direction: column; gap: .75rem; align-items: flex-start; }
}

/* Ensure hero doesn't overflow and pills clickable on mobile */
#inicio .pill { box-shadow: 0 6px 14px rgba(0,0,0,.15); }
#inicio .absolute.inset-x-0.bottom-4 { pointer-events: auto; }

/* Botón Donar */
.btn-donar { 
  background:#FFB703; 
  color:#0B2F6B; 
  font-weight:700; 
  padding:.5rem 1rem; 
  border-radius:1rem; 
  transition: all .2s ease;
}
.btn-donar:hover { 
  filter:brightness(1.05); 
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* Modal Body Scroll */
.modal-body-scroll {
  overflow-y: auto;
  flex-grow: 1;
}

/* Tab Content Word Wrap */
#tabContent {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Corrección para scroll táctil en el modal móvil */
#modal {
  pointer-events: none;
}

#modal > div {
  pointer-events: auto;
}
/* Estilos para la nueva vista de candidatos por grupos */
.grupo-header {
  border-bottom: 2px solid #eef2f7;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grupo-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0B2F6B;
}

.btn-mostrar-mas {
  background: #E9EEFF;
  color: #2541B2;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color .2s ease;
}

.btn-mostrar-mas:hover {
  background-color: #dbe1ff;
}
.bg-gov-blue { background-color: #1d4ed8; }

.card-candidato{
transition: all .25s ease;
}

.card-candidato:hover{
transform: translateY(-4px);
box-shadow:
0 20px 40px rgba(0,0,0,.08),
0 6px 12px rgba(0,0,0,.04);
}

#btnTop{
position: fixed;
right: 22px;
bottom: 90px;
width: 44px;
height: 44px;
border-radius: 50%;
background: #042e91;
color: white;
font-size: 18px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
box-shadow: 0 10px 25px rgba(0,0,0,0.18);
opacity: 0;
pointer-events: none;
transition: all .25s ease;
z-index: 1000;
}

#btnTop.show{
opacity: 1;
pointer-events: auto;
}

#btnTop:hover{
transform: translateY(-2px);
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.btn-whatsapp{
position: fixed;
right: 22px;
bottom: 22px;
width: 54px;
height: 54px;
background: #25D366;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
transition: all .25s ease;
z-index: 1000;
}

.btn-whatsapp img{
width: 28px;
height: 28px;
}

.btn-whatsapp:hover{
transform: translateY(-3px);
box-shadow: 0 18px 35px rgba(0, 0, 0, 0.25);
}

.grupo-header{
  gap: .75rem;
}

.grupo-header > div{
  min-width: 0;
  flex: 1;
}

.grupo-title{
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 640px){
  .grupo-header{
    align-items: flex-start;
  }

  .grupo-title{
    font-size: 1.6rem;
  }

  .grupo-header img{
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }
}

/* Responsive Modal Candidato */
.modal-body-scroll{
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-tabs{
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.modal-tabs .tab{
  flex: 0 1 auto;
  white-space: nowrap;
  padding: .7rem 1rem;
  font-size: 1rem;
  line-height: 1.1;
}

.modal-tab-content{
  min-width: 0;
}

.modal-tab-content p{
  margin-bottom: 1rem;
}

.modal-tab-content ul,
.modal-tab-content ol{
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

.modal-tab-content li{
  margin-bottom: .6rem;
}

.modal-tab-content h4,
.modal-tab-content h5,
.modal-tab-content h6{
  color: #0B2F6B;
  font-weight: 800;
  line-height: 1.25;
  margin: 1.1rem 0 .65rem;
}

@media (max-width: 767px){
  #modal > div{
    border-radius: 1.5rem;
  }

  #modalTitle{
    font-size: 1.05rem;
    line-height: 1.35;
  }

  .modal-tabs{
    gap: .5rem;
  }

  .modal-tabs .tab{
    padding: .65rem .9rem;
    font-size: .95rem;
    border-radius: .9rem;
  }

  .modal-tab-content{
    font-size: .98rem;
    line-height: 1.7;
  }

  #btnVotar{
    border-radius: 1rem;
    padding: .85rem 1rem;
  }

  #formVoto .form-input,
  #formVoto #submitVoto{
    min-height: 48px;
  }
}

@media (max-width: 480px){
  #modal{
    padding: .75rem;
  }

  #modalTitle{
    font-size: 1rem;
  }

  .modal-tabs{
    gap: .45rem;
  }

  .modal-tabs .tab{
    font-size: .9rem;
    padding: .6rem .85rem;
  }

  .modal-tab-content{
    font-size: .95rem;
    line-height: 1.65;
  }
}

.alerta-encuesta{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.alerta-encuesta-icono{
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  display: block;
  align-self: center;
  margin-top: 0;
}

@media (max-width: 768px){
  #prevAnalisis,
  #nextAnalisis{
    display:none;
  }
}

/* Popup apoyo al proyecto */
#modalApoyo{
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.popup-apoyo-card{
  animation: popupApoyoIn .28s ease;
  width: min(100%, 860px);
  max-height: calc(100dvh - 24px);
}

.popup-apoyo-media{
  min-height: 240px;
  background: linear-gradient(135deg, #0B2F6B 0%, #2541B2 100%);
}

.popup-apoyo-card *{
  min-width: 0;
}

.popup-apoyo-badge{
  max-width: 100%;
  white-space: normal;
  line-height: 1.2;
}

.popup-apoyo-secondary{
  background: #E9EEFF;
  color: #0B2F6B;
  font-weight: 700;
  padding: .75rem 1rem;
  border-radius: 1rem;
}

.popup-apoyo-secondary:hover{
  filter: brightness(.98);
}

@keyframes popupApoyoIn{
  from{
    opacity: 0;
    transform: translateY(16px) scale(.97);
  }
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 767px){
  #modalApoyo{
    padding: .75rem;
    align-items: center;
  }

  .popup-apoyo-card{
    width: 100%;
    max-width: 100%;
    border-radius: 20px;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .popup-apoyo-media{
    min-height: 160px;
    max-height: 34dvh;
  }

  .popup-apoyo-media img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

/* Gestión Colombia */
.gestion-colombia-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1rem;
  overflow: hidden;
}

.gestion-mobile-hint {
  display: none;
  justify-content: center;
}

.gestion-mobile-hint-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #eff6ff;
  color: #0B2F6B;
  border: 1px solid #dbeafe;
  border-radius: 9999px;
  padding: .45rem .85rem;
  font-size: .78rem;
  font-weight: 700;
}

.gestion-scroll-wrap,
.gestion-tabla-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: .35rem;
}

.gestion-scroll-wrap::-webkit-scrollbar,
.gestion-tabla-wrap::-webkit-scrollbar {
  height: 8px;
}

.gestion-scroll-wrap::-webkit-scrollbar-thumb,
.gestion-tabla-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 9999px;
}

.gestion-presidentes-grid {
  display: grid;
  grid-template-columns: 260px repeat(4, 150px);
  width: max-content;
  min-width: 860px;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.gestion-presidente-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gestion-presidente-foto {
  width: 72px;
  height: 72px;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

.gestion-presidente-info {
  margin-top: .55rem;
}

.gestion-presidente-nombre {
  font-size: .9rem;
  font-weight: 800;
  color: #0B2F6B;
  line-height: 1.1;
}

.gestion-presidente-periodo {
  font-size: .75rem;
  color: #64748b;
  margin-top: .15rem;
}

.gestion-tabla {
  width: max-content;
  border-collapse: collapse;
  min-width: 860px;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
}

.gestion-tabla tr + tr {
  border-top: 1px solid #e2e8f0;
}

.gestion-indicador-cell {
  width: 260px;
  padding: 1rem;
  background: #f8fafc;
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
}

.gestion-indicador-wrap {
  display: flex;
  align-items: center;
  gap: .7rem;
}

.gestion-indicador-icono {
  font-size: 20px;
  color: #0B2F6B;
}

.gestion-valor-cell {
  padding: 1rem;
  text-align: center;
  font-size: .9rem;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
}

/* Tablet */
@media (max-width: 1024px) {
  .gestion-presidentes-grid {
    grid-template-columns: 220px repeat(4, 135px);
    min-width: 760px;
    gap: .75rem;
  }

  .gestion-tabla {
    min-width: 760px;
  }

  .gestion-indicador-cell {
    width: 220px;
    padding: .9rem;
    font-size: .88rem;
  }

  .gestion-valor-cell {
    padding: .9rem;
    font-size: .85rem;
  }

  .gestion-presidente-foto {
    width: 60px;
    height: 60px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .gestion-colombia-card {
    padding: .85rem;
    border-radius: 1rem;
  }

  .gestion-mobile-hint {
    display: flex;
  }

  .gestion-presidentes-grid {
    grid-template-columns: 190px repeat(4, 120px);
    min-width: 670px;
    gap: .6rem;
    margin-bottom: .75rem;
  }

  .gestion-tabla {
    min-width: 670px;
  }

  .gestion-presidente-foto {
    width: 52px;
    height: 52px;
  }

  .gestion-presidente-nombre {
    font-size: .82rem;
  }

  .gestion-presidente-periodo {
    font-size: .68rem;
  }

  .gestion-indicador-cell {
    width: 190px;
    min-width: 190px;
    padding: .85rem .8rem;
    font-size: .84rem;
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 8px 0 12px rgba(15, 23, 42, 0.04);
  }

  .gestion-indicador-wrap {
    gap: .55rem;
  }

  .gestion-indicador-icono {
    font-size: 18px;
  }

  .gestion-valor-cell {
    padding: .85rem .75rem;
    font-size: .8rem;
    min-width: 120px;
  }
}

/* Mobile pequeño */
@media (max-width: 480px) {
  .gestion-colombia-card {
    padding: .75rem;
  }

  .gestion-presidentes-grid {
    grid-template-columns: 170px repeat(4, 110px);
    min-width: 610px;
  }

  .gestion-tabla {
    min-width: 610px;
  }

  .gestion-indicador-cell {
    width: 170px;
    min-width: 170px;
    font-size: .8rem;
    padding: .8rem .7rem;
  }

  .gestion-valor-cell {
    min-width: 110px;
    font-size: .76rem;
    padding: .8rem .65rem;
  }

  .gestion-mobile-hint-badge {
    font-size: .72rem;
    padding: .4rem .75rem;
  }
}

/* Protección visual temporal ante intento de captura */
.screen-protected {
  filter: blur(18px) brightness(0.75);
  transition: filter 0.15s ease;
}

/* Evita selección y acciones sobre elementos sensibles */
.card-candidato,
.card-candidato img,
#modal,
#modal img,
#tabContent {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
