/* ARTICLE LAYOUT */
.article-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.article-header {
  margin-bottom: 2rem;
}

.article-category {
  font-size: 0.8rem;
  font-weight: bold;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.article-meta img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.article-meta-info {
  display: flex;
  flex-direction: column;
}

.article-author {
  font-weight: 600;
  color: var(--text-color);
}

.article-date {
  font-size: 0.9rem;
  color: #666;
}

.article-image {
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--text-color);
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content ul, 
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content pre {
  background: #1e1e1e;
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

.article-content pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: #2d2d2d;
  border-radius: 12px 12px 0 0;
}

.article-content code {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  color: #e1e1e1;
}

.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.article-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.tag {
  background: #f3f4f6;
  color: #4b5563;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.article-share h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.share-buttons {
  display: flex;
  gap: 1rem;
}

.share-button {
  background: var(--primary-color);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* TABLE OF CONTENTS */
.toc {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  max-width: 300px;
  max-height: 80vh;
  overflow-y: auto;
}

.toc h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  color: #4b5563;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
  display: block;
  padding: 0.3rem 0;
}

.toc a:hover {
  color: var(--primary-color);
}

.toc a.active {
  color: var(--primary-color);
  font-weight: 600;
}

/* Theme Toggle Button - Article Page */
.article-container .theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  z-index: 1000;
}

.article-container .theme-toggle:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
}

/* Back to Top Button - Article Page */
.article-container .back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 6rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  text-decoration: none;
}

.article-container .back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.article-container .back-to-top:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
  color: white;
}

/* Dark mode adjustments for buttons */
[data-theme="dark"] .article-container .theme-toggle,
[data-theme="dark"] .article-container .back-to-top {
  background: var(--primary-color);
  color: white;
}

[data-theme="dark"] .article-container .theme-toggle:hover,
[data-theme="dark"] .article-container .back-to-top:hover {
  background: var(--primary-dark);
}

/* Responsive adjustments for buttons */
@media (max-width: 768px) {
  .article-container .theme-toggle {
    bottom: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  .article-container .back-to-top {
    bottom: 1rem;
    right: 4rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}

/* ARTICLE NAVIGATION */
.article-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  transform: translateX(5px);
}

.nav-link.prev:hover {
  transform: translateX(-5px);
}

.nav-link span {
  font-size: 0.9rem;
  color: #666;
}

/* RELATED ARTICLES */
.related-articles {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.related-articles h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.related-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

.related-card:hover {
  transform: translateY(-5px);
}

.related-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.related-card-content {
  padding: 1rem;
}

.related-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.related-card p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

/* COMMENTS SECTION */
.comments-section {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.comments-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.comment-form {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.comment-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-family: inherit;
  resize: vertical;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-form .form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.comment-form input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
}

.comment-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-form button {
  background: var(--primary-color);
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

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

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 600;
  color: var(--text-color);
}

.comment-date {
  font-size: 0.9rem;
  color: #666;
}

.comment-text {
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.comment-actions {
  display: flex;
  gap: 1rem;
}

.comment-action {
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.comment-action:hover {
  color: var(--primary-color);
}

.comment-replies {
  margin-left: 3rem;
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid #e2e8f0;
}

/* RESPONSIVE */
@media(max-width: 1200px) {
  .toc {
    display: none;
  }
}

@media(max-width: 768px) {
  .article-title {
    font-size: 2rem;
  }

  .article-image img {
    height: 300px;
  }

  .article-content {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }

  .share-buttons {
    flex-direction: column;
  }

  .article-navigation {
    flex-direction: column;
    gap: 1rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .comment-form .form-row {
    flex-direction: column;
  }

  .comment {
    flex-direction: column;
  }

  .comment-replies {
    margin-left: 1rem;
  }
}

/* ARTICLES SIMILAIRES */
.related-articles-section {
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.related-articles-section .bg-white {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.related-articles-section h3 {
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.related-articles-section .grid {
  gap: 1.5rem;
}

.related-articles-section article {
  padding: 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}

.related-articles-section article:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.related-articles-section .related-card-image {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.related-articles-section img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-articles-section article:hover img {
  transform: scale(1.05);
}

.related-articles-section h4 {
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.related-articles-section h4 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.related-articles-section h4 a:hover {
  color: var(--primary-color);
}

.related-articles-section p {
  color: var(--muted-text);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.related-articles-section .related-card-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted-text);
}

.related-articles-section .related-card-category {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Utilitaires pour Livewire */
.livewire-line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive pour articles similaires */
@media(max-width: 768px) {
  .related-articles-section .grid {
    grid-template-columns: 1fr;
  }
  
  .related-articles-section img {
    height: 150px;
  }
  
  .related-articles-section h4 {
    font-size: 1rem;
  }
} 