* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #0d0d0d;
  color: white;
  display: flex;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #1b1b1b;
  color: #cce0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.top-bar-user {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #cce0ff;
}

.top-bar-user .logout-btn {
  font-size: 13px;
  padding: 6px 10px;
}

.discord-login-btn {
  --glow-color: rgb(100, 180, 255);
  --glow-spread-color: rgba(100, 180, 255, 0.1);
  --btn-color: rgb(20, 60, 120);

  position: fixed;
  top: 12px;
  right: 160px;
  z-index: 2000;

  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: bold;
  padding: 8px 14px;
  color: var(--glow-color);
  background-color: var(--btn-color);
  border: .25em solid var(--glow-color);
  border-radius: 1em;
  text-shadow: 0 0 .5em var(--glow-color);
  box-shadow:
    0 0 1em .25em var(--glow-color),
    0 0 4em 1em var(--glow-spread-color),
    inset 0 0 .75em .25em var(--glow-color);
  cursor: pointer;
  transition: all 0.3s;
}

.discord-login-btn:hover {
  color: var(--btn-color);
  background-color: var(--glow-color);
  box-shadow:
    0 0 1em .25em var(--glow-color),
    0 0 4em 2em var(--glow-spread-color),
    inset 0 0 .75em .25em var(--glow-color);
}

.sidebar {
  --glow-color: rgb(100, 180, 255);
  text-shadow: 0 0 .5em var(--glow-color);
  text-align: center;
  margin-top: 60px;
  width: 300px;
  height: 110vh;
  padding: 10px;
  background-color: #111;
  color: #cce0ff;
  box-sizing: border-box;
}

.sidebar h2,
.sidebar h3,
.sidebar h4 {
  font-size: 28px;
  margin-bottom: 20px;
}

.sidebar a {
  --glow-color: rgb(100, 180, 255);
  --glow-spread-color: rgba(100, 180, 255, 0.1);
  --enhanced-glow-color: rgb(150, 210, 255);
  --btn-color: rgb(20, 60, 120);

  display: block;
  margin-bottom: 20px;
  margin-left: 50px;
  padding: 15px;
  left: -30px;
  font-size: 17px;
  font-weight: bold;
  text-align: center;
  color: var(--glow-color);
  background-color: var(--btn-color);
  border: .25em solid var(--glow-color);
  border-radius: 1em;
  outline: none;
  text-shadow: 0 0 .5em var(--glow-color);
  box-shadow:
    0 0 1em .25em var(--glow-color),
    0 0 4em 1em var(--glow-spread-color),
    inset 0 0 .75em .25em var(--glow-color);
  position: relative;
  transition: all 0.3s;
}

.sidebar a:hover {
  background-color: #111;
}

button {
  --glow-color: rgb(100, 180, 255);
  --glow-spread-color: rgba(100, 180, 255, 0.1);
  --enhanced-glow-color: rgb(150, 210, 255);
  --btn-color: rgb(20, 60, 120);
  top: 4%;
  border: .25em solid var(--glow-color);
  padding: 0.4rem 0.6rem;
  color: var(--glow-color);
  font-size: 15px;
  font-weight: bold;
  background-color: var(--btn-color);
  border-radius: 1em;
  outline: none;
  box-shadow: 0 0 1em .25em var(--glow-color),
              0 0 4em 1em var(--glow-spread-color),
              inset 0 0 .75em .25em var(--glow-color);
  text-shadow: 0 0 .5em var(--glow-color);
  position: relative;
  transition: all 0.3s;
}

button::after {
  pointer-events: none;
  content: "";
  position: absolute;
  top: 120%;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: var(--glow-spread-color);
  filter: blur(2em);
  opacity: .7;
  transform: perspective(1.5em) rotateX(35deg) scale(1, .6);
}

button:hover {
  color: var(--btn-color);
  background-color: var(--glow-color);
  box-shadow: 0 0 1em .25em var(--glow-color),
              0 0 4em 2em var(--glow-spread-color),
              inset 0 0 .75em .25em var(--glow-color);
}

button:active {
  box-shadow: 0 0 0.6em .25em var(--glow-color),
              0 0 2.5em 2em var(--glow-spread-color),
              inset 0 0 .5em .25em var(--glow-color);
}

.main-content {
  margin-left: 320px;
  padding: 80px 0 60px;
  flex: 1;
  align-items: stretch;
  text-align: left;
}

.card {
  background-color: #12153a;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.7);
}

.card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.card h3 {
  margin: 10px 0;
  font-size: 1.1rem;
  color: #cce0ff;
}

.card a button {
  margin: 10px 0 15px;
  padding: 8px 15px;
  border: none;
  border-radius: 6px;
  background-color: #1a4dff;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s;
}

.card a button:hover {
  background-color: #4d80ff;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background-color: #1b1b1b;
  color: #6fa8ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 999;
}

#stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #90b0ff;
  border-radius: 50%;
  box-shadow: 0 0 6px 2px #6fa8ff;
  opacity: 0;
  animation: twinkle 2s infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}

@media (max-width: 1024px) {
  .main-content { margin-left: 20px; }
  .sidebar { width: 200px; }
}

@media (max-width: 600px) {
  .main-content { margin-left: 10px; }
  .sidebar { display: none; }
  #wishlist-grid { grid-template-columns: 1fr; }
  .discord-login-btn { display: none; }
  .top-bar-user { right: 8px; font-size: 12px; }
}

.wishlist-table {
  width: 100%;
  border-collapse: collapse;
  margin-left: 0;
  margin-top: 30px;
  background-color: #111;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  border-radius: 10px;
  overflow: hidden;
}

.wishlist-table thead {
  background-color: #1b1b1b;
}

.wishlist-table th {
  text-align: left;
  padding: 15px;
  font-size: 16px;
  font-weight: bold;
  color: #cce0ff;
  border-bottom: 2px solid #222;
  height: 60px;
}

.wishlist-table td {
  padding: 15px;
  border-bottom: 1px solid #222;
  vertical-align: middle;
  color: #cce0ff;
  height: 60px;
}

.wishlist-table .remove {
  --glow-color: rgb(255, 46, 46);
  padding: 15px;
  border-bottom: 1px solid #111;
  vertical-align: middle;
  color: #ff0000;
  text-shadow: 0 0 .5em var(--glow-color);
  font-size: 35px;
  cursor: pointer;
  height: 60px;
}

.wishlist-table tbody tr:hover {
  background-color: rgba(100, 180, 255, 0.05);
}

/* Colonne image produit */
.wishlist-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(100,180,255,0.4);
}

/* Prix avec réduction */
.old-price {
  text-decoration: line-through;
  color: #888;
  margin-right: 8px;
}
.new-price {
  color: #6fa8ff;
  font-weight: bold;
}

/* Bouton Add to Cart */
.add-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #0d0d0d;
  color: #cce0ff;
  border: 2px solid #6fa8ff;
  font-weight: bold;
  transition: all 0.3s;
}
.add-btn:hover {
  background-color: #6fa8ff;
  color: #0d0d0d;
}

/* Conteneur du prix total et bouton payer */
.wishlist-total-container {
  margin-top: 25px;
  margin-left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #111;
  padding: 0 20px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(100, 180, 255, 0.3);
  border: 2px solid #6fa8ff;
  height: 60px;
}

.wishlist-total {
  font-size: 1.3rem;
  font-weight: bold;
  color: #cce0ff;
  text-shadow: 0 0 8px rgba(100, 180, 255, 0.8);
}

/* Bouton "Payer" principal */
.wishlist-pay-btn {
  --glow-color: rgb(100, 180, 255);
  --glow-spread-color: rgba(100, 180, 255, 0.1);
  --btn-color: rgb(20, 60, 120);

  padding: 8px 25px;
  border: 0.25em solid var(--glow-color);
  border-radius: 1em;
  font-size: 1rem;
  font-weight: bold;
  background-color: var(--btn-color);
  color: var(--glow-color);
  cursor: pointer;
  box-shadow:
    0 0 1em 0.25em var(--glow-color),
    0 0 3em 1em var(--glow-spread-color),
    inset 0 0 0.75em 0.25em var(--glow-color);
  text-shadow: 0 0 0.5em var(--glow-color);
  position: relative;
  transition: all 0.3s ease;
}

.wishlist-pay-btn:hover {
  color: #0d0d0d;
  background-color: var(--glow-color);
  box-shadow:
    0 0 1.2em 0.25em var(--glow-color),
    0 0 4em 2em var(--glow-spread-color),
    inset 0 0 0.8em 0.25em var(--glow-color);
}

.wishlist-pay-btn:active {
  box-shadow:
    0 0 0.6em 0.25em var(--glow-color),
    0 0 2.5em 1.5em var(--glow-spread-color),
    inset 0 0 0.5em 0.25em var(--glow-color);
}

/* Responsive Wishlist */
@media (max-width: 768px) {
  body {
    background-color: #0d0d0d;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 70px 16px 80px 16px;
  }

  .top-bar {
    background-color: #1b1b1b;
    color: #cce0ff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    text-align: center;
    justify-content: center;
  }

  .wishlist-table {
    background: transparent;
    box-shadow: none;
    margin-left: 0;
    margin-top: 0;
  }

  .wishlist-table thead { 
    display: none; 
  }

  .wishlist-table .desktop-only {
    display: none;
  }

  .wishlist-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .wishlist-table tr {
    display: flex;
    flex-direction: column;
    background: #12153a;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    position: relative;
    border: none;
  }

  .wishlist-table tbody tr:hover {
    background: #1a1f4d;
    box-shadow: 0 8px 20px rgba(0,0,0,0.7);
  }

  .wishlist-table td {
    display: block;
    padding: 8px 0;
    border: none;
    text-align: left;
  }

  .wishlist-table .remove {
    --glow-color: rgb(255, 77, 77);
    --glow-spread-color: rgba(255, 77, 77, 0.1);
    --btn-color: rgb(120, 20, 20);
    
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--btn-color);
    color: var(--glow-color);
    border: 0.15em solid var(--glow-color);
    border-radius: 0.8em;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: block;
    box-shadow:
      0 0 0.8em 0.12em var(--glow-color),
      0 0 1.5em 0.4em var(--glow-spread-color),
      inset 0 0 0.4em 0.12em var(--glow-color);
    text-shadow: 0 0 0.4em var(--glow-color);
    transition: all 0.3s;
  }

  .wishlist-table .remove:active {
    transform: scale(0.95);
    box-shadow:
      0 0 0.5em 0.1em var(--glow-color),
      0 0 1em 0.3em var(--glow-spread-color),
      inset 0 0 0.3em 0.1em var(--glow-color);
  }

  /* td:nth-child(2) = Nom + Image */
  .wishlist-table td:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    padding-top: 0;
  }

  .wishlist-img { 
    width: 100%;
    height: 150px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 8px rgba(100,180,255,0.4);
    margin: 0;
  }

  /* td:nth-child(3) = Catégorie */
  .wishlist-table td:nth-child(3)::before {
    content: "Catégorie: ";
    color: #6fa8ff;
    font-weight: bold;
  }

  /* td:nth-child(4) = Prix */
  .wishlist-table td:nth-child(4)::before {
    content: "Prix: ";
    color: #6fa8ff;
    font-weight: bold;
  }

  /* td:nth-child(5) = Promotion */
  .wishlist-table td:nth-child(5)::before {
    content: "Promotion: ";
    color: #6fa8ff;
    font-weight: bold;
  }

  /* td:nth-child(6) = Pack */
  .wishlist-table td:nth-child(6)::before {
    content: "Pack: ";
    color: #6fa8ff;
    font-weight: bold;
  }

  /* td:nth-child(7) = Action */
  .wishlist-table td:nth-child(7) {
    padding-top: 12px;
  }

  .wishlist-table td:nth-child(3),
  .wishlist-table td:nth-child(4),
  .wishlist-table td:nth-child(5),
  .wishlist-table td:nth-child(6) {
    color: #8fadcc;
    font-size: 0.9rem;
  }

  .add-btn {
    --glow-color: rgb(100, 180, 255);
    --glow-spread-color: rgba(100, 180, 255, 0.1);
    --btn-color: rgb(20, 60, 120);
    
    background: var(--btn-color) !important;
    color: var(--glow-color) !important;
    border: 0.2em solid var(--glow-color) !important;
    border-radius: 1em !important;
    padding: 12px 20px !important;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    box-shadow:
      0 0 1em 0.15em var(--glow-color),
      0 0 2em 0.5em var(--glow-spread-color),
      inset 0 0 0.5em 0.15em var(--glow-color);
    text-shadow: 0 0 0.5em var(--glow-color);
  }

  .add-btn:active {
    transform: scale(0.98);
    box-shadow:
      0 0 0.6em 0.15em var(--glow-color),
      0 0 1.5em 0.5em var(--glow-spread-color),
      inset 0 0 0.4em 0.15em var(--glow-color);
  }

  .wishlist-total-container {
    margin-left: 0;
    background-color: #12153a;
    border: 2px solid #6fa8ff;
    box-shadow: 0 0 20px rgba(100, 180, 255, 0.3);
  }

  .footer {
    background-color: #1b1b1b;
    color: #6fa8ff;
}

/* ========== Optimisations Safari/macOS ========== */

html {
  -webkit-scroll-behavior: smooth;
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(100, 180, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 180, 255, 0.4);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 180, 255, 0.7);
}

input, textarea, select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: 16px;
  border-radius: 6px;
}

button {
  -webkit-appearance: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}

.discord-login-btn,
.logout-btn {
  -webkit-user-select: none;
  user-select: none;
}

/* Optimisation pour MacBook */
@media (min-width: 1440px) {
  .main-content {
    padding: 80px 60px 40px 60px;
  }

  .wishlist-grid {
    gap: 30px;
  }

  .wishlist-card {
    max-width: 320px;
  }
}

@media (min-width: 1024px) and (max-width: 1440px) {
  .main-content {
    padding: 80px 40px 40px 40px;
  }

  .wishlist-grid {
    gap: 24px;
  }
}

    box-shadow: 0 -2px 4px rgba(0,0,0,0.4);
  }
}
