
  :root {
    --primary: #006064;
    --primary-light: #4fb3bf;
    --secondary: #b18e3a;
    --secondary-light: #e3c779;
    --bg: linear-gradient(135deg, #e9f2fb, #e8f5e9);
    --glass: rgba(255, 255, 255, 0.85);
    --krem:#f8f4ec;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
    --radius: 16px;
    --text-dark: #333;
    --text-light: #666;
  }

  * {
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
  }

  body {
    background: var(--bg);
    min-height: 100vh;
    padding-bottom: 120px;
    color: var(--text-dark);
  }

  /* GLASS */
  .glass {
    background: var(--glass);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
  }

  .glass:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
  }

  .back-button {
    position: relative;
  
    background: rgba(0, 96, 100, 0.10); /* transparan */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.3);

    padding: 10px 20px;
    border-radius: 50px;
    
    font-weight: 600;
    cursor: pointer;

    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;

    display: flex;
    align-items: center;
    gap: 8px;
  }

  .back-button:hover {
    background: rgba(0, 96, 100, 0.45);
    transform: translateX(-5px);
  }

  .logo {
    width: 140px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 4px solid var(--secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  h1 {
    color: var(--primary);
    font-size: 2.2rem;
    margin: 10px 0;
    letter-spacing: 0.5px;
  }

  .header p {
    color: var(--secondary);
    font-style: italic;
    font-size: 1.1rem;
    margin: 5px 0;
  }

  /* BUBBLE */
  .comic-bubble {
    text-align: center;
    font-weight: bold;
    color: var(--primary);
  }

  .comic-bubble {
    position: fixed;
    top: 0;
    left: 50%; /* Mete bò gòch la nan mitan */
    transform: translateX(-50%); /* Rale eleman an vè goch pa mwatye lajè l */
    width: 100%; /* Asire l pran espas si l bezwen */
    max-width: 700px;
    z-index: 10;
    margin: 0;
    border-radius: 0 0 18px 18px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
  }

  .comic-bubble.scrolled {
    backdrop-filter: blur(30px);
    padding: 8px 12px;
    font-size: 0.5rem;
  }


/* TEXT */
.comic-text {
  transition: all 0.3s ease;
}

/* KACHE TEXT */
.comic-bubble.scrolled .comic-text {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  pointer-events: none;
}

/* SEARCH BAR toujou la */

.search-box {
  margin-top: -35px;
  margin-left: 60px;
  position: relative; /* Garde ceci pour que l'icône se place par rapport à la boîte */
  width: auto;
  height: 40px;
  display: flex; /* Ajoute ceci pour aligner l'input */
  align-items: center;
}

.search-input {
  width: 100%; /* Change auto par 100% pou l pran tout espas la */
  height: 100%;
  /* Padding dwat la dwe gwo ase pou tèks la pa monte sou icone nan (ex: 45px) */
  padding: 10px 45px 10px 20px; 
  border: none;
  border-radius: 50px;
  background-color: rgba(243, 224, 165, 0.3);
  color: var(--light-color);
  transition: all 0.25s ease;
}

.search-icon {
  position: absolute;
  right: 15px; /* Ajuste distans bò dwat la */
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
  color: var(--light-color); /* Pou l ka parèt byen */
  opacity: 0.7;
}

.search-icon:hover {
  opacity: 1;
}

  .bubble-time {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }

  .bubble-time small {
    font-size: 0.9rem;
    color: var(--text-light);
  }

  #text_gazette {
    list-style: none;
    padding: 0;
    margin: 15px 0 0;
    font-weight: normal;
    color: var(--text-light);
    font-size: 0.95rem;
  }

  #text_gazette li {
    padding: 5px 0;
    border-bottom: 1px dashed rgba(0, 96, 100, 0.1);
  }

  #text_gazette li:last-child {
    border-bottom: none;
  }

  /* POSTS */
  .container {
    max-width: 700px;
    margin: auto;
    padding: 100px 10px 10px 10px;
  }

  .posts-feed {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .post-card {
    padding: 25px;
    position: relative;
    overflow: hidden;
  }

  .post-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--post-color, #333);
  }

  .post-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
  }

  .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--avatar-color, #555);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
  }

  .author-info {
    flex: 1;
  }

  .author-name {
    font-weight: bold;
    color: var(--primary);
  }

  .post-time {
    font-size: 0.85rem;
    color: var(--text-light);
  }

  .post-content {
    margin: 15px 0;
    line-height: 1.6;
    font-size: 1.05rem;
  }

  .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
    cursor: pointer;
  }

  .tag {
    background: rgba(0, 96, 100, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
  }

  .post-actions {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 15px;
  }

  .action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    padding: 5px 10px;
    border-radius: 8px;
  }

  .action-btn:hover {
    color: var(--primary);
    background: rgba(0, 96, 100, 0.05);
  }

  .action-btn.active {
    color: var(--primary);
    font-weight: bold;
  }

  .action-btn i {
    font-size: 1.1rem;
  }

  /* LOADING */
  .loading {
    text-align: center;
    padding: 40px;
    color: var(--primary);
  }

  /*status mesaj*/
  .post-status {
    font-size: 0.8rem;
    margin-left: 5px;
    transition: all 0.3s ease;
  }

  .status-syncing { color: #888; } /* Gris pendant l'envoi */
  .status-confirmed { color: #4CAF50; } /* Vert une fois sur Firestore */

  .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: auto;
    margin-bottom: 20px;
  }

  /* Animation de sortie */
  .post-card.removing {
      opacity: 0;
      transform: scale(0.95) translateY(10px);
      transition: all 0.3s ease;
      pointer-events: none; /* Empêche les clics pendant la suppression */
  }

  .delete-post-btn {
    background: transparent;
    border: none;
    color: #ff4444;
    cursor: pointer;
    border-radius: 50%;
    margin-left: auto; /* Pousse le bouton à droite si besoin */
    padding: 5px;
    opacity: 0.6;
    transition: opacity 0.2s;
  }

  .delete-post-btn:hover {
      opacity: 1;
  }

  .author-name {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  /* EMPTY STATE */
  .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
  }

  .empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--secondary-light);
  }

  .hidden {
    display: none;
  }

  /* CHAT INPUT */
  .chat-container {
    position: fixed; 
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
  }

  .chat-box {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
  }

  .chat-input {
    flex: 1;
    padding: 15px 20px;
    resize: none;              /* PA kite itilizatè rale li */
    overflow: hidden;          /* JS ap jere wotè */
    min-height: 44px;
    max-height: 160px;         /* limite wotè */
    padding: 10px 14px;
    border: 2px solid rgba(0, 96, 100, 0.2);
    border-radius: 5px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
  }

  .chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 96, 100, 0.1);
  }

  .chat-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
  }

  .chat-submit:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: scale(1.05);
  }

  .author-tag-btn {
    margin-left: 6px;
    font-size: 0.75rem;
    border: none;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
    padding: 2px 6px;
    cursor: pointer;
    }

    .selected-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
    }

.chat-tag {
  background: #006064;
  color: white;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-tag .remove-tag {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.highlight-post {
  /*outline: 1px solid #006064;*/
  animation: highlight-fade 0.8s ease;
}

/* Button spinner animation */
.fa-spinner {
    animation: spin 0.8s linear infinite;
}

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



.delete-post-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    transform: scale(1.05);
}

.delete-post-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.delete-post-btn i {
    transition: all 0.2s ease;
}

/* Post card relative positioning for overlay */
.post-card {
    position: relative;
    transition: all 0.3s ease;
}

.post-card.removing {
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes highlight-fade {
  0% { background-color: rgba(255, 202, 40, 0.4); }
  100% { background-color: transparent; }
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

  /* RESPONSIVE */
  @media (max-width: 768px) {
    .container {
      padding: 170px 10px 10px 10px;
    }
    .comic-bubble {
      padding: 20px 15px;
    }
    
    .logo {
      width: 110px;
    }
    
    h1 {
      font-size: 1.8rem;
    }
    
    .post-card {
      padding: 20px 15px;
    }
    
    .chat-container {
      padding: 15px 15px 15px 15px;
    }
    
    .chat-submit {
      border-radius: 50px;
      height: 45px;
    }
  }

/* =========================
   SKELETON LOADING STYLES
   ========================= */

.skeleton-posts-feed {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.skeleton-post {
  padding: 25px;
  position: relative;
  overflow: hidden;
  background: var(--glass);
  backdrop-filter: blur(20px);
  margin-bottom: 5px;
}

/* La bande colorée à gauche */
.skeleton-post::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, 
    var(--primary) 0%, 
    var(--primary-light) 50%, 
    var(--primary) 100%);
  opacity: 0.25;
  animation: skeleton-color-pulse 2s ease-in-out infinite;
}

/* Effet de brillance */
.skeleton-post::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transform: translateX(-100%);
  animation: skeleton-shimmer 2.2s infinite;
  pointer-events: none;
}

/* Header */
.skeleton-header {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
}

/* Avatar */
.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    rgba(0, 96, 100, 0.08) 0%,
    rgba(79, 191, 191, 0.15) 50%,
    rgba(0, 96, 100, 0.08) 100%
  );
  background-size: 300% 100%;
  animation: skeleton-wave 2.2s infinite;
}

/* Author info */
.skeleton-author-info {
  flex: 1;
}

.skeleton-author-name {
  width: 150px;
  height: 20px;
  background: linear-gradient(
    90deg,
    rgba(0, 96, 100, 0.08) 0%,
    rgba(79, 191, 191, 0.15) 50%,
    rgba(0, 96, 100, 0.08) 100%
  );
  background-size: 300% 100%;
  animation: skeleton-wave 2.2s infinite;
  border-radius: 20px;
  margin-bottom: 8px;
}

.skeleton-post-time {
  width: 100px;
  height: 14px;
  background: linear-gradient(
    90deg,
    rgba(0, 96, 100, 0.08) 0%,
    rgba(79, 191, 191, 0.15) 50%,
    rgba(0, 96, 100, 0.08) 100%
  );
  background-size: 300% 100%;
  animation: skeleton-wave 2.2s infinite;
  border-radius: 20px;
}

/* Content */
.skeleton-content {
  margin: 15px 0;
}

.skeleton-content-line {
  height: 18px;
  background: linear-gradient(
    90deg,
    rgba(0, 96, 100, 0.08) 0%,
    rgba(79, 191, 191, 0.15) 50%,
    rgba(0, 96, 100, 0.08) 100%
  );
  background-size: 300% 100%;
  animation: skeleton-wave 2.2s infinite;
  border-radius: 20px;
  margin-bottom: 10px;
}

.skeleton-content-line.short {
  width: 60%;
}

.skeleton-content-line.medium {
  width: 80%;
}

.skeleton-content-line.long {
  width: 100%;
}

/* Tags */
.skeleton-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}

.skeleton-tag {
  width: 70px;
  height: 28px;
  background: linear-gradient(
    90deg,
    rgba(0, 96, 100, 0.08) 0%,
    rgba(79, 191, 191, 0.15) 50%,
    rgba(0, 96, 100, 0.08) 100%
  );
  background-size: 300% 100%;
  animation: skeleton-wave 2.2s infinite;
  border-radius: 20px;
}

/* Image */
.skeleton-image {
  width: 100%;
  height: 190px;
  background: linear-gradient(
    90deg,
    rgba(0, 96, 100, 0.05) 0%,
    rgba(79, 191, 191, 0.1) 50%,
    rgba(0, 96, 100, 0.05) 100%
  );
  background-size: 300% 100%;
  animation: skeleton-wave 2.2s infinite;
  border-radius: var(--radius);
  margin: 18px 0 8px;
}

/* Actions */
.skeleton-actions {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(0, 96, 100, 0.08);
  padding-top: 15px;
  margin-top: 15px;
}

.skeleton-action {
  width: 80px;
  height: 32px;
  background: linear-gradient(
    90deg,
    rgba(0, 96, 100, 0.08) 0%,
    rgba(79, 191, 191, 0.15) 50%,
    rgba(0, 96, 100, 0.08) 100%
  );
  background-size: 300% 100%;
  animation: skeleton-wave 2.2s infinite;
  border-radius: 8px;
}

/* Animations */
@keyframes skeleton-wave {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes skeleton-color-pulse {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.4;
  }
}

/* Cache l'ancien loading */
.loading {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .skeleton-post {
    padding: 20px 15px;
  }
  
  .skeleton-avatar {
    width: 40px;
    height: 40px;
  }
  
  .skeleton-author-name {
    width: 120px;
  }
  
  .skeleton-post-time {
    width: 80px;
  }
  
  .skeleton-image {
    height: 150px;
  }
}
.offline-badge-global {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #ff9800;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
}

.offline-badge {
    background: #ff9800;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    margin-left: 5px;
}

.like-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}