/* Extrait de feed.html (ancien <style>) */
/* --- Feed TikTok/Instagram style --- */
.feed-container {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: 100vh;
  -webkit-overflow-scrolling: touch;
}

/* Dans le mode "feed repliable", éviter qu'il prenne toute la page */
#feedWrap .feed-container {
  height: min(70vh, 720px);
  border-radius: 12px;
  border: 1px solid #333;
}

/* Quand aucun post n'est rendu, ne pas réserver un grand bloc vide */
#feedWrap.is-empty .feed-container {
  height: auto;
  border: none;
}
.slider-item {
  scroll-snap-align: start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #18182a;
}

/* --- Styles pour les boutons de mode --- */
#feed-mode-buttons {
  background: #23233a;
  border-radius: 10px;
  padding: 8px;
  margin: 12px 0;
  border: 1px solid #35355a;
  flex-direction: column;
  gap: 6px;
}

.mode-button:hover {
  background: #5a5a7a !important;
  transform: translateY(-1px);
}

/* --- Styles pour les boutons d'abonnement --- */
.subscription-button {
  transition: all 0.3s ease;
}

.subscription-button:hover {
  transform: scale(1.05);
}

/* --- Amélioration des actions TikTok style --- */
.tiktok-style-actions button {
  transition: all 0.2s ease;
  padding: 4px;
  min-width: auto;
}

.tiktok-style-actions button:hover {
  transform: scale(1.1);
}

.tiktok-style-actions span {
  font-size: 12px !important;
  color: #ccc;
  min-width: auto;
}

/* --- Indicateur de mode actif --- */
.mode-active {
  position: relative;
}

.mode-active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: #4c82ff;
  border-radius: 1px;
}

/* --- Formulaire compact --- */
.modern-post-form {
  background: #23233a;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.13);
  padding: 1.1rem 1rem 0.7rem 1rem;
  margin: 1.2rem auto 1.2rem auto;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border: 1px solid #35355a;
}
.modern-post-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.modern-post-form label {
  font-weight: 500;
  color: #bfcfff;
  margin-bottom: 0.1rem;
  font-size: 0.97rem;
}
.modern-post-form input[type="text"],
.modern-post-form textarea,
.modern-post-form select {
  background: #18182a;
  color: #f3f3fa;
  border: 1px solid #35355a;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-size: 0.97rem;
  transition: border 0.2s;
  outline: none;
  resize: vertical;
}
.modern-post-form input[type="text"]:focus,
.modern-post-form textarea:focus,
.modern-post-form select:focus {
  border-color: #4c82ff;
}
.modern-post-form textarea {
  min-height: 38px;
  max-height: 120px;
}
.modern-post-form input[type="file"] {
  background: none;
  color: #bfcfff;
  border: none;
  padding: 0;
  font-size: 0.97rem;
}
#postImagesPreview img {
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.13);
  max-width: 60px;
  max-height: 60px;
  object-fit: cover;
  border: 1px solid #35355a;
}
.button-modern {
  background: linear-gradient(90deg, #4c82ff 0%, #7f53ff 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.3rem;
  box-shadow: 0 1px 4px rgba(76, 130, 255, 0.06);
  transition: background 0.2s, transform 0.1s;
}
.button-modern:hover {
  background: linear-gradient(90deg, #7f53ff 0%, #4c82ff 100%);
  transform: translateY(-1px) scale(1.01);
}
@media (max-width: 600px) {
  .modern-post-form {
    padding: 0.7rem 0.3rem 0.5rem 0.3rem;
    max-width: 99vw;
  }

  #feed-mode-buttons {
    flex-direction: column;
    gap: 6px;
  }

  .mode-button {
    width: 100%;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
}
/* Halo animé autour de la photo de profil si story active */
.story-halo {
  border: 3px solid #4c82ff;
  box-shadow: 0 0 0 2px #4c82ff80, 0 0 12px 6px #4c82ff55;
  pointer-events: none;
  opacity: 0.95;
}
.story-halo-anim {
  animation: storyPulse 1.2s infinite alternate;
}
@keyframes storyPulse {
  0% {
    box-shadow: 0 0 0 2px #4c82ff80, 0 0 12px 6px #4c82ff55;
    border-color: #4c82ff;
  }
  100% {
    box-shadow: 0 0 0 6px #4c82ff, 0 0 24px 12px #4c82ff80;
    border-color: #7f53ff;
  }
}
.story-halo-live {
  border: 3px solid #ff4757;
  box-shadow: 0 0 0 2px #ff475780, 0 0 12px 6px #ff475755;
  animation: livePulse 1.2s infinite alternate;
}
@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 2px #ff475780, 0 0 12px 6px #ff475755;
    border-color: #ff4757;
  }
  100% {
    box-shadow: 0 0 0 6px #ff4757, 0 0 24px 12px #ff475780;
    border-color: #ff4757;
  }
}
.badge-certif {
  background: rgba(76, 175, 80, 0.15);
  color: #43a047;
  padding: 1px 7px 1px 5px;
  border-radius: 8px;
  font-size: 0.82em;
  margin-left: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  border: 1px solid #43a04722;
  box-shadow: 0 1px 4px rgba(67, 160, 71, 0.07);
  letter-spacing: 0.01em;
}
.badge-certif i {
  width: 15px !important;
  height: 15px !important;
  color: #43a047 !important;
  margin-right: 2px;
  vertical-align: middle;
}

/* --- Styles améliorés pour les images et boutons d'interaction --- */

/* Conteneur d'image standardisé */
.post-image-container {
  position: relative;
  width: 100%;
  height: 400px; /* Hauteur fixe pour toutes les images */
  overflow: visible; /* Permet aux boutons de dépasser */
  border-radius: 12px;
  background: #1a1a2a;
  margin: 12px 0;
}

/* Image standardisée */
.post-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cadrage uniforme */
  object-position: center; /* Centrage par défaut */
  transition: transform 0.3s ease;
  cursor: pointer;
}

.post-image:hover {
  transform: scale(1.02);
}

/* Carrousel d'images amélioré */
.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 400px; /* Hauteur fixe */
  overflow: visible; /* Permet aux boutons de dépasser */
  border-radius: 12px;
  background: #1a1a2a;
  margin: 12px 0;
}

.carousel-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden; /* Cache le débordement vertical mais garde horizontal */
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.carousel-item {
  scroll-snap-align: center;
  flex: 0 0 100%;
  position: relative;
  height: 100%;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.carousel-image:hover {
  transform: scale(1.02);
}

/* Boutons d'interaction améliorés style Instagram */
.instagram-style-actions {
  position: absolute;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px; /* Réduit l'espacement entre les boutons */
  z-index: 9999; /* Z-index très élevé pour être au-dessus de tout */
  pointer-events: none; /* Permet de cliquer à travers le conteneur */
  overflow: visible; /* Permet aux boutons de dépasser */
}

.instagram-style-actions .action-button,
.instagram-style-actions .action-count {
  pointer-events: auto; /* Réactive les clics sur les boutons */
  position: relative;
  z-index: 10000; /* Z-index encore plus élevé pour les boutons */
}

.action-button {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 36px; /* Réduit encore plus */
  height: 36px; /* Réduit encore plus */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 14px; /* Réduit encore plus */
  color: white;
}

.action-button:hover {
  background: rgba(0, 0, 0, 0.6);
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.action-button:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.7);
}

.action-count {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 9px; /* Réduit encore plus */
  font-weight: 600;
  padding: 2px 5px; /* Réduit encore plus */
  border-radius: 8px; /* Réduit encore plus */
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  min-width: 16px; /* Réduit encore plus */
  text-align: center;
}

/* Indicateur audio amélioré */
.audio-indicator {
  position: absolute;
  bottom: 30px;
  left: 30px;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9998; /* Z-index élevé mais inférieur aux boutons */
}

.audio-cover {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* Points de navigation du carrousel */
.carousel-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 9998; /* Z-index élevé mais inférieur aux boutons */
  pointer-events: none;
  align-items: center; /* Centre verticalement */
  justify-content: center; /* Centre horizontalement */
  flex-wrap: nowrap; /* Empêche le retour à la ligne */
  width: auto; /* Largeur automatique */
  height: auto; /* Hauteur automatique */
}

.carousel-dot {
  width: 4px !important;
  height: 4px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.5) !important;
  border: none !important;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  min-width: 4px !important;
  min-height: 4px !important;
  max-width: 4px !important;
  max-height: 4px !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  font-size: 0 !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
}

.carousel-dot.active {
  background: white !important;
  transform: scale(1.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8) !important;
  transform: scale(1.3);
}

/* Force la forme circulaire pour tous les points */
.carousel-dot,
.carousel-dot.active,
.carousel-dot:hover {
  aspect-ratio: 1 / 1 !important;
  border-radius: 50% !important;
  display: inline-block !important;
  box-sizing: border-box !important;
  position: relative !important;
}

/* Reset complet pour les points de navigation */
.carousel-dot * {
  display: none !important;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
  .post-image-container,
  .carousel-wrapper {
    height: 300px; /* Hauteur réduite sur mobile */
  }

  .instagram-style-actions {
    bottom: 20px;
    right: 20px;
    gap: 6px; /* Réduit encore plus sur mobile */
  }

  .action-button {
    width: 32px; /* Réduit encore plus sur mobile */
    height: 32px; /* Réduit encore plus sur mobile */
    font-size: 12px; /* Réduit encore plus sur mobile */
  }

  .action-count {
    font-size: 8px; /* Réduit encore plus sur mobile */
    padding: 1px 4px; /* Réduit encore plus sur mobile */
  }

  .audio-indicator {
    bottom: 20px;
    left: 20px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .carousel-dots {
    bottom: 20px;
    gap: 5px;
  }

  .carousel-dot {
    width: 3px;
    height: 3px;
    min-width: 3px;
    min-height: 3px;
    max-width: 3px;
    max-height: 3px;
  }
}

/* Animation pour les boutons actifs */
.action-button.active {
  background: rgba(76, 130, 255, 0.8);
  border-color: rgba(76, 130, 255, 0.5);
}

.action-button.liked {
  background: rgba(255, 71, 87, 0.8);
  border-color: rgba(255, 71, 87, 0.5);
  animation: likePulse 0.6s ease;
}

@keyframes likePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Styles pour les commentaires IA */
.ai-comment {
  border-left: 3px solid #10b981 !important;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(16, 185, 129, 0.05) 100%
  ) !important;
}

.ai-comment .username {
  color: #10b981 !important;
  font-weight: bold !important;
}

.ai-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7em;
  margin-left: 6px;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Animation pour les nouveaux commentaires IA */
.ai-comment.new {
  animation: aiCommentSlideIn 0.5s ease-out;
}

@keyframes aiCommentSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Styles pour les contrôles IA */
.ai-controls {
  background: linear-gradient(135deg, #23233a 0%, #1a1a2a 100%);
  border: 1px solid #35355a;
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-controls h4 {
  color: #4c82ff;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.ai-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bfcfff;
  font-size: 0.9rem;
  cursor: pointer;
}

.ai-controls input[type="checkbox"] {
  accent-color: #4c82ff;
  transform: scale(1.1);
}

.ai-mode-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.ai-mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.ai-mode-btn.advanced {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.ai-mode-btn.advanced:hover {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.ai-status {
  font-size: 0.8rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-status.active {
  color: #10b981;
}

.ai-status.advanced {
  color: #f59e0b;
}

.ai-status.disabled {
  color: #ef4444;
}

/* Styles pour la recherche de profils dans le feed */
#feedProfileSearchInput:focus {
  border-color: #5c6bc0;
  box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1);
}

.feed-search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #2a2a3c;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 1px solid #444;
  transition: all 0.3s ease;
  cursor: pointer;
  animation: fadeInUp 0.3s ease-out;
}

.feed-search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: #5c6bc0;
}

.feed-search-result-item:active {
  transform: translateY(0);
}

.feed-search-result-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #5c6bc0;
}

.feed-search-result-item .user-info {
  flex: 1;
  min-width: 0;
}

.feed-search-result-item .user-info h3 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
}

.feed-search-result-item .user-info p {
  margin: 2px 0 0 0;
  color: #aaa;
  font-size: 0.8rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-search-result-item .user-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.feed-search-result-item .badge {
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.feed-search-result-item .badge.certified {
  color: #43a047;
  background: rgba(67, 160, 71, 0.1);
}

.feed-search-result-item .badge.pro {
  color: #e91e63;
  background: rgba(233, 30, 99, 0.1);
}

/* Responsive pour la recherche dans le feed */
@media (max-width: 600px) {
  .feed-search-result-item {
    padding: 8px;
    gap: 10px;
  }

  .feed-search-result-item img {
    width: 35px;
    height: 35px;
  }

  .feed-search-result-item .user-info h3 {
    font-size: 0.9rem;
  }

  .feed-search-result-item .user-info p {
    font-size: 0.75rem;
  }
}

/* Styles pour le formulaire discret */
#toggleFormBtn:hover {
  background: #333 !important;
  border-color: #555 !important;
}

#toggleFormBtn:active {
  transform: scale(0.98);
}

.modern-post-form input,
.modern-post-form textarea,
.modern-post-form select {
  background: #2a2a3c !important;
  border: 1px solid #444 !important;
  color: #fff !important;
  border-radius: 6px !important;
}

.modern-post-form input:focus,
.modern-post-form textarea:focus,
.modern-post-form select:focus {
  border-color: #5c6bc0 !important;
  box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.1) !important;
  outline: none !important;
}

.modern-post-form input::placeholder,
.modern-post-form textarea::placeholder {
  color: #888 !important;
}

.button-modern {
  background: linear-gradient(135deg, #5c6bc0, #7986cb) !important;
  border: none !important;
  color: white !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.button-modern:hover {
  background: linear-gradient(135deg, #4c5cb0, #6a7bcb) !important;
  transform: translateY(-1px) !important;
}

.button-modern:active {
  transform: translateY(0) !important;
}

/* Styles pour les Stories */
.stories-container {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.stories-container::-webkit-scrollbar {
  display: none;
}

/* Styles pour les sections de catégories */
.category-stories-section {
  transition: all 0.3s ease;
}

.category-stories-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: #4c82ff !important;
}

.category-stories-section h4 {
  transition: color 0.3s ease;
}

.category-stories-section:hover h4 {
  color: #4c82ff !important;
}

/* Bouton d'actualisation des stories */
#refreshStoriesBtn:hover {
  background: #333 !important;
  border-color: #555 !important;
  transform: translateY(-1px);
}

/* Style pour les hashtags dans les descriptions */
.hashtag {
  color: #4c82ff;
  font-weight: 600;
  text-decoration: none;
}

.hashtag:hover {
  color: #7f53ff;
  text-decoration: underline;
}

#refreshStoriesBtn:active {
  transform: translateY(0);
}

#refreshStoriesBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bouton de test des stories */
#createTestStoryBtn:hover {
  background: #3b6bc0 !important;
  border-color: #3b6bc0 !important;
  transform: translateY(-1px);
}

#createTestStoryBtn:active {
  transform: translateY(0);
}

.story-item {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.story-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(76, 130, 255, 0.4);
  transition: all 0.2s ease;
  opacity: 0.8;
}

.story-avatar:hover {
  transform: scale(1.05);
  opacity: 1;
  border-color: rgba(76, 130, 255, 0.8);
}

.story-avatar.has-story {
  border: 2px solid rgba(76, 130, 255, 0.6);
  box-shadow: 0 0 8px rgba(76, 130, 255, 0.3);
}

.story-avatar.viewed {
  border: 2px solid rgba(102, 102, 102, 0.3);
  opacity: 0.5;
}

.story-username {
  text-align: center;
  color: #999;
  font-size: 9px;
  margin-top: 2px;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Styles pour le Story Viewer */
.story-viewer {
  background: #000;
  -webkit-user-select: none; /* Safari */
  user-select: none;
}

.story-progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  flex: 1;
  position: relative;
}

.story-progress-fill {
  height: 100%;
  background: white;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.story-progress-fill.active {
  animation: storyProgress 10s linear forwards;
}

.story-progress-fill.paused {
  animation-play-state: paused;
}

@keyframes storyProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.story-nav-left:hover,
.story-nav-right:hover {
  background: rgba(255, 255, 255, 0.1);
}

.story-controls button:hover {
  background: rgba(0, 0, 0, 0.7) !important;
  transform: scale(1.1);
}

.story-controls button:active {
  transform: scale(0.95);
}

/* Animation d'entrée pour le story viewer */
.story-viewer.show {
  animation: storyViewerFadeIn 0.3s ease-out;
}

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

/* Responsive pour les stories */
@media (max-width: 768px) {
  .story-avatar {
    width: 50px;
    height: 50px;
  }

  .story-username {
    font-size: 11px;
    max-width: 50px;
  }

  .story-header {
    padding: 15px !important;
  }

  .story-controls {
    bottom: 20px !important;
  }

  .story-controls button {
    width: 45px !important;
    height: 45px !important;
  }

  .story-controls i {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Améliorations pour desktop */
@media (min-width: 768px) {
  .module-controls {
    max-width: 800px !important;
    margin: 20px auto !important;
  }

  .profile-search-section {
    max-width: 800px !important;
    margin: 20px auto !important;
  }

  .feed-container {
    max-width: 800px !important;
    margin: 0 auto !important;
  }

  .stories-section {
    max-width: 800px !important;
    margin: 20px auto !important;
  }

  /* Amélioration des champs de formulaire sur desktop */
  .modern-post-form input,
  .modern-post-form textarea,
  .modern-post-form select {
    font-size: 1rem !important;
    padding: 12px 16px !important;
  }

  .modern-post-form textarea {
    min-height: 100px !important;
  }

  /* Bouton toggle plus grand sur desktop */
  #toggleFormBtn {
    font-size: 1.1rem !important;
    padding: 12px 20px !important;
  }

  /* Résultats de recherche plus grands sur desktop */
  .feed-search-result-item {
    padding: 15px !important;
    gap: 15px !important;
  }

  .feed-search-result-item img {
    width: 50px !important;
    height: 50px !important;
  }

  .feed-search-result-item .user-info h3 {
    font-size: 1.1rem !important;
  }

  .feed-search-result-item .user-info p {
    font-size: 0.9rem !important;
  }
}
/* Styles extraits de feed.html (ancien bloc <style>) */

/* --- Feed TikTok/Instagram style --- */
.feed-container {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  height: 100vh;
  -webkit-overflow-scrolling: touch;
}
.slider-item {
  scroll-snap-align: start;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #18182a;
}

/* --- Styles pour les boutons de mode --- */
#feed-mode-buttons {
  background: #23233a;
  border-radius: 10px;
  padding: 8px;
  margin: 12px 0;
  border: 1px solid #35355a;
  flex-direction: column;
  gap: 6px;
}

.mode-button:hover {
  background: #5a5a7a !important;
  transform: translateY(-1px);
}

/* --- Styles pour les boutons d'abonnement --- */
.subscription-button {
  transition: all 0.3s ease;
}

.subscription-button:hover {
  transform: scale(1.05);
}

/* --- Amélioration des actions TikTok style --- */
.tiktok-style-actions button {
  transition: all 0.2s ease;
  padding: 4px;
  min-width: auto;
}

.tiktok-style-actions button:hover {
  transform: scale(1.1);
}

.tiktok-style-actions span {
  font-size: 12px !important;
  color: #ccc;
  min-width: auto;
}

/* --- Indicateur de mode actif --- */
.mode-active {
  position: relative;
}

.mode-active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: #4c82ff;
  border-radius: 1px;
}

/* --- Formulaire compact --- */
.modern-post-form {
  background: #23233a;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.13);
  padding: 1.1rem 1rem 0.7rem 1rem;
  margin: 1.2rem auto 1.2rem auto;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  border: 1px solid #35355a;
}
.modern-post-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.modern-post-form label {
  font-weight: 500;
  color: #bfcfff;
  margin-bottom: 0.1rem;
  font-size: 0.97rem;
}
.modern-post-form input[type="text"],
.modern-post-form textarea,
.modern-post-form select {
  background: #18182a;
  color: #f3f3fa;
  border: 1px solid #35355a;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-size: 0.97rem;
  transition: border 0.2s;
  outline: none;
  resize: vertical;
}
.modern-post-form input[type="text"]:focus,
.modern-post-form textarea:focus,
.modern-post-form select:focus {
  border-color: #4c82ff;
}
.modern-post-form textarea {
  min-height: 38px;
  max-height: 120px;
}
.modern-post-form input[type="file"] {
  background: none;
  color: #bfcfff;
  border: none;
  padding: 0;
  font-size: 0.97rem;
}
#postImagesPreview img {
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.13);
  max-width: 60px;
  max-height: 60px;
  object-fit: cover;
  border: 1px solid #35355a;
}
.button-modern {
  background: linear-gradient(90deg, #4c82ff 0%, #7f53ff 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 0;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.3rem;
  box-shadow: 0 1px 4px rgba(76, 130, 255, 0.06);
  transition: background 0.2s, transform 0.1s;
}
.button-modern:hover {
  background: linear-gradient(90deg, #7f53ff 0%, #4c82ff 100%);
  transform: translateY(-1px) scale(1.01);
}
@media (max-width: 600px) {
  .modern-post-form {
    padding: 0.7rem 0.3rem 0.5rem 0.3rem;
    max-width: 99vw;
  }

  #feed-mode-buttons {
    flex-direction: column;
    gap: 6px;
  }

  .mode-button {
    width: 100%;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
}
/* Halo animé autour de la photo de profil si story active */
.story-halo {
  border: 3px solid #4c82ff;
  box-shadow: 0 0 0 2px #4c82ff80, 0 0 12px 6px #4c82ff55;
  pointer-events: none;
  opacity: 0.95;
}
.story-halo-anim {
  animation: storyPulse 1.2s infinite alternate;
}
@keyframes storyPulse {
  0% {
    box-shadow: 0 0 0 2px #4c82ff80, 0 0 12px 6px #4c82ff55;
    border-color: #4c82ff;
  }
  100% {
    box-shadow: 0 0 0 6px #4c82ff, 0 0 24px 12px #4c82ff80;
    border-color: #7f53ff;
  }
}
.story-halo-live {
  border: 3px solid #ff4757;
  box-shadow: 0 0 0 2px #ff475780, 0 0 12px 6px #ff475755;
  animation: livePulse 1.2s infinite alternate;
}
@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 2px #ff475780, 0 0 12px 6px #ff475755;
    border-color: #ff4757;
  }
  100% {
    box-shadow: 0 0 0 6px #ff4757, 0 0 24px 12px #ff475780;
    border-color: #ff4757;
  }
}
.badge-certif {
  background: rgba(76, 175, 80, 0.15);
  color: #43a047;
  padding: 1px 7px 1px 5px;
  border-radius: 8px;
  font-size: 0.82em;
  margin-left: 5px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  border: 1px solid #43a04722;
  box-shadow: 0 1px 4px rgba(67, 160, 71, 0.07);
  letter-spacing: 0.01em;
}
.badge-certif i {
  width: 15px !important;
  height: 15px !important;
  color: #43a047 !important;
  margin-right: 2px;
  vertical-align: middle;
}

/* NOTE: Le reste du bloc <style> original de feed.html était très volumineux et doit être migré ici si tu veux un retrait strict à 100% des styles inline. */
