/* ============================================================ */
/* =================== RESET, VARIABLES ====================== */
/* ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --apt-bg: #0f0f12;
  --apt-text: #f5f5f5;

  --apt-green: #2ecc71;
  --apt-amber: #f39c12;
  --apt-red: #e74c3c;

  --apt-card: #18181d;
  --nav-h: 56px;
}

html, body {
  height: 100%;
  background: var(--apt-bg);
  color: var(--apt-text);
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* ============================================================ */
/* ======================= NAV GLOBALE ======================= */
/* ============================================================ */

#feed {
  padding-top: var(--nav-h);
}

.snap-buffer {
  height: 1px;
  scroll-snap-align: start;
}

.apt-nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-h);
  padding: 0 16px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  background: rgba(15,15,18,0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(14px);
  z-index: 1000;
}

.nav-logo {
  font-weight: 800;
  letter-spacing: 1px;
}

.nav-actions {
  display: flex;
  gap: 12px;
}

.nav-btn {
  font-size: 0.85rem;
  opacity: 0.8;
  cursor: pointer;
}

.nav-btn:hover {
  opacity: 1;
}

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* =======  BULLE AI CORE =======*/
.ai-core {
  width: 30px;
  height: 30px;
  border-radius: 50%;

  background: radial-gradient(circle at 30% 30%, #ffffff, #6cf2c2, #2ecc71);

  box-shadow:
    0 0 12px rgba(46,204,113,0.8),
    0 0 24px rgba(46,204,113,0.4);

  animation:
    corePulse 4s infinite ease-in-out,
    coreRainbow 8s infinite linear;
}

@keyframes corePulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes coreRainbow {
  0% {
    filter: hue-rotate(0deg);
  }

  100% {
    filter: hue-rotate(360deg);
  }
}


.ai-core {
  animation:
    corePulse 4s infinite ease-in-out,
    coreRainbow 8s infinite linear,
    coreGlow 3s infinite ease-in-out;
}

@keyframes coreGlow {
  0% { box-shadow: 0 0 10px #2ecc71, 0 0 20px #2ecc71; }
  50% { box-shadow: 0 0 25px #2ecc71, 0 0 50px #2ecc71; }
  100% { box-shadow: 0 0 10px #2ecc71, 0 0 20px #2ecc71; }
}


/* ===================== ICONES & COMPTE ===================== */


/* Icone Globe */
.icon-globe {
  display: inline-block;
  font-size: 20px; 
  animation: rotateEarth 2s linear infinite;
  transform-origin: 50% 50%; 
}

@keyframes rotateEarth {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Titre nav */
.ai-label {
  font-weight: 600;
  font-size: 1.2rem;
  background: linear-gradient(90deg, #6cf2c2, #4cc9f0, #9b5de5, #f15bb5);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Texte après le titre nav ===== */
.ai-after-title {
  font-weight: 600;
  font-size: 1rem;
  margin-left: 2px;
  color: #6cf2c2;
  background: linear-gradient(90deg, #6cf2c2, #4cc9f0, #9b5de5, #f15bb5);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: color 0.25s ease, transform 0.25s ease;
  display: inline-block;
  vertical-align: middle;
}

/* Ajouter le tiret automatiquement avant le texte */
.ai-after-title::before {
  content: " - ";
  color: #6cf2c2; /* couleur du séparateur */
}

.ai-after-title:hover {
  transform: scale(1.05);
}

@media (max-width: 640px) {
  .ai-after-title{
    display: none;
  }
}
/* ======================= BOUTONS NAV ======================== */


/* Desktop (horizontal) */
#nav-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

#nav-right .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6cf2c2, #4cc9f0);
  color: #0f0f12;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#nav-right .nav-btn:hover {
  background: linear-gradient(135deg, #4cc9f0, #6cf2c2);
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

#nav-right .nav-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Mobile (burger vertical) */
@media (max-width: 768px) {
  #nav-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  #nav-right .nav-btn {
    width: 100%;
    margin-left: 0;
    text-align: center;
  }
}

/* ======================= BURGER ============================ */

.nav-burger {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  cursor: pointer;
  
}

/* ===================== BOUTON PROFIL ======================== */

/* Bouton global (like nav-btn) */
.nav-profile {
  display: inline-flex;                /* comme nav-btn desktop */
  align-items: center;
  gap: 8px;                            /* espace entre avatar et texte si nécessaire */
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(135deg, #6cf2c2, #4cc9f0);
  color: #0f0f12;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.nav-profile:hover {
 
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.nav-profile:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Avatar dans le bouton */
.nav-profile img.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #6cf2c2; /* couleur initiale */
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.5s ease;
  
  /* Animation contour façon AI core */
  animation: avatarCorePulse 2.8s infinite ease-in-out, avatarCoreMagic 2s infinite linear;
}

/* Hover sur avatar */
.nav-profile:hover img.nav-avatar {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

/* Active sur avatar */
.nav-profile:active img.nav-avatar {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

/* ================= ANIMATION CONTOR AVATAR ================= */
@keyframes avatarCorePulse {
  0% { transform: scale(1); box-shadow: 0 0 12px rgba(46,204,113,0.6); }
  50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(46,204,113,1); }
  100% { transform: scale(1); box-shadow: 0 0 12px rgba(46,204,113,0.6); }
}

@keyframes avatarCoreMagic {
  0% { border-color: #ffffff; }
  25% { border-color: #6cf2c2; }
  50% { border-color: #9b5de5; }
  75% { border-color: #f15bb5; }
  100% { border-color: #ffffff; }
}



/* Bouton profil minimaliste */
#profile-btn.nav-profile {
  background: none;        /* pas de couleur de fond */
  box-shadow: none;        /* pas d’ombre */
  border: none;            /* pas de bordure */
  padding: 0;              /* pas de padding */
  display: inline-flex;    
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#profile-btn.nav-profile span {
  display: none;           /* on cache le texte pour garder juste l'avatar */
}

#profile-btn.nav-profile img.nav-avatar {
  width: 36px;             /* taille de l'avatar */
  height: 36px;
  border-radius: 50%;      /* rond parfait */
  object-fit: cover;
  border: 2px solid #6cf2c2; /* optionnel : un contour fin */
  box-shadow: none;        /* supprime toutes ombres */
  animation: none;         /* supprime animation si tu avais avatarCorePulse ou Magic */
}

/* ===================== RESPONSIVE NAV ======================= */
@media (max-width: 768px) {

  .nav-left {
    font-size: 0.75rem;
  }

  .nav-center {
    pointer-events: none;
  }

  .nav-burger {
    display: block;
  }

  #nav-right {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    width: 220px;
    height: calc(100vh - var(--nav-h));
    background: rgba(15,15,18,0.95);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }

  #nav-right.open {
    transform: translateX(0);
  }
}

/* ======================= ICONES NAV ======================== */

/* Base commune */
.nav-btn {
  gap: 8px;
}

.nav-btn i {
  font-size: 20px;
  display: inline-block;
  transition: transform 0.25s ease, color 0.25s ease, text-shadow 0.25s ease;
}

/* ===================== ICONE RECHERCHE ===================== */
/*.search-btn i {
  animation: searchBounce 2s infinite;
}*/

.search-btn:hover i {
  transform: translateY(-3px) scale(1.1);
  text-shadow: 0 0 6px #4cc9f0, 0 0 12px #6cf2c2;
}

@keyframes searchBounce {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

/* ===================== ICONE CHAT ===================== */
.notif-btn i {
  font-size: 22px;
  /*animation: chatPulse 1.8s infinite ease-in-out;*/
}

.notif-btn:hover i {
  transform: translateY(-2px) scale(1.1);
  color: #6cf2c2;
  text-shadow: 0 0 8px #6cf2c2, 0 0 16px #4cc9f0;
}

@keyframes chatPulse {
  0%   { transform: rotate(0deg) scale(1); }
  25%  { transform: rotate(-5deg) scale(1.05); }
  50%  { transform: rotate(5deg) scale(1.1); }
  75%  { transform: rotate(-3deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}


/*RESPONSIVE AI CORE ET LABEL */
@media (max-width: 768px) {
  /* Décale AI core vers le burger sur mobile */
  .ai-core {
    position: relative;       /* le sort du flux normal */
    left: 9px;               /* +px vers burger  // -px vers compte */
    top: 50%;                 /* centre verticalement dans la nav */
    transform: translateY(-50%); /* ajuste le centrage vertical */
    margin: 0;                /* supprime tout margin */
  }
}



/* ===================== BOUTON A PROPOS ===================== */

.about-btn {
  background: linear-gradient(135deg, #9b5de5, #f15bb5);
  color: white;
}

.about-btn:hover {
  background: linear-gradient(135deg, #f15bb5, #9b5de5);
}

/*.about-btn i {
  animation: infoFloat 2.5s infinite ease-in-out;
}*/

@keyframes infoFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}



/* Cacher Chat et About sur desktop uniquement 
@media (min-width: 769px) {
  .notif-btn,
  .about-btn {
    display: none !important;
  }
}*/


/* --- Bouton chat --- */
.notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(145deg, #1f1f1f, #181818);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notif-btn:hover {
  background: #25d366;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px #25d36655;
}

/* --- Badge notification --- */
#notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 2px 5px;
  background: linear-gradient(135deg, #ff3b3b, #ff0000);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: none; /* affiché via JS */
  align-items: center;
  justify-content: center;
  border-radius: 50px;
  box-shadow: 0 0 0 2px #0b0b0b;
}

/* --- Badge animé --- */
#notif-badge.pulse {
  display: flex;
  animation: notifPulse 2s infinite;
}

/* --- Animation pulse --- */
@keyframes notifPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}

.notif-btn {
  position: relative; /* ajoute ça */
}