/* ==============================
   🌌 FOXSOUNDI GALAXY - LAYOUT FINAL
   ============================== */

/* === GRID PRINCIPALE === */
body {
  display: grid;
  grid-template-columns: 240px 1fr 280px; /* sidebar | contenu | droite */
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "sidebar topbar topbar"
    "sidebar main rightbar";
  height: 100vh;
  background-color: #0a0a1f;
  color: #fff;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Correction responsive : enlever la 3e colonne quand la rightbar est cachée */
@media (max-width: 1280px) {
  body {
    grid-template-columns: 240px 1fr;
    grid-template-areas:
      "sidebar topbar"
      "sidebar main";
  }
  .rightbar {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  .sidebar {
    display: none !important;
  }
}

/* Zones */
.sidebar { grid-area: sidebar; }
.topbar  { grid-area: topbar; }
main     { grid-area: main; min-width: 0; }
.rightbar { grid-area: rightbar; min-width: 280px; }

/* Responsive */
@media (max-width: 1200px) {
  body {
    grid-template-columns: 220px 1fr;
    grid-template-rows: 64px 1fr;
    grid-template-areas:
      "sidebar topbar"
      "sidebar main";
  }
  .rightbar { display: none; }
}

@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: 64px auto;
    grid-template-areas:
      "topbar"
      "main";
  }
  .sidebar, .rightbar { display: none; }
  main { padding: 1.5rem; }
}

/* --- SIDEBARS --- */
.sidebar {
    grid-area: sidebar;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 16px;
    overflow-y: auto;
}

/* --- MAIN AREA --- */
main {
    grid-area: main;
    padding: 2rem 3vw 3rem 3vw;
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Scroll collé */
main::-webkit-scrollbar {
    width: 8px;
}
main::-webkit-scrollbar-thumb {
    background-color: #00ffcc;
    border-radius: 6px;
}
main::-webkit-scrollbar-track {
    background: transparent;
}

/* --- TOPBAR --- */
.topbar {
  grid-column: 2 / 4; /* Étend sur 2 colonnes : contenu + rightbar */
  grid-area: topbar;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
}

.search-box { flex: 1; margin: 0 1rem; }
.search-box input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  outline: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.profile { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.profile img { width: 32px; height: 32px; border-radius: 50%; }

/* ==============================
   💬 FOLLOWED TOPICS
   ============================== */
#followedTopicsBlock { margin-top: 2rem; }
#followedTopicsBlock h3 {
    color: #ff66cc;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
}
#btnAddTopic {
    display: block;
    text-align: center;
    width: 100%;
    background: rgba(0,255,204,0.1);
    border: 1px solid rgba(0,255,204,0.4);
    color: #00ffcc;
    font-size: 0.85rem;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 4px 0 10px 0;
    cursor: pointer;
    transition: 0.3s;
}
#btnAddTopic:hover {
    background: rgba(0,255,204,0.2);
    border-color: #00ffcc;
    box-shadow: 0 0 6px #00ffcc;
}
.topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
}
.topic-link {
    color: #ccc;
    font-size: 0.9rem;
    text-decoration: none;
    transition: 0.2s;
}
.topic-link:hover { color: #00ffcc; }
.topic-item button {
    background: none;
    border: none;
    color: #ff5555;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}
.topic-item button:hover { color: #ff7777; transform: scale(1.1); }

/* ==============================
   📰 NEWS GRID + PAGINATION
   ============================== */
.section-title {
    color: #00ffcc;
    font-size: 1.8rem;
    margin-bottom: 1.4rem;
    text-shadow: 0 0 8px rgba(0,255,204,0.3);
}
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: calc(100% - 1rem);
    box-sizing: border-box;
    overflow: hidden;
}


/* Cards */
.news-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 12px rgba(0,0,0,0.3);
}
.news-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 0 20px rgba(0,255,204,0.2);
    border-color: rgba(0,255,204,0.2);
}
.news-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}
.news-img:hover { transform: scale(1.05); filter: brightness(1.1); }
.news-content { padding: 1rem; }
.news-title a {
    color: #00ffcc;
    font-weight: 600;
    text-decoration: none;
}
.news-summary {
    color: #bbb;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}
.read-more {
    color: #00ffcc;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
}
.read-more:hover { text-decoration: underline; }

/* Pagination centrée */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.4rem;
}
.pagination a,
.pagination span {
    color: #00ffcc;
    border: 1px solid rgba(0,255,204,0.3);
    background: rgba(0,255,204,0.05);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.pagination a:hover {
    background: rgba(0,255,204,0.15);
    border-color: rgba(0,255,204,0.5);
}
.pagination .active span {
    background: #00ffcc;
    color: #000;
    font-weight: 600;
    border-color: #00ffcc;
}

/* Scrollbars collées */
main::-webkit-scrollbar,
.rightbar::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 8px;
}
main::-webkit-scrollbar-thumb,
.rightbar::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background-color: #00ffcc;
    border-radius: 6px;
}
main::-webkit-scrollbar-track,
.rightbar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* Sur écrans plus petits, on cache ou place la sidebar sous le contenu */
@media (max-width: 1199px) {
  .rightbar {
    position: static;
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 2rem;
    height: auto;
  }

  .content-wrapper {
    margin-right: 0;
  }
}

@media (max-width: 1300px) and (min-width: 1201px) {
  body {
    grid-template-columns: 220px minmax(0, 1fr) 260px;
  }
}

main {
  overflow-x: clip; /* au lieu de hidden, clip évite la création de scroll horizontal */
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Sidebar Gauche */
.sidebar {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 16px;
  overflow-y: auto;
}

.sidebar-top h2 {
  color: #00ffcc;
  text-shadow: 0 0 10px #00ffcc;
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
}

.sidebar a {
  display: flex;
  align-items: center;
  color: #bbb;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: 0.3s;
}

.sidebar a:hover {
  background: rgba(0,255,204,0.15);
  color: #00ffcc;
}

/* Right Sidebar */
.rightbar {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(8px);
  border-left: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem 1.8rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  color: #ccc;
}

.rightbar h3 {
  color: #00ffcc;
  font-size: 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.rightbar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rightbar li {
  margin-bottom: 12px;
}

.rightbar li span {
  color: #ff66cc;
  font-weight: 500;
}

.rightbar small {
  color: #aaa;
  display: block;
  margin-top: 2px;
  font-size: 0.85rem;
}

.rightbar hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 1.2rem 0;
}

.rightbar {
  box-shadow: -2px 0 10px rgba(0,0,0,0.3);
}

/* ==============================
   📰 FOXSOUNDI GALAXY - ARTICLE PAGE
   ============================== */

.news-article {
  max-width: 850px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem 1.5rem;
  color: #eee;
}

.article-header {
  text-align: center; /* centrage global */
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  color: #00ffcc;
  text-shadow: 0 0 14px rgba(0,255,204,0.5);
  margin-bottom: 0.8rem;
}

.article-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.topic-tag {
  color: #ff66cc;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.topic-tag:hover {
  color: #ff99dd;
}

.article-info {
  color: #888;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.article-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 2rem auto 1.5rem auto;
}

.article-header::before {
  content: "";
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,255,204,0.15) 0%, rgba(0,0,0,0) 70%);
  filter: blur(60px);
  z-index: 0;
}

.article-footer::before {
  content: "";
  display: block;
  width: 100px;
  height: 3px;
  margin: 2rem auto;
  background: linear-gradient(90deg, transparent, #00ffcc, transparent);
  border-radius: 4px;
}

.article-header {
  position: relative;
  z-index: 1;
}

.article-hero img {
  width: 85%;
  max-width: 680px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(0,255,204,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 0 auto; /* renfort pour garantir le centrage horizontal */
  display: block; /* supprime les décalages inline */
}

.article-hero img:hover {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(0,255,204,0.25);
}

.article-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #ddd;
  text-align: left;
}

.article-body p {
  margin-bottom: 1.2rem;
}

.article-body img {
  display: block;
  max-width: 80%;
  margin: 2rem auto;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

.article-footer {
  margin-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.article-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.article-actions button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s;
}
.article-actions button:hover {
  background: rgba(0,255,204,0.15);
  color: #00ffcc;
  transform: translateY(-2px);
}

.article-source {
  color: #777;
  font-size: 0.85rem;
}
.article-source a {
  color: #00ffcc;
  text-decoration: none;
}
.article-source a:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .article-hero img {
    width: 95%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .article-title {
    font-size: 1.6rem;
  }
  .news-article {
    padding: 1.2rem;
  }
}

.article-comments {
  margin-top: 3rem;
  text-align: center;
}
.comments-title {
  color: #00ffcc;
  text-shadow: 0 0 10px rgba(0,255,204,0.4);
  margin-bottom: 0.8rem;
}
.comments-placeholder {
  color: #888;
  font-size: 0.9rem;
}

/* Embeded */
/* 🎧 Zone du lecteur Foxsoundi */
.embed-wrapper {
    margin: 2rem 0;
    text-align: center;
    min-height: 120px;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.embed-wrapper.fade-in {
    opacity: 1;
}

.loading-embed {
    color: #888;
    font-style: italic;
    text-align: center;
    animation: pulse 1.5s infinite;
}

/* === 🧩 Foxsoundi Compact Embed === */
.foxsoundi-embed-container {
  margin: 1.5rem auto;
  max-width: 720px;
  text-align: center;
  border-radius: 10px;
  background: rgba(20, 20, 35, 0.6);
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.15);
  animation: fadeUp 0.6s ease forwards;
}


/* 🎬 Animation légère d’apparition */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 🪄 Iframe principal */
.foxsoundi-embed-container iframe {
  width: 100%;
  height: 260px;
  border: none;
  border-radius: 10px;
  display: block;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.2);
  position: relative !important;
  z-index: 5;
}

/* 🚫 Masquer les calques de preview (YouTube/Foxsoundi overlay) */
.foxsoundi-embed-container [class*="pointer-events-none"],
.foxsoundi-embed-container [class*="absolute"][class*="opacity-100"],
.foxsoundi-embed-container [style*="opacity: 1"][class*="pointer-events-none"] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  z-index: -1 !important;
}

/* 🎧 Lien "View on Foxsoundi" */
.view-on-foxsoundi {
  margin: 0.6rem 0 1.2rem;
}

.view-on-foxsoundi a {
  color: #00ffc8;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.view-on-foxsoundi a:hover {
  color: #7fffd4;
  text-shadow: 0 0 6px #00ffc8;
}

/* 🎵 Texte fallback */
.no-player {
  color: #888;
  font-size: 0.9rem;
  margin: 1rem 0;
}

/* ==== Foxsoundi Player Section ==== */
.foxsoundi-player-wrapper {
    margin: 25px auto 25px auto;
    max-width: 720px;
    text-align: center;
    background: linear-gradient(180deg, rgba(35,35,60,0.8) 0%, rgba(20,20,40,0.6) 100%);
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(120, 80, 255, 0.15);
    padding: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.foxsoundi-player-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 35px rgba(167,139,250,0.25);
}

.foxsoundi-player-title {
    color: #a78bfa;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(80,60,255,0.5);
}

.foxsoundi-embed-container iframe {
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.no-player {
    color: #999;
    font-style: italic;
    font-size: 0.95rem;
}

/* 🖼️ Image principale harmonisée */
.article-hero {
  display: flex;
  justify-content: center;
  margin: 1.5rem auto;
  max-width: 800px;
}

.article-cover-img {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  cursor: zoom-in;
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-cover-img:hover {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(0, 255, 200, 0.35);
}

/* 🧊 Lightbox (modal image) */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal.visible {
  opacity: 1;
}

.image-modal-content {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.4);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.image-modal-close {
  position: fixed;
  top: 25px;
  right: 40px;
  color: #00ffc8;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.image-modal-close:hover {
  color: #7fffd4;
}
/* 🖼️ Images harmonisées dans le contenu */
.article-body img {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Glow au survol (sécurité visuelle) */
.article-body img:hover {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(0, 255, 200, 0.35);
}

#imageModal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0,255,200,0.4);
  animation: zoomIn 0.25s ease;
  transform: scale(2.5); /* agrandit l’image */
}

/* ==============================
   ✅ FIX FOOTER MOBILE (override global grid)
   ============================== */
@media (max-width: 900px) {

  /* Supprime le grid sur mobile */
  body {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  /* Masque les sidebars */
  .sidebar, .rightbar {
    display: none !important;
  }

  /* Main devient scrollable */
  main#mainContent {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    padding-bottom: 90px !important; /* espace pour le menu */
  }

  /* ✅ Footer mobile toujours visible */
  #mobileNav {
    display: flex !important;
    position: fixed !important;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(15,15,35,0.9);
    backdrop-filter: blur(10px);
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -2px 15px rgba(0,255,204,0.2);
    z-index: 9999;
  }

  /* Style des liens */
  #mobileNav .nav-item {
    color: #aaa;
    text-align: center;
    text-decoration: none;
    font-size: 0.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  #mobileNav .nav-item.active,
  #mobileNav .nav-item:hover {
    color: #00ffcc;
    transform: translateY(-2px);
  }

  #mobileNav .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 3px;
  }
}

.article-tags {
    margin-top: 0.5rem;
}

.topic-link {
    color: #ccc;
    font-weight: 500;
    margin-right: 0.5rem;
    text-decoration: none;
    transition: 0.2s;
}

.topic-link:hover {
    color: #fff;
}

/* Couleurs selon la région */
.topic-link.region-fr {
    color: #007BFF; /* bleu FR */
}

.topic-link.region-us {
    color: #FF4747; /* rouge US */
}

.topic-link.region-pt {
    color: #1ABC9C; /* vert eau PT */
}

.topic-link.region-uk {
    color: #C77DFF; /* violet UK */
}

.topic-link.region-jp {
    color: #E6C300; /* doré JP */
}
