:root {
    --bg: #f3f4f6;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --darky: rgba(255,255,255,0.7);
    --primary: #0080ff;
    --comment: #F5F7FA;
}

body.dark {
    --bg: #0f172a;
    --card: #020617;
    --border: #1e293b;
    --text: #f8fafc;
    --darky: rgba(0, 0, 0, 0.7);
    --primary: #0080ff;
    --comment: #151821;
}

*{
    padding: 0;
    margin: 0;
    text-decoration: none;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg);
    margin: 0;
    color: var(--text);
    transition: 0.3s;
}

header {
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
}

#toggleTheme {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
}

.layout {
  display: block;
  width: 100%;
}

/* COLONNES FIXES */
.side-menu,
.profile-panel {
  width: 280px;
  flex-shrink: 0;
  height: calc(100vh - 56px);
  position: fixed;
  top: 56px;
  background: var(--card);
  border-left: 1px solid #ddd;
  transition: 0.3s;
  z-index: 998;
  
}

.side-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s;
}

.side-menu a i, .profile-panel a i {
  font-size: 20px;
  min-width: 24px;
}

.side-menu a:hover {
  background: rgba(255,255,255,0.08);
}

.menu-separator {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 10px 0;
}

.menu-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #aaa;
  font-size: 14px;
  padding: 6px 10px;
}

.profile-panel a {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
}

.profile-panel a:hover {
  background: #f5f5f5;
}

.profile-user {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.divider {
  height: 1px;
  background: #eee;
  margin: 8px 0;
}

.theme-toggle {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.danger {
  color: #c0392b;
}

/* Mobile */
@media (max-width: 991px) {


  .side-menu,
  .profile-panel {
    position: fixed;
    top: 56px;
    height: calc(100vh - 56px);
    z-index: 999;
    /*display: none;*/
  }

  .side-menu {
    left: -280px;
  }

  .profile-panel {
    right: -280px;
  }

  #burgerBtn,
  #profileBtn {
    display: block;
  }
  
  .title {
        font-size: 15px;
    }
    
  .side-menu {
    left: -280px;
  }

  .side-menu.open {
    left: 0;
  }

  .profile-panel {
    right: -280px;
  }

  .profile-panel.open {
    right: 0;
  }
}

@media (min-width: 992px) {

  /* LAYOUT 3 COLONNES */
  .layout {
    display: flex;
  }

  /* MENUS EN STICKY (PAS FIXED) */
  .side-menu,
  .profile-panel {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    left: auto;
    right: auto;
    z-index: 1;
  }

  .side-menu {
    border-right: 1px solid var(--border);
  }

  .profile-panel {
    border-left: 1px solid var(--border);
  }

  /* FEED CENTRÉ */
  .feed {
    margin: 0 0 1rem;
    max-width: 680px;
    padding: 15px;
  }

  /* ICÔNES MOBILE CACHÉES */
  #burgerBtn,
  #profileBtn {
    display: none !important;
  }
}

/* FEED CENTRAL */
.feed {
  width: 100%;
  max-width: 680px;
  margin: 0 0 1rem;
  padding: 15px;
}

/* Post */
.post {
    background: var(--card);
    border-radius: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    transition: 0.2s;
    margin-bottom: 1rem;
}

.post:hover {
    transform: translateY(-2px);
}

/* Header */
.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info{
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.username {
    font-weight: 700;
    color: --text;
}

.timePlus{
    display: flex;
    align-items: center;
    gap: 10px;
}

.plus{
    cursor: pointer;
}

.time {
    font-size: 12px;
    opacity: 0.7;
    color: #6b7280;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
}

/* Title */
.title, a {
    margin-top: 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}


.read-more {
    /*color: #9ca3af;*/     /* gris clair */
    color: #4ea1ff;
    text-decoration: none;
    font-size: 14px;
    margin-left: 4px;
}

.read-more:hover {
    text-decoration: underline;
}

/* Image */
.image-box {
    width: 100%;
    /*max-height: 500px;*/
    margin-top: 12px;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid var(--border);
}

.image-box img, video {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;   /* recadre sans déformer */
    display: block;
}

/* Views */
.views {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: var(--darky);
    backdrop-filter: blur(4px);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--border);
}

/* Actions */
.actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.action {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
}

.action:hover {
    background: rgba(0,0,0,0.05);
}

/* Controls */
.controls {
    display: flex;
    gap: 8px;
}

select {
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Skeleton */
.skeleton {
    height: 320px;
    border-radius: 18px;
    background: linear-gradient(90deg,#e5e7eb 25%,#f3f4f6 37%,#e5e7eb 63%);
    animation: loading 1.2s infinite;
}

@keyframes loading {
    to { background-position: 200% 0; }
}

/* Like active */
.liked {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

.lik.loading {
    pointer-events: none;
    opacity: 0.6;
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
    opacity: 0.6;
  pointer-events: none;
}

.like.liked i {
  color: #0080ff;
}

/* Lazy image */
img.lazy {
    filter: blur(6px);
    transition: 0.4s;
}

img.loaded {
    filter: blur(0);
}

/*Post view */
.post-content {
    line-height: 1.3;
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 0.2rem;
    word-wrap: break-word;
    font-family: 
       Inter, system-ui,
       -apple-system, 
       BlinkMacSystemFont,
       sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--text);
}

/* Paragraphes */
.post-content p {
  margin-bottom: 1rem;
}

/* Citations */
.post-content blockquote {
  border-left: 4px solid #2a7cff;
  padding: .8rem 1rem;
  margin: 1.2rem 0;
  background: #f1f5ff;
  border-radius: 6px;
  position: relative;
}

.post-content blockquote::before {
  content: "\eb9c";
  font-family: boxicons;
  position: absolute;
  left: 10px;
  top: 8px;
  color: #2a7cff;
}

/* Code */
.post-content pre {
  /*background: #1e1e1e;*/
  background: var(--bg);
  color: #eaeaea;
  padding: 1rem;
  border-radius: 10px;
  overflow-x: auto;
  position: relative;
}

.post-content pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

/* Bouton copier */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  /*background: #3b82f6;*/
  background: var(--darky);
  color: var(--text);
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.post-content ul,
.post-content ol {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
  position: relative;
}

/* Ligne verticale fine */
.post-content ul::before,
.post-content ol::before {
  content: "";
  position: absolute;
  top: 1.2rem;
  left: 1.1rem;
  width: 1px; /* ligne plus fine */
  height: calc(100% - 2.4rem); /* évite toucher les cercles */
  background: #3b82f6;
  opacity: 0.35;
}

/* Élément */
.post-content li {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

/* Cercle */
.post-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1.5px solid #3b82f6;
  background: var(--card);
  z-index: 2;
}

/* Numérotation */
.post-content ol {
  counter-reset: step;
}

.post-content ol li::after {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #3b82f6;
  z-index: 3;
}

/* Puce pour ul */
.post-content ul li::after {
  content: "•";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #3b82f6;
  z-index: 3;
}

/* Dernier élément */
.post-content li:last-child {
  margin-bottom: 0;
}

/* Liens */
.post-content a {
  color: #2a7cff;
  text-decoration: underline;
}

.hashtag {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 7px 16px;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 600;

  text-decoration: none;

  border: 1px solid var(--border);
  /*background: #;*/
  color: #1e293b;

  transition: all .25s ease;
  flex-shrink: 0;
  text-decoration: none;
}

.hashtag:hover {
  background: none;
  /*color: #fff;*/
  border-color: #4da3ff;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(77,163,255,0.25);
}

.hashtag.active {
  background: #4da3ff;
  color: #fff;
  border-color: #4da3ff;
}

.hashtag.hot {
  background: #fff7ed;
  border-color: #fb923c;
  color: #c2410c;
}

.hashtag.inline {
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
  font-weight: 500;
  color: #4da3ff;
}

.hashtag.inline:hover {
  background: none;
  color: #1d4ed8;
  box-shadow: none;
  transform: none;
}

.hashtag.premium {
  background: linear-gradient(135deg,#facc15,#f97316);
  border: none;
  color: #000;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.md-table th,
.md-table td {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
}

.md-table th {
    background: #f6f7f8;
    font-weight: 600;
    text-align: left;
}

.md-table tr:nth-child(even) {
    background: #fafafa;
}


.video-box{
    position:relative;
    border-radius:16px;
    overflow:hidden;
    cursor:pointer;
    background:#000;
}

/* preview vidéo (sans controls) */
.video-preview{
    width:100%;
    display:block;
    object-fit:cover;
    filter:brightness(0.9);
}

/* overlay sombre */
.video-overlay{
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    transition:0.3s;
}

/* bouton play */
.video-overlay i{
    font-size:60px;
    color:white;
    background:rgba(0,0,0,0.6);
    border-radius:50%;
    padding:15px;
    transition:0.3s;
}

/* hover effet */
.video-box:hover .video-overlay{
    background:rgba(0,0,0,0.5);
}

.video-box:hover .video-overlay i{
    transform:scale(1.1);
}

/* vidéo active */
.video-player{
    width:100%;
    border-radius:16px;
    background:#000;
}

/* Youtube preview */
/*.youtube-box{
    position:relative;
    cursor:pointer;
}

.youtube-box img{
    width:100%;
    border-radius:16px;
}

.youtube-box iframe{
    width:100%;
    height:220px;
    border-radius:16px;
}*/

/* Bouton play stylé */
/*.play-btn{
    position:absolute;
    top:50%;
    left:50%;
    transform:translate(-50%,-50%);
    width:60px;
    height:60px;
    border-radius:50%;
    background:rgba(0,0,0,0.6);
    display:flex;
    align-items:center;
    justify-content:center;
    backdrop-filter: blur(6px);
}

.play-btn i{
    color:white;
    font-size:30px;
}*/

/* Hover effet */
/*.youtube-box:hover .play-btn{
    transform:translate(-50%,-50%) scale(1.1);
}*/


/*Bouton retour*/
.rules-back{
    display:inline-flex;
    align-items:center;
    gap:6px;
    margin-bottom:15px;
    color:var(--primary);
    text-decoration:none;
    font-size:0.9rem;
}

.rules-back:hover{
    text-decoration:underline;
}


/*Premium*/
/*.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin-left: 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #2b1d00;
    background: linear-gradient(135deg, #FFD700, #F5C542, #E6B800);
    box-shadow: 0 4px 14px rgba(255, 215, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.premium-badge i {
    font-size: 16px;
    color: #8a5b00;
}*/


.premium-user {
    border: 1px solid rgba(255, 215, 0, 0.25);
    
    background: linear-gradient(
        145deg,
        rgba(255, 215, 0, 0.04),
        rgba(255, 255, 255, 0.01)
    );

    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.45),
        0 0 25px rgba(255, 215, 0, 0.05);
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    margin-left: 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;

    color: #fff;

    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.18),
        rgba(255, 200, 0, 0.08)
    );

    border: 1px solid rgba(255, 215, 0, 0.35);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.08);
}

.premium-badge:hover {
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 4px 18px rgba(255, 215, 0, 0.15);
    transform: translateY(-1px);
}

.premium-badge i {
    font-size: 14px;
    color: #fff;
}

.premium-avatar {
    border: 2px solid rgba(255, 215, 0, 0.6);
    box-shadow:
        0 0 0 3px rgba(255, 215, 0, 0.08),
        0 8px 25px rgba(0, 0, 0, 0.35);
    border-radius: 50%;
}

.premium-name {
    background: linear-gradient(
        90deg,
        #f5d97a,
        #ffffff,
        #e6c15a
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.profile-detail{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}