:root {
    --bg: #0b1020;
    --fg: #f5f5f5;
    --accent: #ffcc00;
    --accent-red: #ff4500;
    --accent-soft: rgba(255, 204, 0, 0.2);
    --border: #222a3a;
    --muted: #9aa0b5;
  }
  
  /* Reset básico */
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html, body {
    overflow-y: hidden;
  }

  
  /* Estrutura geral */
  body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--fg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  /* Header + timeline */
  header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: #111628;
  }
  
  .header-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
  }
  
  .app-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
  }
  
  .search-wrapper {
    display: flex;
    flex: 1;
    max-width: 420px;
    gap: 0.5rem;
    align-items: center;
  }
  
  .search-wrapper input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #0c1224;
    color: var(--fg);
    font-size: 0.85rem;
  }
  
  .search-wrapper input::placeholder {
    color: var(--muted);
  }
  
  .search-wrapper button {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #111;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }
  
  .search-wrapper button:hover {
    filter: brightness(1.05);
  }
  
  .timeline {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.5rem 0;
    scrollbar-width: thin;
  }
  
  .timeline-item {
    flex: 0 0 auto;
    min-width: 160px;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
    transition: transform 0.25s ease, filter 0.25s ease;
  }
  
  /* overlay escuro */
  .timeline-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(1px);
    z-index: 0;
  }
  
  /* conteúdo por cima do overlay */
  .timeline-item > * {
    position: relative;
    z-index: 1;
  }
  
  /* hover */
  .timeline-item:hover {
    transform: translateY(-3px);
    filter: brightness(1.15);
  }
  
  /* active */
  .timeline-item.active {
    border-color: var(--accent);
    filter: brightness(1.25);
  }
  
  .tl-year {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
  }
  
  .tl-city {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--fg);
  }
  
  .tl-event {
    font-size: 0.75rem;
    color: var(--muted);
  }
  

/* Firefox */
.timeline {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) #0c1224;

  }
  
/* Chrome, Edge, Safari */
.timeline::-webkit-scrollbar {
    height: 26px;                 /* altura maior */
    background: #0c1224;
    border-radius: 26px;
  }
  
  /* Track */
  .timeline::-webkit-scrollbar-track {
    background: #0c1224;
    border-radius: 26px;
  }
  
  /* Thumb */
  .timeline::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 26px;
    border: 6px solid #0c1224;    /* espessura maior */
  }
  
  /* Hover */
  .timeline::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
  }


  
  
  /* Layout principal: mapa + coluna direita */
  main {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 120px); /* header + timeline */
    overflow: hidden;
  }
  
  /* Mapa europeu à esquerda */
  .canvas-wrapper {
    flex: 1;
    border-right: 1px solid var(--border);
    border-radius: 0.75rem 0 0 0;
    background: radial-gradient(circle at top, #1b2340 0, #050814 55%);
    position: relative;
    overflow: hidden;
    display: flex;
  }
  
  .map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
  }
  
  svg {
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
  }
  
  /* Países e ícones de cidade */
  .country {
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
  }
  
  .country:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
  }
  
  .city-icon {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 1;
  }
  
  .city-icon.highlight {
    stroke: var(--accent);
    stroke-width: 2;
  }
  
  /* Ícone base */
  .city-icon {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 1.2;
   /*  transition: transform 0.25s ease, stroke 0.25s ease, filter 0.25s ease; */
  }
  
  /* Hover: brilho + ligeiro zoom */
  .city-icon:hover {
/*     transform: scale(1.25); */
    stroke: var(--accent-red);
    filter: drop-shadow(0 0 4px var(--accent));
  }
  
  /* Active (evento selecionado) */
  .city-icon.active,
  .city-icon.highlight {
/*     transform: scale(1.35); */
    stroke: var(--accent-red);
    stroke-width: 2;
    filter: drop-shadow(0 0 6px var(--accent));
  }

  .city-event-icon {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 1.2;
    transition: transform 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
  }
  
  /* Hover */
  .city-event-icon:hover {
/*     transform: scale(1.3); */
    stroke: var(--accent-red);
    filter: drop-shadow(0 0 4px var(--accent));
  }
  
  /* Active */
  .city-event-icon.active {
/*     transform: scale(1.4); */
    stroke: var(--accent-red);
    stroke-width: 2;
    filter: drop-shadow(0 0 6px var(--accent));
  }
  

  /* Coluna direita: flyer + submapa */
  .sidebar-right {
    width: 360px;
    max-width: 360px;
    background: #0c1224;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0.75rem;
    gap: 1rem;
  }
  
  /* Flyer */
  .flyer-popup {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #111628;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  }
  
  .flyer-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #111;
  }
  
  .flyer-info {
    padding: 0.75rem;
    font-size: 0.8rem;
  }
  
  .flyer-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
  }
  
  .flyer-meta {
    color: var(--muted);
    margin-bottom: 0.25rem;
  }
  
  .flyer-date {
    color: var(--accent);
    font-size: 0.75rem;
  }
  
  .flyer-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.6);
    color: var(--fg);
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  
  /* Sub‑mapa de cidade */
  .city-submap {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #111628;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  }
  
  .city-submap-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
  }
  
  .city-submap-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.5);
    color: var(--fg);
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  
  #cityMap {
    width: 100%;
    height: 260px;
  }
  
  /* Responsivo */
  @media (max-width: 900px) {
    main {
      flex-direction: column;
      height: auto;
    }
  
    .canvas-wrapper {
      width: 100%;
      height: 60vh;
      border-right: none;
      border-bottom: 1px solid var(--border);
      border-radius: 0.5rem;
    }
  
    .sidebar-right {
      width: 100%;
      max-width: none;
      height: auto;
      border-left: none;
      border-top: 1px solid var(--border);
    }
  
    header {
      padding: 0.6rem 0.75rem;
    }
  
    .header-top {
      flex-direction: column;
      align-items: flex-start;
    }
  
    .search-wrapper {
      max-width: 100%;
    }

    html, body {
      overflow-y: scroll;
    
  }
}
 
  



  .flyer-fullscreen {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.42);   /* transparência dobrada */
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
  }
  
  
  /* Ativo */
  .flyer-fullscreen.active {
    display: flex;
  }
  
  /* Imagem principal */
  .ff-image {
    max-width: 60vw;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(255,255,255,0.15);
    transition: transform 0.6s ease, opacity 0.6s ease;
    transform: perspective(1200px) translateZ(0);
    
  }

  .ff-image {
    touch-action: pan-y; /* permite swipe horizontal sem bloquear o scroll vertical */
  }
  
  
  /* Miniaturas 3D */
  .ff-thumb {
    position: absolute;
    top: 50%;
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    opacity: 0.7;
    cursor: pointer;
    transition: transform 0.5s ease, opacity 0.5s ease;
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
  }
  
  /* Miniatura anterior (esquerda) */
  .ff-thumb-prev {
    left: 40px;
    transform: translateY(-50%) rotateY(25deg) scale(0.85);
  }
  
  /* Miniatura seguinte (direita) */
  .ff-thumb-next {
    right: 40px;
    transform: translateY(-50%) rotateY(-25deg) scale(0.85);
  }
  
  .ff-thumb:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1) rotateY(0deg);
  }
  
  /* Zoom-in / Zoom-out */
  .ff-image.zoom-in {
    transform: perspective(1200px) translateZ(60px) scale(1.05);
    opacity: 1;
  }
  
  .ff-image.zoom-out {
    transform: perspective(1200px) translateZ(-120px) scale(0.7);
    opacity: 0.4;
  }
  
  /* Legenda lateral */
 /* Legenda lateral colada à imagem */
.ff-caption {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  max-width: 240px;

  /* posicionamento relativo à imagem */
  left: calc(50% + (20vw / 2) + 10px); 
  top: 50%;
  transform: translateY(-50%);

  background: rgba(0,0,0,0.5);
  border-radius: 12px;
  padding:5px;
}

/* Tipografia mantém o estilo */
.ff-year {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.ff-city {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
}

.ff-event {
  font-size: 0.85rem;
  color: var(--muted);
}

  
  /* Botão fechar */
  .ff-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    color: var(--fg);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  
.app-title a:hover{
  text-decoration: none;
  color:#1b2340;
  background-color:cadetblue;
  font-weight: 800;
}

.app-title a{
  text-decoration: none;
  color:cadetblue;
  background-color:#1b2340;
  font-weight: 400;
  border-radius:5px;
  padding:5px;
}


.flyer-image-wrapper {
  position: relative;
  display: inline-block;
}

.flyer-zoom-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 1.1rem;
  padding: 6px 10px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  cursor: pointer;
  opacity: 0.85;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 5;
}

.flyer-zoom-icon:hover {
  transform: scale(1.15);
  opacity: 1;
}

.mode-switch {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
  z-index: 9999;
}

.mode-switch button {
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.25s ease;
}

.mode-switch button:hover {
  background: rgba(255,255,255,0.15);
}

/* Container do modo folhas */
.leafs-mode {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  z-index: 9000;
}

/* Cada flyer miniatura */
.leaf-item {
  position: absolute;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.35s ease, opacity 0.35s ease;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
}

/* Hover cinematográfico */
.leaf-item:hover {
  transform: scale(1.4);
  z-index: 9999;
}


/* Container do modo folhas */
.leafs-mode {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  z-index: 9000;
  perspective: 2000px; /* profundidade 3D */
}

/* Cada flyer miniatura */
.leaf-item {
  position: absolute;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.35s ease, opacity 0.35s ease;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  transform-style: preserve-3d;
}

/* Hover cinematográfico + legenda */
.leaf-item:hover {
  transform: scale(1.4) translateZ(80px);
  z-index: 9999;
}

/* Legenda ao hover */
.leaf-caption {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--fg);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.leaf-item:hover .leaf-caption {
  opacity: 1;
}

/* Animação de rotação lenta */
@keyframes leafsRotate {
  from { transform: rotateZ(0deg); }
  to   { transform: rotateZ(360deg); }
}

.leafs-mode.rotate {
  animation: leafsRotate 40s linear infinite;
}
