/* --- Platform-Specific Scrolling Posts --- */
.scrolling-wrapper {
    height: 600px;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 15%, black 85%, transparent);
}

#postsContainer {
    display: flex;
    gap: 1rem;
}

.post-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 50%;
}

.post-column:nth-child(1) {
    animation: scroll-vertical 40s linear infinite;
}

.post-column:nth-child(2) {
    animation: scroll-vertical 48s linear infinite;
}

@keyframes scroll-vertical {
    0% { transform: translateY(0%); }
    100% { transform: translateY(-50%); }
}

/* --- Base Card Style --- */
.post-card {
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb; /* Tailwind gray-200 */
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 0.4rem;
    break-inside: avoid;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.post-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    object-fit: cover;
    background-color: #f3f4f6; /* gray-100 */
}

.post-author .name { font-weight: 600; color: #111827; /* gray-900 */ }
.post-author .handle { font-size: 0.875rem; color: #6b7280; /* gray-500 */ }
.post-content { font-size: 0.7rem; line-height: 1.5; color: #374151; /* gray-700 */ }
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6; /* gray-100 */
    font-size: 0.8rem;
    color: #6b7280; /* gray-500 */
}
.post-actions { display: flex; gap: 1rem; }

/* --- LinkedIn Card (Variant from Image) --- */
.linkedin-card-variant {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    box-shadow: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.linkedin-card-variant .top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #f0f2f5;
    border-bottom: 1px solid #ddd;
}
.linkedin-card-variant .top-bar .campaign { font-size: 0.9rem; color: #666; }
.linkedin-card-variant .top-bar .platform-logo { font-weight: 600; color: #0A66C2; }

.linkedin-card-variant .post-header {
    padding: 1rem 1rem 0.5rem 1rem;
}

.linkedin-card-variant .post-author .name {
    font-size: 1rem;
    font-weight: 700;
}
.linkedin-card-variant .post-author .handle {
    font-size: 0.8rem;
    color: #666;
}
.linkedin-card-variant .post-content {
    padding: 0 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1a1a1a;
}
.linkedin-card-variant .post-content p {
    margin-bottom: 1rem;
}
.linkedin-card-variant .post-tags {
    padding: 0 1rem;
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}
.linkedin-card-variant .post-tags span {
    background-color: #eef3f8;
    color: #0A66C2;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.linkedin-card-variant .post-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.linkedin-card-variant .post-footer .stats {
    display: flex;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}
.linkedin-card-variant .post-footer .reactions {
    display: flex;
    gap: 0.75rem;
    font-size: 1.25rem;
    color: #666;
}


/* --- LinkedIn Card --- */
.linkedin-card {
    border-left: 4px solid #0A66C2;
}
.linkedin-card .post-header .platform-icon { margin-left: auto; color: #0A66C2; }

/* --- Twitter Card --- */
.twitter-card {
    background-color: #fff;
}
.twitter-card .post-header .platform-icon { margin-left: auto; color: #1DA1F2; }
.twitter-card .post-footer .post-actions i { transition: color 0.2s; }
.twitter-card .post-footer .post-actions .action-comment:hover { color: #1DA1F2; }
.twitter-card .post-footer .post-actions .action-retweet:hover { color: #17BF63; }
.twitter-card .post-footer .post-actions .action-like:hover { color: #E0245E; }

/* --- Instagram Card --- */
.instagram-card {
    padding: 0;
    border-radius: 1rem;
    overflow: hidden;
}
.instagram-card .post-header { padding: 0.75rem 1rem; }
.instagram-card .post-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}
.instagram-card .post-content { padding: 0 1rem; margin-top: 0.5rem; }
.instagram-card .post-footer { padding: 0.75rem 1rem; border: none; }
.instagram-card .post-header .platform-icon { margin-left: auto; color: #C13584; }

/* --- TikTok Card --- */
.tiktok-card {
    background-color: #010101;
    color: #fff;
    border-color: #333;
    position: relative;
    padding: 0;
    overflow: hidden;
}
.tiktok-card .post-video-placeholder {
    background: linear-gradient(135deg, #ff2a54, #25f4ee);
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tiktok-card .post-video-placeholder i { font-size: 3rem; color: rgba(255,255,255,0.8); }
.tiktok-card .post-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 1rem; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); }
.tiktok-card .post-author .name { color: #fff; }
.tiktok-card .post-author .handle { color: #eee; }
.tiktok-card .post-footer { border: none; padding: 0 1rem 0.5rem 1rem; }
.tiktok-card .post-actions { flex-direction: column; position: absolute; right: 0.5rem; bottom: 6rem; gap: 1.25rem; }

/* --- Fix pour éviter les espaces vides --- */
.bg-white.dark\\:bg-gray-800,
.bg-gray-900.dark\\:bg-gray-900 {
    height: fit-content !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.bg-white.dark\\:bg-gray-800 .flex-grow,
.bg-gray-900.dark\\:bg-gray-900 .flex-grow {
    flex-grow: 0 !important;
}


/* Performance & Accessibility Enhancements */
.post-column {
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.scrolling-wrapper {
  will-change: contents;
}
@media (prefers-reduced-motion: reduce) {
  .post-column { animation: none !important; }
}

/* 3D transform keyframes for smoother GPU-accelerated scrolling */
@keyframes scroll-vertical-3d {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -50%, 0); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .scrolling-wrapper {
    height: 420px;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
  }
  #postsContainer {
    gap: 0.5rem;
  }
  .post-column {
    width: 50%;
    animation-name: scroll-vertical-3d;
    animation-duration: 44s;
    animation-timing-function: linear;
  }
  /* Rétablir la 2e colonne sur mobile pour un affichage deux par deux */
  .post-column:nth-child(2) {
    display: flex;
  }
  .post-card {
    padding: 0.4rem;
    border-radius: 0.65rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  .post-header { gap: 0.5rem; margin-bottom: 0.5rem; }
  .post-avatar { width: 1rem; height: 1rem; }
  .post-author .name { font-size: 0.9rem; }
  .post-author .handle { font-size: 0.75rem; }
  .post-content { font-size: 0.85rem; line-height: 1.45; }
  .post-footer { margin-top: 0.5rem; padding-top: 0.4rem; font-size: 0.7rem; }
  .post-actions { gap: 0.6rem; }
  .instagram-card .post-image { height: 90px; }
  .tiktok-card .post-video-placeholder { height: 170px; }
}

@media (max-width: 480px) {
  #postsContainer { gap: 0.4rem; }
  .post-column { width: 50%; }
  .post-card { padding: 0.35rem; border-radius: 0.6rem; }
  .post-content { font-size: 0.8rem; }
  .post-footer { font-size: 0.65rem; }
  .instagram-card .post-image { height: 80px; }
  .tiktok-card .post-video-placeholder { height: 160px; }
}