/* 
   =============================================
   BELLE-ÎLE LIFE | PREMIUM STYLESHEET (FINAL)
   =============================================
*/

:root {
  --primary-color: #3B82F6;
  --primary-hover: #2563EB;
  --secondary-color: rgba(255, 255, 255, 0.1);
  --secondary-hover: rgba(255, 255, 255, 0.2);
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --bg-dark: #0F172A;
  --bg-panel: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

body.loading-state {
  overflow: hidden;
}

/* ================== PRELOADER ================== */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

.preloader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.pulse-logo {
  height: 100px;
  width: auto;
  animation: pulse 2s infinite ease-in-out;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}

.loading-bar .progress {
  height: 100%;
  background: var(--primary-color);
  width: 0%;
  animation: load 1.5s ease-out forwards;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

@keyframes load {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* ================== GLOBAL ANIMATIONS ================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.scroll-delay-1 { transition-delay: 0.1s; }
.scroll-delay-2 { transition-delay: 0.25s; }
.scroll-delay-3 { transition-delay: 0.4s; }


/* ================== TEXT & GLASS ================== */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.glow-text {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

h1, h2, h3, h4 { font-family: var(--font-heading); }
a { text-decoration: none; color: inherit; transition: var(--transition); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.text-center { text-align: center; }

/* ================== BUTTONS ================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: var(--font-main);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn:hover::before { left: 100%; }

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
  background: var(--secondary-color);
  color: #fff;
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--secondary-hover);
  transform: translateY(-3px);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 { font-size: 2.8rem; margin-bottom: 1rem; }
.section-header span { color: var(--primary-color); }
.section-header p { color: var(--text-secondary); font-size: 1.15rem; max-width: 600px; margin: 0 auto; }

/* ================== NAVBAR ================== */
.navbar {
  position: fixed;
  top: 0; left: 0; width: 100%;
  padding: 0.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
  height: 85px;
  width: auto;
  max-width: 300px;
  object-fit: contain;
  display: block;
  transition: var(--transition);
}

.nav-logo:hover { transform: scale(1.05) rotate(-2deg); }

.nav-actions { display: flex; justify-content: flex-end; }
.nav-links { display: flex; gap: 2.5rem; }

.nav-links a {
  font-weight: 500; font-size: 0.95rem;
  position: relative; color: var(--text-secondary);
}

.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }
.nav-links a::after {
  content: ''; position: absolute; bottom: -8px; left: 0;
  width: 0%; height: 2px; background-color: var(--primary-color); transition: var(--transition);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* ================== HERO SECTION ================== */
.hero-section {
  position: relative; height: 100vh; min-height: 700px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.page-hero {
  position: relative;
  height: 50vh;
  min-height: 400px;
  background: url('../images/gendarmerie.png') center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
}
.bg-video {
  position: absolute; top: 50%; left: 50%;
  min-width: 100%; min-height: 100%; width: auto; height: auto;
  transform: translate(-50%, -50%); z-index: -2; object-fit: cover;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.6) 0%, rgba(15, 23, 42, 0.4) 50%, rgba(15, 23, 42, 0.98) 100%);
  z-index: -1; display: flex; align-items: center; justify-content: center;
}
.hero-overlay-dark {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.hero-overlay-dark .container { z-index: 2; }
.hero-content { text-align: center; max-width: 800px; padding: 0 2rem; z-index: 10; margin-top: 50px; }
.hero-content h1 { font-size: clamp(3.5rem, 6vw, 6rem); font-weight: 900; letter-spacing: 2px; line-height: 1.1; margin-bottom: 1rem; }
.page-hero h1 { font-size: clamp(2.5rem, 4vw, 4.5rem); font-weight: 900; }
.hero-content .subtitle { font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--text-secondary); letter-spacing: 4px; margin-bottom: 3rem; text-transform: uppercase; }
.cta-group { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.mb-4 { margin-bottom: 4rem; }

/* ================== ABOUT SECTION ================== */
.about-section { padding: 6rem 0 3rem; background: var(--bg-dark); }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 3rem; }
.about-card { padding: 2.5rem; border-radius: 16px; transition: var(--transition); text-align: left; position: relative; overflow: hidden; }
.about-card:hover { transform: translateY(-10px); border-color: rgba(59, 130, 246, 0.3); box-shadow: 0 15px 40px rgba(59, 130, 246, 0.15); }
.about-card::before {
    content:''; position: absolute; top:-50%; left:-50%; width:200%; height:200%;
    background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 60%); opacity: 0; transition: opacity 0.5s;
}
.about-card:hover::before { opacity: 1; }
.about-card .icon {
  width: 65px; height: 65px; border-radius: 12px; background: rgba(59, 130, 246, 0.15);
  color: var(--primary-color); display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; margin-bottom: 1.5rem; transition: var(--transition);
}
.about-card:hover .icon { background: var(--primary-color); color: #fff; transform: scale(1.1); rotate: 5deg; }
.about-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.about-card p { color: var(--text-secondary); font-size: 1rem; }

/* ================== HIGHLIGHT STATS SECTION ================== */
.stats-section { padding: 3rem 0; background: var(--bg-dark); }
.stats-wrapper {
  display: flex; justify-content: space-around; align-items: center; flex-wrap: wrap;
  padding: 3rem; border-radius: 20px; gap: 2rem; text-align: center;
  background: linear-gradient(135deg, rgba(30,58,138,0.2) 0%, rgba(15,23,42,0.6) 100%);
}
.stat-item { flex: 1; min-width: 200px; }
.stat-item i { font-size: 3rem; color: var(--primary-color); margin-bottom: 1rem; }
.stat-item h3 { font-size: 3.5rem; font-weight: 900; margin-bottom: 0.5rem; line-height: 1; }
.stat-item p { color: var(--text-secondary); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* ================== FEATURES SECTION ================== */
.features-section { padding: 6rem 0; background: linear-gradient(to bottom, var(--bg-dark), #0b1120); }
.features-content { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.features-text h2 { font-size: 2.8rem; margin-bottom: 1.5rem; }
.features-text h2 span { color: var(--primary-color); }
.features-text p { color: var(--text-secondary); font-size: 1.15rem; margin-bottom: 2rem; }
.feature-list { list-style: none; margin-bottom: 2rem; }
.feature-list li { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; font-size: 1.1rem; color: #E2E8F0; }
.feature-list li i { color: var(--primary-color); font-size: 1.5rem; }
.features-image {
  height: 450px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
}
.cover-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.features-image:hover .cover-image { transform: scale(1.05); }
.image-overlay {
  position: absolute; inset:0; background: rgba(0,0,0,0.5); display: flex; flex-direction:column;
  align-items: center; justify-content: center; color: var(--text-primary); transition: 0.3s;
}
.image-overlay i { font-size: 4rem; color: var(--primary-color); margin-bottom: 1rem; }
.image-overlay span { font-size: 1.5rem; font-weight: bold; font-family: var(--font-heading); }

/* ================== TOP SERVEUR SECTION ================== */
.top-voters-section { padding: 6rem 0; background: var(--bg-dark); }
.voters-grid {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  margin-top: 3rem;
  padding-bottom: 2rem;
}
.voter-card {
  flex: 1;
  max-width: 300px;
  padding: 2.5rem 1.5rem;
  border-radius: 20px;
  text-align: center;
  position: relative;
  transition: var(--transition);
}
.voter-card.champion {
  transform: translateY(-20px);
  border-color: rgba(250, 204, 21, 0.4);
  box-shadow: 0 15px 40px rgba(250, 204, 21, 0.15);
  padding: 3.5rem 1.5rem;
}
.voter-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2);
}
.voter-card.champion:hover {
  transform: translateY(-30px);
}
.voter-card .rank {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  z-index: 2;
}
.rank.first { background: linear-gradient(135deg, #FCD34D, #F59E0B); color: #fff; width: 60px; height: 60px; top: -30px; font-size: 1.8rem; }
.rank.second { background: linear-gradient(135deg, #E2E8F0, #94A3B8); color: #0F172A; }
.rank.third { background: linear-gradient(135deg, #FDBA74, #EA580C); color: #fff; }

.voter-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  overflow: hidden;
  border: 3px solid var(--glass-border);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.champion .voter-avatar {
  width: 120px;
  height: 120px;
  border-color: #FCD34D;
}
.voter-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.voter-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.voter-card p {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2rem;
}

/* ================== GALLERY SECTION ================== */
.gallery-section { padding: 6rem 0; background: #080C14; }
.gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem; margin-top: 2rem;
}
.gallery-item {
    position: relative; height: 300px; border-radius: 16px; overflow: hidden;
    cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}
.gallery-item:hover img { transform: scale(1.1); }
.gallery-item .overlay {
    position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 60%);
    display: flex; flex-direction: column; justify-content: flex-end; padding: 2rem;
    opacity: 0.8; transition: var(--transition);
}
.gallery-item:hover .overlay { opacity: 1; padding-bottom: 2.5rem; background: linear-gradient(to top, rgba(37,99,235,0.8) 0%, transparent 80%); }
.gallery-item h4 { font-size: 1.8rem; margin-bottom: 0.2rem; transform: translateY(10px); transition: 0.4s; }
.gallery-item p { color: #CBD5E1; transform: translateY(10px); opacity: 0; transition: 0.4s; }
.gallery-item:hover h4 { transform: translateY(0); }
.gallery-item:hover p { transform: translateY(0); opacity: 1; }

/* ================== FULL LEADERBOARD TABLE ================== */
.full-leaderboard-section {
  padding: 4rem 0 6rem;
  background: var(--bg-dark);
}
.leaderboard-table-container {
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--glass-border);
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}
.leaderboard-table th {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  text-align: left;
  font-family: var(--font-heading);
  color: var(--primary-color);
  font-size: 1.2rem;
  border-bottom: 2px solid var(--glass-border);
}
.leaderboard-table td {
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 1.1rem;
}
.leaderboard-table tr:last-child td {
  border-bottom: none;
}
.leaderboard-table tbody tr {
  transition: var(--transition);
}
.leaderboard-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.15);
}
.leaderboard-table .rank-badge {
  display: inline-block;
  width: 35px;
  height: 35px;
  line-height: 35px;
  text-align: center;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  font-weight: bold;
}

/* ================== FOOTER ================== */
.footer { background: #05080E; padding: 5rem 0 2rem; border-top: 1px solid var(--glass-border); }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer-brand .footer-logo { height: 60px; margin-bottom: 1rem; }
.footer-brand p { color: var(--text-secondary); max-width: 300px; }
.footer h3 { font-size: 1.3rem; margin-bottom: 1.5rem; color: #E2E8F0; }
.footer-links { display: flex; flex-direction: column; gap: 1rem; }
.footer-links a { color: var(--text-secondary); transition: var(--transition); }
.footer-links a:hover { color: var(--primary-color); padding-left: 8px; }
.social-icons { display: flex; gap: 1rem; }
.social-icons a {
  width: 45px; height: 45px; border-radius: 50%; background: rgba(255, 255, 255, 0.05);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--text-primary);
}
.social-icons a:hover { background: var(--primary-color); transform: translateY(-4px) rotate(8deg); box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4); }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255, 255, 255, 0.05); color: var(--text-secondary); font-size: 0.95rem; }

/* ================== MEDIA QUERIES ================== */
@media (max-width: 992px) {
  .features-content { grid-template-columns: 1fr; }
  .features-image { height: 350px; }
  .voters-grid { flex-direction: column; align-items: center; }
  .voter-card.champion { transform: none; padding: 2.5rem 1.5rem; }
  .voter-card.champion:hover { transform: translateY(-10px); }
  .voter-card { max-width: 350px; width: 100%; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .navbar { grid-template-columns: 1fr auto; }
  .hero-content h1 { font-size: 3rem; }
  .cta-group { flex-direction: column; }
  .btn-large { width: 100%; }
  .footer-top { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
  .footer-brand .footer-logo { margin: 0 auto 1rem; }
  .social-icons { justify-content: center; }
  .stats-wrapper { flex-direction: column; }
}