@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-100.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-100Italic.ttf') format('truetype');
  font-weight: 100;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-300.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-300Italic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-500.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-500Italic.ttf') format('truetype');
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-700.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-700Italic.ttf') format('truetype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-900.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MuseoSans';
  src: url('assets/font/MuseoSansCyrl-900Italic.ttf') format('truetype');
  font-weight: 900;
  font-style: italic;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'MuseoSans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: #fafafa;
  color: #1a1a1a;
}

.main {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.main .search-result-box {
  flex: 1;
  max-width: 440px;
  min-width: 320px;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.search-input {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 300;
  background-color: #fbfbfb;
  outline: none;
  transition: all 0.25s ease;
}

.search-input:focus {
  background-color: #ffffff;
  border-color: #1a1a1a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.search-input {
  flex: 1;
}

.menu-container {
  position: relative;
}

.menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background-color: #fbfbfb;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.25s ease;
}

.menu-button:hover {
  background-color: #ffffff;
  border-color: #1a1a1a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background-color: #ffffff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background-color: #f5f5f5;
}

.dropdown-item.danger {
  color: #e5231b;
}

.dropdown-item.danger:hover {
  background-color: rgba(229, 35, 27, 0.08);
}

/* Variables de couleurs du métro de Rennes */
:root {
  --line-a-color: #e5231b;
  --line-b-color: #009344;
}

.picto-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin: 28px 0 36px 0;
}

.progress-circle {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.progress-circle .tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: #ffffff;
  color: #1a1a1a;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.progress-circle .tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.progress-circle:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.progress-circle img {
  height: 2.5rem;
  width: auto;
  opacity: 0.9;
  z-index: 2;
}

.progress-circle svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-circle circle {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
}

.progress-circle circle.bg {
  stroke: rgba(0, 0, 0, 0.08);
}

.progress-circle circle.meter {
  stroke-dasharray: 264;
  stroke-dashoffset: calc(264 - (264 * var(--progress, 0)) / 100);
  transition: stroke-dashoffset 0.6s ease-in-out;
}

.progress-circle.line-a circle.meter {
  stroke: var(--line-a-color);
}

.progress-circle.line-b circle.meter {
  stroke: var(--line-b-color);
}

.stations-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

.stations-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.station-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 96px;
  padding: 20px 22px;
  background-color: #ffffff;
  border-radius: 14px;
  border: 1px solid #f0f0f0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.station-item:hover {
  border-color: #d1d1d1;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.station-name {
  align-self: flex-start;
  font-size: 1.05rem;
  font-weight: 500;
  color: #1a1a1a;
}

.station-lines {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.station-picto {
  height: 20px;
  width: auto;
  display: block;
  object-fit: contain;
}

.main #map-box {
  flex: 2;
  height: 100vh;
}

.global-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -16px 0 28px 0;
  padding: 10px 16px;
  background-color: #f7f7f7;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1a1a1a;
}

#global-count {
  color: #666;
}

#global-percent {
  font-weight: 700;
  color: #1a1a1a;
}

.app-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-credits {
  font-size: 0.75rem;
  color: #888888;
  line-height: 1.4;
  margin: 0;
}

.footer-credits a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #666666;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #1a1a1a;
}

.footer-link.highlight {
  color: #0070ba;
}

.footer-link.highlight:hover {
  color: #003087;
}

.footer-links .separator {
  color: #cccccc;
  font-size: 0.7rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: #ffffff;
  width: 90%;
  max-width: 440px;
  padding: 32px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  text-align: center;
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 20px;
}

.instructions-list {
  text-align: left;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.88rem;
  color: #333;
}

.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.remember-label {
  font-size: 0.8rem;
  color: #777;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background-color: #1a1a1a;
  color: #ffffff;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #333333;
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background-color: #ffffff;
  color: #666;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Modale de Victoire */
.trophy-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.victory-stats {
  font-size: 1.1rem;
  font-weight: 700;
  color: #009344;
  margin-bottom: 24px;
}

@keyframes shake-red {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.search-input.shake-error {
  animation: shake-red 0.4s ease-in-out;
  border-color: #e5231b !important;
  box-shadow: 0 0 0 3px rgba(229, 35, 27, 0.2) !important;
}

.search-hint {
  font-size: 0.72rem;
  color: #888888;
  margin-top: 6px;
  margin-bottom: 4px;
  line-height: 1.3;
}

.sheet-toggle {
  display: none;
}

@media (max-width: 768px) {
  .main {
    flex-direction: column-reverse;
    height: 100dvh;
    position: relative;
  }

  .main #map-box {
    flex: 1;
    width: 100%;
    height: 100%;
  }

  .main .search-result-box {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    min-width: 0;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-right: none;
    border-radius: 20px 20px 0 0;
    padding: 12px 16px 16px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 20;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sheet-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 6px 0 10px 0;
    background: transparent;
    border: none;
    color: #666;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
  }

  .sheet-toggle .toggle-icon {
    transition: transform 0.3s ease;
  }

  .sheet-content {
    display: none;
    max-height: 50vh;
    overflow-y: auto;
    padding-top: 12px;
  }

  .search-result-box.expanded .sheet-content {
    display: flex;
    flex-direction: column;
  }

  .search-result-box.expanded .toggle-icon {
    transform: rotate(180deg);
  }

  .picto-row {
    margin: 12px 0 20px 0;
  }

  .dropdown-menu {
    bottom: calc(100% + 8px);
    top: auto;
  }

  .search-hint {
    font-size: 0.68rem;
    margin-bottom: 2px;
  }
}