/* Fanqora Match Centre – Horizontal score bar (ticker)
   This file is enqueued on homepage only by match-centre.php
*/

.fanqora-match-centre{
  --fmc-bg: rgba(14, 23, 33, .72);
  --fmc-bg-2: rgba(10, 16, 24, .72);
  --fmc-border: rgba(255,255,255,.08);
  --fmc-border-2: rgba(255,255,255,.12);
  --fmc-text: rgba(255,255,255,.92);
  --fmc-muted: rgba(255,255,255,.62);
  --fmc-accent: #14b5ff;
  --fmc-shadow: 0 16px 40px rgba(0,0,0,.45);

  width: min(1320px, calc(100% - 32px));
  margin: 16px auto 18px;
}

/* Details wrapper */
.fanqora-match-centre{
  border: 1px solid var(--fmc-border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--fmc-bg), var(--fmc-bg-2));
  box-shadow: var(--fmc-shadow);
  overflow: clip;
}

/* Summary header */
.fanqora-match-centre > summary{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.fanqora-match-centre > summary::-webkit-details-marker{ display:none; }

.fmc-top{ display:flex; align-items: baseline; gap: 12px; min-width: 0; }

.fmc-title{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 800;
  color: var(--fmc-text);
  letter-spacing: .2px;
  white-space: nowrap;
}

.fmc-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--fmc-accent);
  box-shadow: 0 0 0 4px rgba(20,181,255,.16);
  flex: 0 0 auto;
}

.fmc-sub{
  color: var(--fmc-muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fmc-toggle{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fmc-muted);
  font-size: 13px;
  user-select: none;
  white-space: nowrap;
  padding: 8px 10px;
  border: 1px solid var(--fmc-border);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
}

.fmc-toggle-text{ display:none; }
.fanqora-match-centre[open] .fmc-toggle .fmc-open{ display:inline; }
.fanqora-match-centre:not([open]) .fmc-toggle .fmc-closed{ display:inline; }

.fmc-chevron{
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--fmc-muted);
  border-bottom: 2px solid var(--fmc-muted);
  transform: rotate(45deg);
  margin-top: -2px;
  transition: transform .2s ease;
}

.fanqora-match-centre[open] .fmc-chevron{ transform: rotate(-135deg); margin-top: 2px; }

/* Body */
.fmc-body{ padding: 12px 14px 14px; border-top: 1px solid var(--fmc-border); }

/* Controls row */
.fmc-scorebar{ display:flex; align-items:center; justify-content: space-between; gap: 14px; }

.fmc-controls{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
}

.fmc-select{
  position: relative;
}

.fmc-select select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(255,255,255,.04);
  color: var(--fmc-text);
  border: 1px solid var(--fmc-border);
  border-radius: 999px;
  padding: 10px 38px 10px 14px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  outline: none;
}

.fmc-select:after{
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--fmc-muted);
  border-bottom: 2px solid var(--fmc-muted);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.fmc-select select:focus{ border-color: rgba(20,181,255,.55); box-shadow: 0 0 0 4px rgba(20,181,255,.12); }

/* Horizontal rail */
.fmc-rail-wrap{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.fmc-rail{
  display: flex;
  gap: 8px;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 4px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.fmc-rail::-webkit-scrollbar{ display:none; }
.fmc-rail{ scrollbar-width: none; -ms-overflow-style: none; }

.fmc-arrow{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--fmc-border);
  background: rgba(255,255,255,.03);
  color: var(--fmc-text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items:center;
  justify-content:center;
}

.fmc-arrow:hover{ border-color: var(--fmc-border-2); background: rgba(255,255,255,.05); }

@media (max-width: 860px){
  .fmc-arrow{ display:none; }
}

/* Match tile */
.fmc-match{
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 104px;
  border-radius: 12px;
  border: 1px solid var(--fmc-border);
  background: rgba(0,0,0,.18);
  padding: 8px 10px;
}

.fmc-match-top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.fmc-state{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--fmc-muted);
}

.fmc-match-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
}

.fmc-side{
  display:flex;
  align-items:center;
  gap: 8px;
  min-width: 0;
}

.fmc-crest{
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.fmc-code{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .4px;
  color: var(--fmc-text);
  white-space: nowrap;
}

.fmc-goal{
  font-size: 12px;
  font-weight: 900;
  color: var(--fmc-text);
}

/* Live accent */
.fmc-match.is-live .fmc-state{ color: var(--fmc-accent); }
.fmc-match.is-live{ border-color: rgba(20,181,255,.32); box-shadow: 0 0 0 2px rgba(20,181,255,.06) inset; }

/* Empty state */
.fmc-empty{
  padding: 10px 0;
  color: var(--fmc-muted);
  font-weight: 600;
  font-size: 13px;
}

/* Mobile tidy */
@media (max-width: 520px){
  .fanqora-match-centre{ width: calc(100% - 20px); }
  .fmc-sub{ display:none; }
  .fmc-match{ width: 98px; }
  .fmc-select select{ padding: 10px 34px 10px 12px; }
}

/* === Ticker v2 layout (UEFA-style) === */
.fanqora-match-centre{color-scheme: dark;}

.fanqora-match-centre .fmc-ticker-row{
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.fanqora-match-centre .fmc-controls{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fanqora-match-centre .fmc-hint{
  font-size: 12px;
  opacity: .75;
  white-space: nowrap;
  padding-left: 4px;
}

/* Custom dropdowns */
.fanqora-match-centre .fmc-dd{
  position: relative;
}
.fanqora-match-centre .fmc-dd > summary{
  list-style: none;
}
.fanqora-match-centre .fmc-dd > summary::-webkit-details-marker{display:none;}

.fanqora-match-centre .fmc-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(9,18,31,.65);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,.92);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.fanqora-match-centre .fmc-caret{
  width: 0;height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(255,255,255,.7);
  transform: translateY(1px);
  transition: transform .18s ease;
}
.fanqora-match-centre .fmc-dd[open] .fmc-caret{transform: rotate(180deg) translateY(-1px);}

.fanqora-match-centre .fmc-menu{
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  max-height: 340px;
  overflow: auto;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(10,16,24,.92);
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  backdrop-filter: blur(14px);
  z-index: 50;
}

.fanqora-match-centre .fmc-menu .fmc-dd-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  color: rgba(255,255,255,.9);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;

  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
}
.fanqora-match-centre .fmc-menu .fmc-dd-item:hover{
  background: rgba(255,255,255,.08);
}
.fanqora-match-centre .fmc-menu .fmc-dd-item.is-active{
  background: rgba(20,184,255,.14);
  border: 1px solid rgba(20,184,255,.25);
}

/* Rail wrap + nav */
.fanqora-match-centre .fmc-rail-wrap{
  position: relative;
  min-width: 0;
}

.fanqora-match-centre .fmc-rail{
  padding: 0 28px; /* space for smaller arrows */
}

.fanqora-match-centre .fmc-rail-wrap .fmc-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,12,18,.42);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,.92);
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.fanqora-match-centre .fmc-rail-wrap .fmc-prev{left: 8px;}
.fanqora-match-centre .fmc-rail-wrap .fmc-next{right: 8px;}

/* Loading state while swapping rail via AJAX */
.fanqora-match-centre.fmc-loading .fmc-rail{
  opacity: .5;
  pointer-events: none;
}
.fanqora-match-centre.fmc-loading .fmc-rail-wrap .fmc-nav{
  pointer-events: none;
  opacity: .4;
}

.fanqora-match-centre .fmc-rail-wrap .fmc-nav:hover{
  background: rgba(12,18,26,.75);
}

/* Slightly more compact cards */
.fanqora-match-centre .fmc-card{
  width: 128px;
  padding: 8px 10px;
}
.fanqora-match-centre .fmc-card-top{
  font-size: 12px;
  opacity: .85;
}
.fanqora-match-centre .fmc-short{
  font-size: 13px;
  letter-spacing: .04em;
}

@media (max-width: 920px){
  .fanqora-match-centre .fmc-ticker-row{
    gap: 10px;
  }
  .fanqora-match-centre .fmc-controls{
    flex-wrap: wrap;
  }
  .fanqora-match-centre .fmc-hint{display:none;}
  .fanqora-match-centre .fmc-rail{padding: 0 24px;}
  .fanqora-match-centre .fmc-rail-wrap .fmc-nav{width:22px;height:22px;font-size:14px;}
}

@media (max-width: 520px){
  .fanqora-match-centre .fmc-card{width: 118px;}
}


/* --- Dropdown menu polish (override theme button styles) --- */
.fanqora-match-centre .fmc-dd-item{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  padding:10px 12px;
  border-radius:12px;
  width:100%;
  text-align:left;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  line-height:1.1;
}
.fanqora-match-centre .fmc-dd-item:hover{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.16);
}
.fanqora-match-centre .fmc-dd-item.is-active{
  background:rgba(0,162,255,.10);
  border-color:rgba(0,162,255,.35);
}
.fanqora-match-centre .fmc-dd-item span{
  color:rgba(255,255,255,.9);
}
.fanqora-match-centre .fmc-dd-items{
  display:block;
  background:rgba(9,18,28,.96);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:10px;
  max-height:260px;
  overflow:auto;
  box-shadow:0 18px 60px rgba(0,0,0,.5);
}
.fanqora-match-centre .fmc-dd-items.fmc-dd-date{
  /* was grid – keep it a simple vertical list (more compact, less ugly) */
  display:block;
}
.fanqora-match-centre .fmc-dd-items.fmc-dd-date .fmc-dd-item{
  padding:9px 12px;
}
/* Reduce trigger pill size slightly */
.fanqora-match-centre .fmc-pill{
  padding:7px 12px;
  font-size:13px;
}
@media (max-width: 700px){
  .fanqora-match-centre .fmc-nav-btn{ width:36px; height:36px; }
  .fanqora-match-centre .fmc-pill{ padding:8px 12px; font-size:14px; }
  .fanqora-match-centre .fmc-dd{ min-width: 0; }
  .fanqora-match-centre .fmc-dd-menu{ min-width: min(86vw, 360px); }
}
