/* =========================================================
   THEME "VOYAGE PREMIUM" — Dashboard Glassmorphism
   ========================================================= */

:root {
  /* Palette Sombre Profonde */
  --bg-deep: #0f111a;
  --bg-panel: rgba(22, 27, 34, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Textes */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;

  /* Accents */
  --accent-primary: #F43F5E;
  /* Rose vibrant */
  --accent-glow: rgba(244, 63, 94, 0.3);
  --accent-secondary: #3b82f6;

  /* UI */
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(244, 63, 94, 0.1) 0%, transparent 40%);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  /* No scroll on desktop main body */
}

/* =========================================================
   LAYOUT: SPLIT SCREEN (Sidebar + Map)
   ========================================================= */

.app-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  height: 100vh;
  width: 100%;
}

/* --- SIDEBAR (Left) --- */
.app-sidebar {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  padding: 40px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 32px);
  z-index: 10;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.about-section, .stats-section, .chips-section {
  flex-shrink: 0;
}

/* Personal scrollbar for sidebar */
.app-sidebar::-webkit-scrollbar {
  width: 6px;
}
.app-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.sidebar-header h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}

.subtitle {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 16px;
  margin: 0;
  font-weight: 400;
}

/* Stats */
.stats-dashboard {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.stat-item {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.stat-number {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-primary);
  text-shadow: 0 0 15px var(--accent-glow);
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}

.chip {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.chip:hover {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 0 12px var(--accent-glow);
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* About Card (Glass Style) */
.glass-panel {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  /* Plus d'espace vertical */
  position: relative;
  overflow: hidden;
  text-align: center;
  /* Centre tout le texte */
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), transparent);
  opacity: 0.7;
}

.about-content {
  display: flex;
  flex-direction: column;
  /* Empile l'image au dessus du texte */
  align-items: center;
  /* Centre horizontalement */
  gap: 12px;
}

.about-image-wrapper {
  flex-shrink: 0;
  width: clamp(90px, 15vh, 140px);
  /* Avatar shrinks vertically on short screens */
  height: clamp(90px, 15vh, 140px);
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  /* Belle ombre pour le détacher */
  animation: float-avatar 6s ease-in-out infinite;
}

@keyframes float-avatar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.about-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-deep);
}

.about-text h2 {
  font-size: clamp(18px, 2vh, 22px);
  /* Un peu plus grand */
  margin: 4px 0 8px;
  color: white;
}

.about-text-content {
  max-height: 180px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
}

.about-text-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(22, 27, 34, 0), rgba(22, 27, 34, 1));
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.about-text-content.expanded {
  max-height: 2000px;
}

.about-text-content.expanded::after {
  opacity: 0;
}

.read-more-btn {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, text-shadow 0.2s;
  margin-top: 5px;
}

.read-more-btn:hover {
  color: #fb7185;
  text-shadow: 0 0 8px rgba(244, 63, 94, 0.4);
}

.about-text p {
  color: var(--text-muted);
  font-size: clamp(13px, 1.8vh, 15px);
  line-height: 1.5;
  margin: 0 0 10px 0;
  text-align: justify;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  padding-top: 20px;
}

/* --- MAP AREA (Right) --- */
.app-map-area {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1b202e 0%, #0f111a 100%);
  overflow: hidden;
}

.full-map {
  width: 100%;
  height: 100%;
}

.alert-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(244, 63, 94, 0.1);
  color: var(--accent-primary);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--accent-primary);
}

/* Map specific override for visuals */
.jvm-zoom-btn {
  background-color: var(--bg-panel) !important;
  color: white !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 8px !important;
  padding: 8px !important;
  width: 32px;
  height: 32px;
  line-height: 16px;
}

/* Custom cursor */
.full-map path {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23F43F5E" stroke-width="2"><circle cx="12" cy="12" r="8"></circle></svg>') 12 12, auto;
}

/* Forcing color */
.jvm-region.visited-country {
  fill: var(--accent-primary) !important;
  filter: drop-shadow(0 0 4px rgba(244, 63, 94, 0.5));
  stroke: rgba(255, 255, 255, 0.2) !important;
  stroke-width: 0.5px;
}

.jvm-region.visited-country:hover {
  fill-opacity: 1 !important;
  stroke: white !important;
  stroke-width: 1.5px;
  filter: drop-shadow(0 0 12px rgba(244, 63, 94, 0.8));
  z-index: 99;
}

/* =========================================================
   DRAWER (Modal)
   ========================================================= */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  /* Side drawer on desktop */
  width: 480px;
  background: #151922;
  border-left: 1px solid var(--glass-border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.drawer-header h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: white;
}

.drawer-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.drawer-intro {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
  border-left: 3px solid var(--accent-primary);
  padding-left: 16px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Swiper Styling */
.swiper {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.slide {
  position: relative;
}

.media {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.caption {
  padding: 16px;
  background: #1e2430;
}

.caption h4 {
  margin: 0 0 4px;
  color: white;
}

.caption p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9em;
}

/* =========================================================
   MOBILE RESPONSIVENESS
   ========================================================= */

@media (max-width: 1024px) {
  body {
    overflow: auto;
    /* Allow scroll on mobile */
    height: auto;
  }

  .app-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .app-sidebar {
    padding: 24px 20px;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    overflow: visible;
  }

  .app-map-area {
    height: 70vh;
    flex-shrink: 0;
    /* Fixed height for map on mobile */
    min-height: 400px;
  }

  /* Drawer becomes bottom sheet on mobile */
  .drawer {
    width: 100%;
    right: auto;
    top: auto;
    left: 0;
    bottom: 0;
    border-left: none;
    border-top: 1px solid var(--glass-border);
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    transform: translateY(110%);
  }

  .drawer.open {
    transform: translateY(0);
  }

  .drawer-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    margin: 10px auto;
    border-radius: 4px;
  }
}

@media (max-width: 600px) {
  .sidebar-header h1 {
    font-size: 28px;
  }

  .stat-number {
    font-size: 20px;
  }

  .app-map-area {
    height: 50vh;
  }
}