/* ============================================================
   GameZone — sidebar.css + animations.css
   Sidebar stylée + animations globales
   ============================================================ */

/* ============================================================
   ANIMATIONS GLOBALES
   ============================================================ */

/* Fade-in au scroll */
@keyframes gz-fadein-up {
  from { opacity:0; transform:translateY(18px); }
  to   { opacity:1; transform:translateY(0); }
}

@keyframes gz-fadein {
  from { opacity:0; }
  to   { opacity:1; }
}

@keyframes gz-scalein {
  from { opacity:0; transform:scale(.94); }
  to   { opacity:1; transform:scale(1); }
}

@keyframes gz-slidein-right {
  from { opacity:0; transform:translateX(20px); }
  to   { opacity:1; transform:translateX(0); }
}

@keyframes gz-pulse-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(124,58,237,.3); }
  50%      { box-shadow: 0 0 0 8px rgba(124,58,237,.0); }
}

@keyframes gz-shimmer {
  0%   { background-position:-200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes gz-float {
  0%,100% { transform:translateY(0); }
  50%     { transform:translateY(-4px); }
}

/* Éléments animés au scroll */
[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}

[data-animate].gz-visible {
  opacity: 1;
  transform: none;
}

/* Délais en cascade */
[data-animate]:nth-child(1) { transition-delay: .05s; }
[data-animate]:nth-child(2) { transition-delay: .12s; }
[data-animate]:nth-child(3) { transition-delay: .19s; }
[data-animate]:nth-child(4) { transition-delay: .26s; }
[data-animate]:nth-child(5) { transition-delay: .33s; }

/* Cards avec hover lift */
.gz-game-card {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.gz-game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  border-color: rgba(124,58,237,.35);
}

/* Hover image zoom */
.gz-game-card__thumb, .gz-slider__bg {
  overflow: hidden;
}

.gz-game-card__thumb img {
  transition: transform .4s ease;
}

.gz-game-card:hover .gz-game-card__thumb img {
  transform: scale(1.05);
}

/* Score badge pulse */
.gz-game-card__score {
  animation: gz-pulse-glow 3s ease infinite;
}

/* Links avec underline animé */
.gz-widget-top-item__title,
.gz-widget-news-item__title {
  background-image: linear-gradient(#a78bfa, #a78bfa);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .25s ease;
}

.gz-widget-top-item:hover .gz-widget-top-item__title,
.gz-widget-news-item:hover .gz-widget-news-item__title {
  background-size: 100% 1px;
}

/* Back to top */
#gz-back-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  box-shadow: 0 4px 16px rgba(124,58,237,.4);
}

#gz-back-top.visible {
  opacity: 1;
  transform: none;
}

#gz-back-top:hover {
  background: #6d28d9;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,58,237,.5);
}

/* Toast notifications */
#gz-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.gz-toast {
  background: #16162a;
  border: 1px solid #2a2a45;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: .85rem;
  font-weight: 600;
  color: #e2e2f0;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: gz-fadein-up .3s ease forwards;
  max-width: 340px;
  text-align: center;
}

.gz-toast--success { border-color: rgba(34,197,94,.35); }
.gz-toast--success::before { content:'✓'; color:#22c55e; font-weight:900; }
.gz-toast--error   { border-color: rgba(239,68,68,.35); }
.gz-toast--error::before   { content:'✕'; color:#ef4444; font-weight:900; }
.gz-toast--info    { border-color: rgba(124,58,237,.35); }
.gz-toast--info::before    { content:'i'; color:#a78bfa; font-weight:900; font-style:italic; }

.gz-toast.gz-toast--hide {
  animation: gz-fadein-up .25s ease reverse forwards;
}

/* Skeleton loading */
.gz-skeleton {
  background: linear-gradient(90deg, #16162a 25%, #1e1e2e 50%, #16162a 75%);
  background-size: 200% 100%;
  animation: gz-shimmer 1.5s infinite;
  border-radius: 6px;
}

/* ============================================================
   SIDEBAR — Widgets stylés
   ============================================================ */
.gz-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: calc(var(--gz-header-h, 64px) + 16px);
  max-height: calc(100vh - var(--gz-header-h, 64px) - 32px);
  overflow-y: auto;
  scrollbar-width: none;
}

.gz-sidebar::-webkit-scrollbar { display: none; }

/* Widget base */
.gz-widget {
  background: #13131f;
  border: 1px solid #1a1a2e;
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .2s;
}

.gz-widget:hover {
  border-color: rgba(124,58,237,.2);
}

.gz-widget__title {
  padding: 12px 16px;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #555;
  border-bottom: 1px solid #1a1a2e;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0,0,0,.2);
}

.gz-widget__title svg {
  opacity: .6;
  flex-shrink: 0;
}

.gz-widget__body {
  padding: 12px 14px;
}

.gz-widget__footer {
  padding: 10px 14px;
  border-top: 1px solid #1a1a2e;
  text-align: center;
}

.gz-widget__footer a {
  font-size: .78rem;
  font-weight: 700;
  color: #7777aa;
  text-decoration: none;
  transition: color .15s;
}

.gz-widget__footer a:hover { color: #a78bfa; }

/* ============================================================
   WIDGET TOP DES TESTS
   ============================================================ */
.gz-widget-top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s;
  position: relative;
}

.gz-widget-top-item:hover {
  background: rgba(124,58,237,.06);
}

.gz-widget-top-item__rank {
  width: 20px;
  font-size: .72rem;
  font-weight: 800;
  color: #444;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gz-widget-top-item__cover {
  width: 36px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #1a1a2e;
  border: 1px solid #1e1e32;
}

.gz-widget-top-item__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.gz-widget-top-item:hover .gz-widget-top-item__cover img {
  transform: scale(1.08);
}

.gz-widget-top-item__cover-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e, #2a2a45);
}

.gz-widget-top-item__info {
  flex: 1;
  min-width: 0;
}

.gz-widget-top-item__title {
  font-size: .82rem;
  font-weight: 700;
  color: #e2e2f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  line-height: 1.3;
}

.gz-widget-top-item__plat {
  font-size: .68rem;
  color: #555;
  font-weight: 600;
}

.gz-widget-top-item__score {
  font-size: .75rem;
  font-weight: 900;
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
}

/* ============================================================
   WIDGET AVIS RÉCENTS
   ============================================================ */
.gz-widget-review-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s;
}

.gz-widget-review-item:hover {
  background: rgba(124,58,237,.06);
}

.gz-widget-review-item__avatar img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: 2px solid #1e1e32 !important;
  flex-shrink: 0;
}

.gz-widget-review-item__body {
  flex: 1;
  min-width: 0;
}

.gz-widget-review-item__author {
  font-size: .8rem;
  font-weight: 700;
  color: #e2e2f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gz-widget-review-item__game {
  font-size: .7rem;
  color: #7c3aed;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gz-widget-review-item__score {
  font-size: .72rem;
  font-weight: 900;
  color: #fff;
  padding: 2px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}

/* ============================================================
   WIDGET GENRES / TAGS
   ============================================================ */
.gz-widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gz-widget-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid #1e1e32;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  color: #7777aa;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}

.gz-widget-tag:hover {
  background: rgba(124,58,237,.12);
  border-color: rgba(124,58,237,.4);
  color: #a78bfa;
  transform: translateY(-1px);
}

.gz-widget-tag span {
  font-size: .65rem;
  background: rgba(255,255,255,.07);
  padding: 0px 5px;
  border-radius: 10px;
  color: #555;
}

/* ============================================================
   WIDGET ACTUS
   ============================================================ */
.gz-widget-news-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s;
}

.gz-widget-news-item:hover { background: rgba(124,58,237,.06); }

.gz-widget-news-item__thumb {
  width: 56px;
  height: 40px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
  background: #1a1a2e;
}

.gz-widget-news-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}

.gz-widget-news-item:hover .gz-widget-news-item__thumb img {
  transform: scale(1.07);
}

.gz-widget-news-item__body { flex: 1; min-width: 0; }

.gz-widget-news-item__title {
  font-size: .8rem;
  font-weight: 700;
  color: #e2e2f0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 3px;
}

.gz-widget-news-item__date {
  font-size: .68rem;
  color: #555;
  font-weight: 600;
}

/* ============================================================
   WIDGET STATS COMMUNAUTÉ
   ============================================================ */
.gz-widget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.gz-widget-stat {
  background: rgba(0,0,0,.25);
  border: 1px solid #1a1a2e;
  border-radius: 9px;
  padding: 10px 6px;
  text-align: center;
}

.gz-widget-stat__num {
  font-size: 1.15rem;
  font-weight: 900;
  color: #a78bfa;
  line-height: 1;
  margin-bottom: 3px;
}

.gz-widget-stat__label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #444;
}

.gz-widget-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px;
  background: rgba(124,58,237,.12);
  border: 1px solid rgba(124,58,237,.25);
  border-radius: 8px;
  color: #a78bfa;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .15s;
}

.gz-widget-cta:hover {
  background: #7c3aed;
  color: #fff;
  border-color: #7c3aed;
  transform: translateY(-1px);
}

/* ============================================================
   AMÉLIORATIONS GLOBALES UI
   ============================================================ */

/* Smooth focus rings */
:focus-visible {
  outline: 2px solid rgba(124,58,237,.6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Sélection de texte */
::selection {
  background: rgba(124,58,237,.3);
  color: #fff;
}

/* Boutons GZ améliorés */
.gz-btn {
  transition: background .15s, transform .15s, box-shadow .15s;
}

.gz-btn:hover { transform: translateY(-1px); }
.gz-btn:active { transform: translateY(0) scale(.98); }

.gz-btn--primary {
  background: #7c3aed;
  color: #fff;
  box-shadow: 0 2px 12px rgba(124,58,237,.25);
}

.gz-btn--primary:hover {
  background: #6d28d9;
  box-shadow: 0 4px 20px rgba(124,58,237,.4);
}

/* Score panels avec glassmorphism subtil */
.gz-score-panel {
  backdrop-filter: blur(4px);
  transition: transform .2s, box-shadow .2s;
}

.gz-score-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* Topic cards hover */
.gz-topic-card {
  transition: border-color .15s, background .15s, transform .15s;
}

.gz-topic-card:hover {
  transform: translateX(3px);
}

/* Review cards */
.gz-review-card {
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.gz-review-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

/* Game tabs améliorés */
.gz-game-tab {
  position: relative;
  overflow: hidden;
}

.gz-game-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(124,58,237,.08);
  opacity: 0;
  transition: opacity .15s;
}

.gz-game-tab:hover::before { opacity: 1; }

/* ============================================================
   MOBILE sidebar
   ============================================================ */
@media (max-width: 1024px) {
  .gz-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .gz-widget {
    flex: 1 1 280px;
  }
}

@media (max-width: 600px) {
  .gz-widget { flex: 1 1 100%; }
}
