/* ═══════════════════════════════════════════════
   PolitiLab — Mon Vote Européen
   ═══════════════════════════════════════════════ */

/* ── Page ── */
.eu-page {
  max-width: 1100px;
  margin: 0 auto;
  /* FIX : réduit le padding top, la nav fait déjà 60px via .page-wrap */
  padding: 16px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Header ── */
.eu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.eu-header-btns {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.eu-title {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 4px;
}

.eu-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
}

.eu-sub {
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .01em;
}

/* ── Map outer container ── */
.eu-map-outer {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  user-select: none;
}

/* ── CANVA ── */
.eu-canvas {
  position: relative;
  width: 100%;
  height: clamp(380px, calc(100vh - 240px), 720px);
  background: linear-gradient(180deg, #1a5276 0%, #1a3a5c 100%);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  overflow: hidden;
}

/* ── SVG map ── */
#europe-svg-container {
  width: 100%;
  height: 100%;
}

#europe-svg-container svg,
#europe-svg {
  width: 100%;
  height: 100%;
  display: block;
  /* FIX : le SVG remplit le conteneur sans déborder */
  object-fit: contain;
}

.eu-country {
  fill: #2f4070;
  stroke: #0f1520;
  stroke-width: 0.7;
  cursor: pointer;
  transition: fill .15s;
}

.eu-country:hover  { fill: #3d5590; }
.eu-country.has-vote       { fill: #7dcea0; }
.eu-country.has-vote:hover { fill: #a9dfbf; }

/* ── Logo layer ── */
#logo-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.eu-logo {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  animation: logoIn .25s var(--ease) both;
}

@keyframes logoIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.eu-logo img {
  object-fit: contain;
  background: transparent;
  padding: 0;
  box-shadow: none;
  display: block;
}

/*
.eu-logo img {
  width: 36px;
  height: 22px;
  object-fit: contain;
  border-radius: 5px;
  background: #fff;
  padding: 2px 3px;
  box-shadow: 0 2px 12px rgba(0,0,0,.6), 0 0 0 2px rgba(255,255,255,.85);
  display: block;
}
*/


.eu-logo-fallback {
  width: 48px;
  height: 28px;
  border-radius: 5px;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 2px;
  box-shadow: 0 2px 12px rgba(0,0,0,.6), 0 0 0 2px rgba(255,255,255,.85);
}

.eu-logo-name {
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.9), 0 0 8px rgba(0,0,0,.8);
  white-space: nowrap;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-family: var(--f-body);
}

/* ── Watermark ── */
.eu-watermark {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-family: var(--f-mono);
  font-size: .6rem;
  color: rgba(255,255,255,.22);
  letter-spacing: .08em;
  pointer-events: none;
  z-index: 5;
}

/* ── Tooltip ── */
.eu-tip {
  position: fixed;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transition: opacity .1s;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

/* ── Empty hint ── */
.eu-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  transition: opacity .3s;
  z-index: 2;
}
.eu-empty.hidden { opacity: 0; }
.eu-empty-icon   { font-size: 2.2rem; opacity: .35; }
.eu-empty-text   { font-size: .88rem; font-weight: 600; color: rgba(255,255,255,.38); }

/* ── Footer bar ── */
.eu-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  background: var(--surface2);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  border: 1px solid var(--border);
  border-top: none;
  margin-top: -1px;
}

.eu-count {
  font-family: var(--f-mono);
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .05em;
}

.eu-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  color: var(--muted);
}

.eu-leg-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Strip ── */
.eu-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  min-height: 60px;
}

.eu-strip-label {
  font-family: var(--f-mono);
  font-size: .63rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 8px;
}

.eu-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.eu-strip-empty {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
}

.eu-strip-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 9px 4px 6px;
  font-size: .72rem;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--t) var(--ease);
}
.eu-strip-item:hover {
  border-color: var(--border2);
  background: var(--surface3);
  color: var(--text);
}
.eu-strip-item img {
  width: 32px; height: 20px;
  object-fit: contain;
  border-radius: 3px;
  background: #fff;
  padding: 1px 2px;
}
.eu-strip-x {
  margin-left: 3px;
  color: var(--muted);
  font-size: .75rem;
}

/* ── Modal ── */
.eu-modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.eu-modal-bg.active { display: flex; }

.eu-modal {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 16px 16px 32px;
  width: 100%;
  max-width: 680px;
  max-height: 78vh;
  overflow-y: auto;
  position: relative;
  border-top: 1px solid var(--border2);
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
  animation: sheetUp .3s var(--ease) both;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.eu-modal-handle {
  width: 36px; height: 3px;
  background: var(--surface3);
  border-radius: 2px;
  margin: 0 auto 14px;
}

.eu-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--text2);
  font-size: .75rem;
  cursor: pointer;
  transition: all var(--t);
}
.eu-modal-close:hover { background: var(--surface3); color: var(--text); }

.eu-modal-country {
  font-family: var(--f-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 14px;
}

.eu-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.eu-party-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: all var(--t) var(--ease);
}
.eu-party-btn:hover {
  background: var(--surface3);
  border-color: var(--border2);
  transform: translateY(-2px);
}
.eu-party-btn.chosen {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
}
.eu-party-btn img {
  width: 68px; height: 42px;
  object-fit: contain;
}
.eu-party-btn .eu-pname {
  font-size: .66rem;
  font-weight: 600;
  color: var(--text2);
  line-height: 1.3;
}
.eu-party-btn.chosen .eu-pname { color: var(--gold); }
.eu-party-orient {
  font-size: .56rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  color: #fff;
  font-family: var(--f-mono);
  letter-spacing: .03em;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .eu-page  { padding: 12px 14px 50px; gap: 12px; }
  .eu-header { flex-direction: column; align-items: flex-start; }
  .eu-canvas { height: clamp(300px, 65vw, 480px); }
  .eu-modal-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
