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

body { font-family: 'Nunito', sans-serif; height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: #1a1a2e; color: #e0e0e0; }
h1, h2, h3 { font-family: 'Bubblegum Sans', cursive; }

/* HEADER */
header {
  background: linear-gradient(135deg, #2d1b69, #1a1a2e);
  padding: .6rem 1rem; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem; z-index: 1000;
  border-bottom: 2px solid #6c5ce7;
}
header h1 { font-size: 1.4rem; color: #a29bfe; white-space: nowrap; }
.header-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.btn-era {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #ccc; padding: .3rem .8rem; border-radius: .6rem; cursor: pointer;
  font-family: 'Nunito', sans-serif; font-size: .85rem; font-weight: 600;
  transition: all .2s;
}
.btn-era.active, .btn-era:hover { background: #6c5ce7; color: white; border-color: #6c5ce7; }
.btn-add {
  background: #00b894; color: white; border: none; padding: .3rem .8rem;
  border-radius: .6rem; cursor: pointer; font-family: 'Nunito', sans-serif;
  font-size: .85rem; font-weight: 700; transition: all .2s;
}
.btn-add:hover { background: #00a381; }

/* MAP */
#map { flex: 1; z-index: 1; }

/* Custom markers */
.custom-marker { background: none !important; border: none !important; }
.marker-pin {
  width: 40px; height: 40px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.3); transition: transform .2s;
}
.marker-pin span { transform: rotate(45deg); font-size: 1.3rem; }
.marker-pin.prehistoire { background: linear-gradient(135deg, #e17055, #d63031); }
.marker-pin.antiquite { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
.marker-pin:hover { transform: rotate(-45deg) scale(1.2); }

/* TIMELINE */
.timeline-container {
  background: linear-gradient(135deg, #1a1a2e, #2d1b69);
  padding: .6rem 1rem; border-top: 2px solid #6c5ce7;
  z-index: 1000;
}
.timeline-label { text-align: center; font-weight: 700; color: #a29bfe; font-size: .95rem; margin-bottom: .3rem; }
.timeline-bar { position: relative; }
#timeline-slider {
  width: 100%; height: 6px; -webkit-appearance: none; appearance: none;
  background: linear-gradient(90deg, #e17055 0%, #e17055 40%, #6c5ce7 55%, #a29bfe 100%);
  border-radius: 3px; outline: none; cursor: pointer;
}
#timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fdcb6e; border: 3px solid white; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  cursor: pointer;
}
.timeline-marks { display: flex; justify-content: space-between; margin-top: .2rem; }
.timeline-marks span { font-size: .65rem; color: #888; }

/* INFO PANEL */
.info-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: 380px; max-width: 90vw;
  background: #1e1e3a; z-index: 2000; padding: 1.5rem; overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,.4); transition: transform .3s;
  border-left: 3px solid #6c5ce7;
}
.info-panel.hidden { transform: translateX(100%); }
.info-close {
  position: absolute; top: .8rem; right: .8rem; background: rgba(255,255,255,.1);
  border: none; color: #aaa; width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
}
.info-emoji { font-size: 3rem; text-align: center; margin-bottom: .5rem; }
.info-panel h2 { color: #a29bfe; font-size: 1.5rem; text-align: center; margin-bottom: .5rem; }
.info-meta { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1rem; flex-wrap: wrap; }
.info-tag {
  padding: .2rem .6rem; border-radius: .5rem; font-size: .8rem; font-weight: 700;
}
.info-tag.prehistoire { background: rgba(225,112,85,.2); color: #e17055; }
.info-tag.antiquite { background: rgba(108,92,231,.2); color: #a29bfe; }
.info-date { color: #fdcb6e; font-weight: 600; font-size: .85rem; }
.info-desc { line-height: 1.7; font-size: .95rem; color: #ccc; margin-bottom: 1rem; }
.info-funfact {
  background: rgba(253,203,110,.1); border-left: 3px solid #fdcb6e;
  padding: .8rem 1rem; border-radius: 0 .5rem .5rem 0; font-size: .9rem;
  color: #fdcb6e; line-height: 1.6;
}

/* ADD PANEL */
.add-panel {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #1e1e3a; border: 2px solid #6c5ce7; border-radius: 1rem;
  padding: 1.5rem; z-index: 3000; width: 400px; max-width: 90vw; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.add-panel.hidden { display: none; }
.add-panel h3 { color: #a29bfe; margin-bottom: 1rem; }
.form-row { margin-bottom: .8rem; }
.form-row label { display: block; font-size: .8rem; color: #999; margin-bottom: .2rem; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: .5rem .7rem; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15); border-radius: .5rem; color: #e0e0e0;
  font-family: 'Nunito', sans-serif; font-size: .9rem;
}
.form-row input:focus, .form-row textarea:focus { border-color: #6c5ce7; outline: none; }
.form-hint { font-size: .8rem; color: #666; margin-bottom: .8rem; }
.form-actions { display: flex; gap: .5rem; }

.btn { padding: .5rem 1.2rem; border: none; border-radius: .6rem; cursor: pointer; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: .9rem; transition: all .2s; }
.btn-primary { background: #6c5ce7; color: white; }
.btn-primary:hover { background: #5a4bd1; }
.btn-secondary { background: rgba(255,255,255,.1); color: #ccc; }
.btn-danger { background: #d63031; color: white; margin-top: 1rem; }

/* LIST */
.list-toggle {
  position: fixed; bottom: 70px; left: 1rem; background: #2d1b69; color: #a29bfe;
  padding: .4rem .8rem; border-radius: .6rem; cursor: pointer; z-index: 1500;
  font-weight: 700; font-size: .85rem; box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.list-panel {
  position: fixed; left: 0; top: 0; bottom: 0; width: 320px; max-width: 85vw;
  background: #1e1e3a; z-index: 2000; padding: 1rem; overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0,0,0,.4); border-right: 3px solid #6c5ce7;
}
.list-panel.hidden { transform: translateX(-100%); }
.list-panel h3 { color: #a29bfe; margin-bottom: .8rem; }
.list-item {
  display: flex; align-items: center; gap: .6rem; padding: .6rem;
  background: rgba(255,255,255,.05); border-radius: .6rem; margin-bottom: .4rem;
  cursor: pointer; transition: background .2s;
}
.list-item:hover { background: rgba(108,92,231,.15); }
.list-emoji { font-size: 1.5rem; }
.list-info strong { display: block; font-size: .9rem; color: #e0e0e0; }
.list-meta { font-size: .75rem; color: #888; }
.list-custom { font-size: .8rem; }

/* HIDDEN utility */
.hidden { pointer-events: none; opacity: 0; }
.info-panel.hidden, .list-panel.hidden { opacity: 1; pointer-events: auto; }

/* RESPONSIVE */
@media (max-width: 600px) {
  header { padding: .4rem .6rem; }
  header h1 { font-size: 1.1rem; }
  .btn-era { padding: .2rem .5rem; font-size: .75rem; }
  .info-panel { width: 100%; }
  .timeline-marks span { font-size: .55rem; }
}
