/* =============================== Font ================================ */
@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;700&display=swap');

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

/* =============================== Body ================================ */
body {
  font-family: 'Comfortaa', cursive;
  color: #f8f8f2;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem;
  background: transparent;
  overflow-x: hidden;
}

/* =============================== Background Media ================================ */
#bg-video,
#bg-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
  display: none; /* JS decides which one is visible */
}

/* Dark overlay for readability */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(40, 42, 54, 0.55);
  z-index: -1;
  pointer-events: none;
}

/* =============================== Main Container ================================ */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ============================== Descriptions de cases ============================== */
.description {
  position: relative;
  z-index: 1;
  margin-top: 3rem;
  text-align: center;
  color: #6272a4;
  font-size: 0.9rem;
}

/* =============================== Header ================================ */
h1 {
  font-size: 2.5rem;
  color: #bd93f9;
  margin-bottom: 2rem;
  text-align: center;
}

/* =============================== Cards ================================ */
.card {
  background-color: rgba(68, 71, 90, 0.95);
  color: #f8f8f2;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.2rem;
  text-align: center;
  width: 100%;
  max-width: 400px;
  margin: 0.7rem 0;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.card:hover {
  background-color: #6272a4;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Make links fill card */
.card a {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* =============================== Images ================================ */
.img {
  max-height: 200px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* =============================== Forms ================================ */
form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(68, 71, 90, 0.95);
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  width: 100%;
  margin: 1rem 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

label {
  width: 100%;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

input[type="text"],
select {
  width: 100%;
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 8px;
  outline: none;
  background-color: #6272a4;
  color: #f8f8f2;
  font-family: inherit;
  font-size: 1rem;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

input[type="text"]:focus,
select:focus {
  background-color: #50fa7b;
  color: #282a36;
  transform: scale(1.02);
}

/* =============================== Buttons ================================ */
button {
  background-color: #bd93f9;
  color: #282a36;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

button:hover {
  background-color: #ff79c6;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* =============================== Footer ================================ */
footer {
  position: relative;
  z-index: 1;
  margin-top: 3rem;
  text-align: center;
  color: #6272a4;
  font-size: 0.9rem;
}

/* =============================== PHP Directory Index Helpers ================================ */
.card .file-type {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: #bd93f9;
}

/* =============================== Responsive ================================ */
@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .card,
  form {
    font-size: 1.1rem;
    width: 100%;
  }
}

/* =============================== Cookies ================================ */
.cookie-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

button.cookie-btn {
  background-color: #bd93f9 !important;
  color: #282a36 !important;
}

button.cookie-btn:hover {
  background-color: #ff79c6 !important;
}

/* =============================== Reduced Motion ================================ */
@media (prefers-reduced-motion: reduce) {
  #bg-video {
    display: none !important;
  }

  #bg-image {
    display: block !important;
  }
}

/* ============================= Barre de chargement ============================= */
#loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff69b4, #ff1493);
    width: 0%;
    transition: width 0.3s ease;
    z-index: 9999;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.6);
}
