/* ============================================
   css/bigfights.css — Big Fights page
   Mobile First
   ============================================ */

/* ---------- Page layout ---------- */
body[data-page="bigfights"] main {
  height: calc(100vh - var(--navbar-height));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bigfights-page {
  padding: var(--gap-md);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* allows flex child to shrink and scroll */
}
@media (min-width: 993px) {
  .bigfights-page { padding: var(--gap-lg) var(--gap-xl); }
}

/* ---------- Filter Tabs ---------- */
.bigfight-tabs {
  display: flex;
  gap: 20px;
  flex-shrink: 0;      /* never compress — always fully visible */
  position: sticky;
  top: 0;
  justify-content: space-between;
  background: var(--color-bg); /* match page bg so it hides content behind it */
  z-index: 100;
  padding-top: var(--gap-sm); 
}
.bigfight-tab {
  padding: 8px 22px;
  border-radius: 8px;
  border: 2px solid var(--color-border);
  background: #F8E0DB;
  color: #E54B2A;
  font-size: var(--font-md);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.18s ease;
}
.bigfight-tab--active {
  background: white;
  border-color: #E54B2A;
  color: #E54B2A;
}
.bigfight-tab:hover:not(.bigfight-tab--active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============================================
   BIG FIGHTS — Card Grid
   ============================================ */
.candidates-search {
  position: relative;
  margin-bottom: var(--gap-md);
}

.candidates-search__input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-md);
  font-family: inherit;
  background: var(--color-white);
  color: var(--color-dark);
  outline: none;
  transition: border-color 0.2s ease;
}

.candidates-search__input:focus {
  border-color: var(--color-primary);
}

.candidates-search__input::placeholder {
  color: var(--color-muted);
}

.candidates-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}
.bigfight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
}
@media (min-width: 577px) {
  .bigfight-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 993px) {
  .bigfight-grid { grid-template-columns: repeat(3, 1fr); }
}
/* #bigfight-cards-container{
  background-color: white;
  display: flex;
  flex-direction: row;
} */
/* ---------- Fight Card ---------- */
#bigfight-cards-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  overflow-y: auto;          /* ONLY this scrolls */
  flex: 1;                   /* fills remaining height below sticky tabs */
  min-height: 0;             /* required for flex+overflow to work */
  align-content: flex-start;
  padding-bottom: var(--gap-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.fight-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--gap-md);
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  display: flex;
  flex: 1 1 300px;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: visible;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 0; /* prevents grid blowout */
}
.fight-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.11);
}

/* Constituency tag — top right corner */
.fight-card__constituency {
  position: absolute;
  top: -1px;
  right: -1px;
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--color-muted);
  background: #F5E2D5;
  border-radius: 0 var(--radius-lg) 0 var(--radius-lg);
  padding: 5px 12px;
  white-space: nowrap;
  max-width: 60%;
  height: 26px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
}

/* Candidate row */
.fight-card__candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

/* Photo wrap */
.fight-card__photo-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.fight-card__photo-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fight-card__photo-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.fight-card__photo--svg {
  width: 65%;
  height: 65%;
}

/* Party logo badge */
.fight-card__party-logo {
  position: absolute;
  bottom: -2px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-white);
  background: var(--color-white);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.fight-card__party-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.fight-card__party-logo--fallback {
  font-size: 7px;
  font-weight: 900;
  color: var(--color-white);
  line-height: 1;
  text-align: center;
}

/* Candidate info */
.fight-card__info { flex: 1; min-width: 0; }
.fight-card__name-line {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fight-card__party-inline {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--color-muted);
}
.fight-card__status {
  display: block;
  margin-top: 5px;
  font-size: var(--font-xs);
  color: var(--color-muted);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Progress bar */
.fight-card__progress-wrap { padding: 2px 0; }
.fight-card__progress-bar {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-border);
}
.fight-card__bar { height: 100%; }

/* Empty state */
.bigfight-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted);
  font-size: var(--font-md);
}

/* ============================================
   POPULAR BATTLES — Dropdown
   ============================================ */

.pop-dropdown {
  position: absolute;
  top: 52px;
  left: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 300;
  min-width: 240px;
  overflow: hidden;
  animation: dropIn 0.15s ease both;
  
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pop-dd__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--color-border);
}
.pop-dd__item:last-child { border-bottom: none; }
.pop-dd__item:hover { background: var(--color-bg); }
.pop-dd__item--active { background: #fff8f6; }

.pop-dd__pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid;
  font-size: var(--font-sm);
  font-weight: 800;
  white-space: nowrap;
  background:linear-gradient(red,black);
}
.pop-dd__icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 50%;
}
.pop-dd__sep {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--color-muted);
  flex-shrink: 0;
}
.pop-dd__check {
  margin-left: auto;
  font-size: var(--font-sm);
  color: var(--color-primary);
  font-weight: 900;
}

/* ============================================
   POPULAR BATTLES — Results count
   ============================================ */

.pop-results-count {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: var(--gap-md);
}
.pop-results-count__num {
  font-size: var(--font-xl);
  font-weight: 900;
  color: var(--color-dark);
}

/* ============================================
   POPULAR BATTLES — Card Grid (3 cols)
   ============================================ */

.pop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-md);
  width: 100%;
}
@media (min-width: 577px) {
  .pop-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 993px) {
  .pop-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Popular Battle Card ---------- */
.pop-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background:#FFFFFF;
  opacity: 80%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  min-height: 180px;
}
.pop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

/* Gradient layer */
.pop-card__bg {
  position: absolute;
  inset: 0;
  
  z-index: 0;
}

/* Glow layer */
.pop-card__glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url('../assets/images/clash.png');
  background-position: center;
  pointer-events: none;
}

/* Content */
.pop-card__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 10px 14px 14px;
}

/* Constituency title */
.pop-card__title {
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  color:black;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background:transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 4;
}

/* Versus row */
.pop-card__versus {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex: 1;
  gap: 4px;
}

/* Candidate column */
.pop-card__candidate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}

/* Photo wrap */
.pop-card__photo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 90px;
  border-radius: 64px;
  overflow: hidden;
}
.pop-card__photo {
  width: 100%;
  height: 100%;
  
  object-fit: contain;
  object-position: bottom;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.45));
}
.pop-card__photo--flip { transform: scaleX(-1); }

/* Party badge on photo */
.pop-card__badge {
  position: absolute;
  bottom: 0;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-white);
  border: 2px solid var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.pop-card__badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pop-card__badge-text {
  font-size: 6px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

/* Name + party label */
.pop-card__name {
  font-size: 9px;
  font-weight: 800;
  color: rgba(255,255,255,0.92);
  text-align: center;
  line-height: 1.3;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pop-card__party-label {
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-align: center;
}

/* VS badge */
.pop-card__vs {
  font-size: 18px;
  font-weight: 900;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 0 12px rgba(255,220,80,0.5);
  flex-shrink: 0;
  align-self: center;
  padding-bottom: 20px;
}