/* Import des polices */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Cormorant+Garamond:wght@700&display=swap');

:root {
  --bg-dark: #000015;            /* bleu marine très foncé */
  --grid-line: rgba(255,255,255,0.15); /* lignes de grille légèrement grises */
  --text-light: #c5c6c7;
  --accent: #00fff0;
  --white: #ffffff;
}

/* Reset & fond */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  position: relative;
  background: var(--bg-dark);
  color: var(--text-light);
  font-family: 'Orbitron', sans-serif;
  overflow-x: hidden;
}

/* Overlay grille animée */
/* 1. Empêcher tout défilement horizontal */
html, body {
  overflow-x: hidden;
}

/* 2. Grille animée : ajouter background-size et position initiale */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;

  background-image:
    repeating-linear-gradient(
      to right,
      var(--grid-line) 0,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 30px
    ),
    repeating-linear-gradient(
      to bottom,
      var(--grid-line) 0,
      var(--grid-line) 1px,
      transparent 1px,
      transparent 30px
    );
  background-size: 30px 30px;           /* taille d’une maille */
  background-position: 0 0, 0 0;        /* position de départ */
  animation: scrollGrid 30s linear infinite;
}

@keyframes scrollGrid {
  from {
    background-position: 0    0,    0    0;
  }
  to {
    background-position: 0 30px, 30px 0;
  }
}


/* Header */
.astro-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,21,0.8);
  z-index: 100;
}
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: var(--accent);
}
.back-link {
  text-decoration: none;
  color: var(--text-light);
  font-size: 1rem;
}

/* Barre de filtre */
.filter-bar {
  position: sticky;
  top: 4rem;
  background: rgba(0,0,21,0.8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 2rem;
  z-index: 90;
}
.search-input {
  flex: 1;
  max-width: 300px;
  padding: 0.5rem;
  border: none;
  border-radius: 4px;
  background: rgba(31,40,51,0.5);
  color: var(--text-light);
}
.filter-icons {
  display: flex;
  gap: 1rem;
}
.filter-icon {
  cursor: pointer;
  transition: transform 0.2s, color 0.2s;
}
.filter-icon:hover {
  transform: scale(1.2);
  color: var(--accent);
}

/* Conteneur principal */
.astro-main {
  padding: 6rem 2rem 2rem;
  position: relative;
  z-index: 1; /* au-dessus de la grille animée */
}

/* Grille Messier */
.astro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* cartes plus larges */
  gap: 1.5rem; /* espace un peu plus grand */
}

/* Cartes rectangulaires portrait (hautes > larges) */
.astro-card {
  position: relative;
  background: transparent;
  width: 100%;
  padding-bottom: 125%; /* ratio portrait, hauteur > largeur */
  border: 3px solid var(--white); /* contours plus épais */
  border-radius: 8px; /* coins plus arrondis */
  overflow: hidden;
  cursor: pointer;
}

/* Numéro centré */
.card-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: var(--accent);
}

/* Progress bar */
.progress-container {
  padding: 2rem;
}
.progress-bar {
  position: relative;
  background: rgba(31,40,51,0.5);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.5s ease;
}
.progress-text {
  position: absolute;
  right: 0.5rem;
  top: -1.5rem;
  font-family: 'Orbitron', sans-serif;
  color: var(--text-light);
  font-size: 0.9rem;
}
