/* public/css/gn-vote-event.css */

:root {
  --vep-accent: #f97316;
  --vep-accent-dark: #ea580c;
  --vep-accent-light: rgba(249, 115, 22, 0.1);
  --vep-bg: #fafafa;
  --vep-card-bg: #ffffff;
  --vep-text-main: #111827;
  --vep-text-muted: #6b7280;
  --vep-border: rgba(0, 0, 0, 0.06);
  --vep-radius-lg: 24px;
  --vep-radius-md: 16px;
  --vep-radius-sm: 10px;
  --vep-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.03);
  --vep-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.08);
  --vep-gold: #fbbf24;
  --vep-silver: #9ca3af;
  --vep-bronze: #b45309;
}

body {
  background-color: var(--vep-bg) !important;
}

.vote-event-page-wrapper {
  background: var(--vep-bg);
  min-height: 100vh;
  padding-bottom: 80px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--vep-text-main);
}
.page-title-box, .breadcrumb-wrapper, .bg-warning {
    display: none !important;
}

.vep-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 991px) {
  .vep-container { padding: 0 20px; }
}

/* HERO */
.vep-hero {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: var(--vep-radius-lg);
  overflow: hidden;
  margin-top: 24px;
  margin-bottom: 40px;
  box-shadow: var(--vep-shadow-soft);
  background: #000;
}
.vep-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.vep-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
}
.vep-hero-top-badges {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.vep-badge {
  background: rgba(255,255,255,0.95);
  color: var(--vep-text-main);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.vep-badge.is-success { color: #15803d; }
.vep-badge.is-danger { color: #b91c1c; }

.vep-hero-title {
  color: #fff;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 20px 0;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.vep-hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.vep-hero-org {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  padding: 8px 20px 8px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
}
.vep-hero-org-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--vep-accent);
  overflow: hidden;
}
.vep-hero-org-logo img { width: 100%; height: 100%; object-fit: cover; }
.vep-hero-org-name { color: #fff; font-weight: 700; font-size: 0.95rem; }

.vep-hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.vep-hero-votes {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  text-align: right;
}
.vep-hero-votes strong { font-size: 1.4rem; font-weight: 900; color: var(--vep-gold); line-height: 1; }
.vep-btn-action {
  background: var(--vep-accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--vep-accent-light);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.vep-btn-action:hover {
  background: var(--vep-accent-dark);
  transform: translateY(-2px);
  color: #fff;
}

@media (max-width: 768px) {
  .vep-hero { height: auto; min-height: 380px; margin-top: 0; border-radius: 0; }
  .vep-hero-overlay { padding: 30px 20px; }
  .vep-hero-meta { flex-direction: column; align-items: flex-start; }
  .vep-hero-votes { text-align: left; }
  .vep-btn-action { width: 100%; text-align: center; }
}

/* LAYOUT */
.vep-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-top: 40px;
}
.vep-main {
  flex: 1;
  min-width: 0;
}
.vep-sidebar {
  width: 380px;
  flex: 0 0 auto;
  position: sticky;
  top: 32px;
}
@media (max-width: 991px) {
  .vep-layout { flex-direction: column; }
  .vep-sidebar { width: 100%; position: static; }
}

/* SECTION TITLES */
.vep-section-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--vep-text-main);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.01em;
}

/* EDITORIAL SUMMARY */
.vep-summary-section {
  margin-bottom: 48px;
}
.vep-summary-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--vep-text-muted);
  max-width: 800px;
}
.vep-timeline {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  background: #fff;
  padding: 20px 24px;
  border-radius: var(--vep-radius-md);
  border: 1px solid var(--vep-border);
  display: inline-flex;
}
.vep-timeline-item { display: flex; flex-direction: column; }
.vep-timeline-label { font-size: 0.8rem; font-weight: 800; color: var(--vep-text-muted); text-transform: uppercase; margin-bottom: 4px; }
.vep-timeline-value { font-size: 1.05rem; font-weight: 700; color: var(--vep-text-main); }
.vep-timeline-sep { color: #d1d5db; font-size: 1.2rem; }
@media (max-width: 576px) {
  .vep-timeline { flex-direction: column; align-items: flex-start; width: 100%; }
  .vep-timeline-sep { display: none; }
}

/* PODIUM */
.vep-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  padding: 0 20px;
}
.vep-podium-item {
  flex: 1;
  background: var(--vep-card-bg);
  border-radius: var(--vep-radius-lg);
  padding: 20px 16px;
  text-align: center;
  border: 1px solid var(--vep-border);
  box-shadow: var(--vep-shadow-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.vep-podium-item.is-1 {
  transform: translateY(-20px);
  z-index: 2;
  border: 2px solid var(--vep-gold);
  box-shadow: 0 15px 35px rgba(251, 191, 36, 0.15);
  padding: 30px 20px;
}
.vep-podium-item.is-2 { border-top: 4px solid var(--vep-silver); }
.vep-podium-item.is-3 { border-top: 4px solid var(--vep-bronze); }

.vep-podium-badge {
  position: absolute;
  top: -16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff; font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.vep-podium-item.is-1 .vep-podium-badge { background: var(--vep-gold); width: 40px; height: 40px; top: -20px; font-size: 1.1rem; }
.vep-podium-item.is-2 .vep-podium-badge { background: var(--vep-silver); }
.vep-podium-item.is-3 .vep-podium-badge { background: var(--vep-bronze); }

.vep-podium-photo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.vep-podium-item.is-1 .vep-podium-photo { width: 110px; height: 110px; }

.vep-podium-name { font-weight: 800; font-size: 1rem; color: var(--vep-text-main); margin-bottom: 4px; }
.vep-podium-item.is-1 .vep-podium-name { font-size: 1.2rem; }
.vep-podium-votes { font-weight: 900; color: var(--vep-accent); font-size: 1.1rem; }
.vep-podium-item.is-1 .vep-podium-votes { font-size: 1.3rem; }
.vep-podium-pct { font-size: 0.85rem; color: var(--vep-text-muted); font-weight: 700; }

@media (max-width: 768px) {
  .vep-podium { flex-direction: column; align-items: center; gap: 32px; }
  .vep-podium-item { width: 100%; max-width: 300px; transform: none !important; }
}

/* LISTE CLASSEMENT (Reste) */
.vep-ranking-list {
  background: var(--vep-card-bg);
  border-radius: var(--vep-radius-lg);
  border: 1px solid var(--vep-border);
  padding: 24px;
  margin-bottom: 48px;
}
.vep-ranking-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}
.vep-ranking-row:last-child { border-bottom: none; }
.vep-ranking-pos { width: 30px; text-align: center; font-weight: 800; color: var(--vep-text-muted); font-size: 1.1rem; }
.vep-ranking-avatar { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.vep-ranking-info { flex: 1; min-width: 0; }
.vep-ranking-name { font-weight: 800; font-size: 1rem; color: var(--vep-text-main); }
.vep-ranking-bar-bg { height: 6px; background: #f3f4f6; border-radius: 999px; margin-top: 8px; overflow: hidden; }
.vep-ranking-bar-fill { height: 100%; background: var(--vep-silver); border-radius: 999px; }
.vep-ranking-stats { text-align: right; }
.vep-ranking-votes { font-weight: 800; font-size: 1rem; color: var(--vep-text-main); }
.vep-ranking-pct { font-size: 0.8rem; color: var(--vep-text-muted); font-weight: 700; }

/* CANDIDATES GRID */
.vep-candidates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border: none;
  padding: 0;
  margin: 0 0 48px 0;
}
.vep-cand-card {
  background: var(--vep-card-bg);
  border-radius: var(--vep-radius-lg);
  border: 2px solid transparent;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--vep-shadow-soft);
  display: flex;
  flex-direction: column;
}
.vep-cand-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--vep-shadow-hover);
}
.vep-cand-input { position: absolute; opacity: 0; }
.vep-cand-input:focus-visible + .vep-cand-content { outline: 3px solid var(--vep-accent); outline-offset: 4px; }

.vep-cand-input:checked + .vep-cand-content > .vep-cand-card-inner {
  border: 2px solid var(--vep-accent);
  box-shadow: 0 8px 24px var(--vep-accent-light);
}
.vep-cand-input:checked + .vep-cand-content .vep-cand-check {
  opacity: 1;
  transform: scale(1);
}
.vep-cand-input:checked + .vep-cand-content .vep-cand-btn-select {
  background: var(--vep-accent);
  color: #fff;
  border-color: var(--vep-accent);
}
.vep-cand-input:checked + .vep-cand-content .vep-cand-btn-select::after {
  content: "Sélectionné";
}

.vep-cand-content { display: block; height: 100%; }
.vep-cand-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--vep-radius-lg);
    border: 2px solid var(--vep-border);
    overflow: hidden;
    transition: all 0.2s ease;
}

.vep-cand-photo-wrap {
  width: 100%;
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
}
.vep-cand-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vep-cand-check {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  background: var(--vep-accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  opacity: 0; transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.vep-cand-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.vep-cand-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--vep-text-main);
  margin-bottom: 4px;
}
.vep-cand-desc {
  font-size: 0.9rem;
  color: var(--vep-text-muted);
  margin-bottom: 16px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vep-cand-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vep-cand-votes {
  font-weight: 800;
  color: var(--vep-text-main);
  font-size: 1.05rem;
}
.vep-cand-btn-select {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--vep-border);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--vep-text-main);
  background: #fff;
  transition: all 0.2s;
}
.vep-cand-btn-select::after { content: "Sélectionner"; }

@media (max-width: 991px) {
  .vep-candidates-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
  .vep-candidates-grid { grid-template-columns: 1fr; }
}

/* SIDEBAR VOTE PANEL */
.vep-vote-panel {
  background: var(--vep-card-bg);
  border-radius: var(--vep-radius-lg);
  border: 1px solid var(--vep-border);
  box-shadow: var(--vep-shadow-hover);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

/* Empty State */
.vep-vote-empty {
  text-align: center;
  padding: 40px 20px;
}
.vep-vote-empty-icon {
  font-size: 3rem;
  color: #e5e7eb;
  margin-bottom: 16px;
}
.vep-vote-empty-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--vep-text-muted);
}

/* Selected State */
.vep-vote-active {
  display: none;
}
.vep-sidebar-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--vep-border);
}
.vep-sidebar-avatar {
  width: 60px; height: 60px;
  border-radius: 16px;
  object-fit: cover;
}
.vep-sidebar-cname {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--vep-text-main);
  line-height: 1.2;
}
.vep-sidebar-cdesc { font-size: 0.85rem; color: var(--vep-text-muted); }

/* Segmented Control */
.vep-segmented {
  display: flex;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}
.vep-seg-btn {
  flex: 1; text-align: center; padding: 12px;
  font-weight: 800; color: var(--vep-text-muted); font-size: 0.95rem;
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.vep-seg-btn.active {
  background: #fff; color: var(--vep-text-main); box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.vep-form-group { margin-bottom: 20px; }
.vep-label { display: block; font-weight: 800; font-size: 0.9rem; color: var(--vep-text-main); margin-bottom: 8px; }
.vep-input {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid #d1d5db;
  background: #f9fafb; font-size: 1rem; font-weight: 600; font-family: inherit; transition: all 0.2s;
}
.vep-input:focus { outline: none; border-color: var(--vep-accent); background: #fff; box-shadow: 0 0 0 4px var(--vep-accent-light); }

.vep-qty-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.vep-qty-pill {
  padding: 10px 16px; border-radius: 999px; background: #f3f4f6; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s;
}
.vep-qty-pill:hover { background: #e5e7eb; }
.vep-qty-pill.active { background: var(--vep-accent-light); color: var(--vep-accent); box-shadow: inset 0 0 0 2px var(--vep-accent); }

.vep-total-box {
  background: #f8f9fa; border-radius: 16px; padding: 20px; text-align: center; margin: 32px 0 24px 0; border: 1px solid var(--vep-border);
}
.vep-total-label { font-size: 0.85rem; font-weight: 800; color: var(--vep-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.vep-total-amount { font-size: 2.2rem; font-weight: 900; color: var(--vep-text-main); margin-top: 4px; line-height: 1; }

.vep-submit-btn {
  width: 100%; height: 60px; border-radius: 16px; background: var(--vep-accent); color: #fff;
  font-weight: 900; font-size: 1.2rem; border: none; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 12px; box-shadow: 0 8px 20px var(--vep-accent-light);
}
.vep-submit-btn:hover { background: var(--vep-accent-dark); transform: translateY(-2px); box-shadow: 0 12px 24px var(--vep-accent-light); }
.vep-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.vep-secure-text { text-align: center; font-size: 0.85rem; color: var(--vep-text-muted); font-weight: 600; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* RECENT VOTES (FEED) */
.vep-feed {
  background: var(--vep-card-bg);
  border-radius: var(--vep-radius-lg);
  border: 1px solid var(--vep-border);
  padding: 32px;
}
.vep-feed-list { display: flex; flex-direction: column; gap: 20px; }
.vep-feed-item {
  display: flex; align-items: flex-start; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid #f3f4f6;
}
.vep-feed-item:last-child { border-bottom: none; padding-bottom: 0; }
.vep-feed-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: #f3f4f6; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--vep-text-muted); font-size: 1.1rem; flex-shrink: 0;
}
.vep-feed-avatar.is-anon { background: #fef3c7; color: #d97706; }
.vep-feed-info { flex: 1; min-width: 0; }
.vep-feed-name { font-weight: 800; font-size: 1rem; color: var(--vep-text-main); margin-bottom: 2px; }
.vep-feed-meta { font-size: 0.85rem; color: var(--vep-text-muted); }
.vep-feed-meta span { font-weight: 700; color: var(--vep-text-main); }
.vep-feed-qty { text-align: right; flex-shrink: 0; }
.vep-feed-qty-val { font-weight: 900; font-size: 1.1rem; color: var(--vep-accent); }
.vep-feed-qty-amount { font-size: 0.8rem; font-weight: 700; color: #9ca3af; margin-top: 2px; }

/* MOBILE STICKY BAR */
.vep-mobile-sticky {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px);
  border-top: 1px solid var(--vep-border); padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05); z-index: 1000;
  transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.vep-mobile-sticky.is-visible { transform: translateY(0); }
@media (min-width: 992px) { .vep-mobile-sticky { display: none !important; } }
.vep-sticky-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.vep-sticky-avatar { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.vep-sticky-text { display: flex; flex-direction: column; min-width: 0; }
.vep-sticky-name { font-weight: 800; font-size: 0.95rem; color: var(--vep-text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vep-sticky-total { font-weight: 800; font-size: 0.9rem; color: var(--vep-accent); }
.vep-sticky-btn {
  background: var(--vep-accent); color: #fff; border: none; border-radius: 999px; padding: 12px 24px;
  font-weight: 800; font-size: 1rem; margin-left: 12px; flex-shrink: 0; box-shadow: 0 4px 10px var(--vep-accent-light);
}

.vep-loader { border: 2px solid rgba(255,255,255,0.3); border-top: 2px solid #fff; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; display: none; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
