/* Variables CSS */
:root {
  --primary-color: #2563eb;
  --secondary-color: #64748b;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --info-color: #0891b2;
  --light-color: #f8fafc;
  --dark-color: #1e293b;
  --purple-color: #7c3aed;
  --blue-color:  #2c3e50;

  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-warning: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --border-radius: 0.5rem;
  --border-radius-lg: 1rem;
  --border-radius-xl: 1.5rem;

  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

/* Base styles */
* {
  box-sizing: border-box;
}
html, body {
  overflow-x: hidden;
}


body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--dark-color);
  background-color: #ffffff;
}

/* Typography */
.bg-gradient-primary {
  background: var(--gradient-primary) !important;
}

.bg-gradient-secondary {
  background: var(--gradient-secondary) !important;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Utilitaire perso pour le dégradé rouge-orangé du bouton principal */
.bg-gradient-red {
  background-image: linear-gradient(135deg,#e53935 0%, #e35d37 50%, #d93b2b 100%);
  transition: background-position .4s ease;
  background-size: 200% 200%;
}
.bg-gradient-red:hover,
.bg-gradient-red:focus {
  background-position: 100% 0;   /* effet shift léger au survol */
}


.display-1,
.display-2,
.display-3,
.display-4,
.display-5,
.display-6 {
  font-weight: 700;
  line-height: 1.2;
}

/* Navigation */
.navbar {
  transition: var(--transition);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: var(--shadow-md);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
}

.nav-link {
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color) !important;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  display: block;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 1px;
}

@media (max-width: 768px) {
  .navbar-nav .nav-link.active::after {
    display: none !important;
  }
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  background: var(--gradient-primary);
  position: relative;
  overflow: hidden;
}

.hero-section,
.hero-content,
.stats-box             { width: 100%; max-width: 100%; }

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.hero-section .container {
  position: relative;
  z-index: 2;
}

/* Buttons */
.btn {
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  transition: all 0.2s ease-in-out;
}

.btn-warning {
  background: var(--gradient-warning);
  border: none;
  color: var(--dark-color);
}

.btn-success {
  background: var(--gradient-success);
  border: none;
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius-lg);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.tool-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.tool-card:hover {
  border-color: var(--primary-color);
}

/* Feature Icons */
.feature-icon,
.tool-icon {
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-lg);
  transition: var(--transition);
}

.feature-icon:hover,
.tool-icon:hover {
  transform: scale(1.1);
  transition: all 0.2s ease-in-out;
}

/* Step Numbers */
.step-number {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Newsletter Section */
.newsletter-section {
  background: var(--gradient-primary);
  border-radius: var(--border-radius-xl);
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Footer */
footer {
  background: var(--dark-color) !important;
  color: white;
  padding: 60px 0 30px;
  margin-top: 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-section h3 {
  margin-bottom: 20px;
  color: #ecf0f1;
  font-size: 1.2rem;
}

.footer-section p,
.footer-section li {
  color: #bdc3c7;
  line-height: 1.6;
  margin-bottom: 10px;
}

.footer-section ul {
  list-style: none;
}

.footer-section a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: #667eea;
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
  border-radius: var(--border-radius);
}

/* Utilities */
.bg-purple {
  background-color: var(--purple-color) !important;
}

.text-purple {
  color: var(--purple-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    min-height: 80vh;
    text-align: center;
  }

  .display-4 {
    font-size: 2rem;
  }

  .step-number {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
  border-color: var(--primary-color);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ===== ISHIKAWA SPECIFIC STYLES ===== */

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 0;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: var(--border-radius-lg);
}

.header h1 {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.header p {
  color: var(--secondary-color);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}


/* Retire le fond blanc entre navbar et section */
.header-hero {
  background-color: transparent !important;
  margin-top: 0;
  padding-top: calc(3.5rem + 1rem); /* Ajuste si navbar fixe est 3.5rem de hauteur */
}
/* Controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
}

.controls, .five-why-container {
  overflow: visible;
}

.problem-input {
  flex: 1;
  min-width: 300px;
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

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

/* Export Dropdown */
/* Export Dropdown */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-dropdown .dropdown-toggle {
  background: var(--gradient-success);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 999;
}

.export-dropdown .dropdown-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Le contenu doit rester visible au hover sur lui aussi */
.export-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  min-width: 200px;
  box-shadow: var(--shadow-xl);
  border-radius: var(--border-radius);
  z-index: 1000;
  overflow: hidden;
  margin-top: 0.5rem;
}

/* Affiche le menu au hover du conteneur OU du contenu */
.export-dropdown:hover .export-dropdown-content,
.export-dropdown-content:hover {
  display: block;
  animation: fadeInUp 0.3s ease;
}

.export-dropdown-content button {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--dark-color);
  font-weight: 500;
}

.export-dropdown-content button:hover {
  background: var(--light-color);
  color: var(--primary-color);
}

.export-dropdown-content button i {
  width: 20px;
  margin-right: 0.5rem;
}

/* Diagram Container */
.diagram-container {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  margin-top: 8.5rem; /* ou +++, ex: 4rem selon l'espace souhaité */

  min-height: 80vh;
  position: relative;
  overflow: hidden;
}

/* Fishbone */
.fishbone {
  position: relative;
  width: 100%;
  height:95vh;
  min-height: 600px;
  background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 100%);
  border-radius: var(--border-radius);
  overflow: hidden;
}

/* SVG pour les lignes de connexion */
.connection-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.connection-line-svg {
  stroke: var(--primary-color);
  stroke-width: 3;
  stroke-dasharray: 5, 5;
  opacity: 0.7;
}

/* Épine dorsale */
.spine {
  position: absolute;
  top: 50%;
  left: 20%;
  right: 15%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 100%);
  transform: translateY(-50%);
  border-radius: 3px;
  box-shadow: var(--shadow);
  z-index: 2;
}

/* Tête du poisson */
.fish-head {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}

.fish-shape {
  width: 120px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
  border-radius: 0 60px 60px 0;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.fish-shape::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-right: 20px solid var(--primary-color);
}

/* Boîte du problème */
.problem-box {
  position: absolute;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 300px;
  min-width: 250px;
  border: 3px solid var(--primary-color);
  cursor: pointer;
  transition: var(--transition);
  z-index: 4;
  font-weight: 600;
  color: var(--dark-color);
  text-align: center;
  line-height: 1.4;
}

.problem-box:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: var(--shadow-xl);
  border-color: var(--info-color);
}

/* Zones de catégories */
.category-zone {
  position: absolute;
  z-index: 5;
  transition: var(--transition);
}

.category-zone.dragging {
  z-index: 1000;
  transform: rotate(2deg);
  box-shadow: var(--shadow-xl);
}

.category {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  max-width: 280px;
  transition: var(--transition);
  border: 2px solid transparent;
}
.category.dragging {
  opacity: 0.6;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  cursor: grabbing;
}

.category:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-xl);
}

.category-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
  color: white;
  padding: 1rem;
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  cursor: move;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: var(--transition);
}

.category-header:hover .category-actions {
  opacity: 1;
}

.category-actions button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-actions button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Liste des causes */
.causes-list {
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.cause-item {
  background: var(--light-color);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  border-left: 4px solid var(--primary-color);
  font-size: 0.9rem;
  line-height: 1.4;
}

.cause-item:hover {
  background: #e0f2fe;
  transform: translateX(5px);
  box-shadow: var(--shadow);
}

.cause-item:last-child {
  margin-bottom: 1rem;
}

.delete-cause {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--danger-color);
  color: white;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cause-item:hover .delete-cause {
  opacity: 1;
}

.delete-cause:hover {
  background: #b91c1c;
  transform: scale(1.1);
}

.add-cause-btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--success-color) 0%, #10b981 100%);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.add-cause-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Modales */
.modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: fadeInUp 0.3s ease;
}

.modal-content h2 {
  margin-top: 0;
  color: var(--primary-color);
  font-weight: 600;
}

.close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: var(--secondary-color);
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
}

.close:hover {
  color: var(--danger-color);
  transform: scale(1.1);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

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

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* ===== FIVE WHY SPECIFIC STYLES ===== */

.five-why-container {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow);
  padding: 2.5rem;
   margin-top: 6.5rem; /* ou +++, ex: 4rem selon l'espace souhaité */
  margin-bottom: 2rem;

}

.problem-statement {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  margin-bottom: 2rem;
  border-left: 6px solid var(--warning-color);
}

.problem-statement h3 {
  color: var(--warning-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.problem-statement input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #fbbf24;
  border-radius: var(--border-radius);
  font-size: 1.1rem;
  background: white;
  transition: var(--transition);
}

.problem-statement input:focus {
  outline: none;
  border-color: var(--warning-color);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.why-chain {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.why-step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: var(--border-radius-lg);
  border-left: 6px solid var(--primary-color);
  position: relative;
  transition: var(--transition);
}

.why-step:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.why-number {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.why-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.why-question,
.why-answer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.why-question label,
.why-answer label {
  font-weight: 600;
  color: var(--dark-color);
}

.why-question input,
.why-answer textarea {
  padding: 0.75rem;
  border: 2px solid #cbd5e1;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: white;
}

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

.why-answer textarea {
  min-height: 80px;
  resize: vertical;
}

.remove-step-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--danger-color);
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.remove-step-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: var(--shadow);
}

.root-cause {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  margin-top: 2rem;
  border-left: 6px solid var(--success-color);
  text-align: center;
}

.root-cause h3 {
  color: var(--success-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.root-cause p {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--dark-color);
  margin: 0;
}

/* ===== BLOG SPECIFIC STYLES ===== */

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

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--dark-color);
}

.article-content h1 {
  font-size: 2.5rem;
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

.article-content h2 {
  font-size: 2rem;
  color: var(--primary-color);
}

.article-content h3 {
  font-size: 1.5rem;
  color: var(--secondary-color);
}

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

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

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

.article-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--secondary-color);
  background: var(--light-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
}

.article-content code {
  background: var(--light-color);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.9rem;
  color: var(--danger-color);
}

.article-content pre {
  background: var(--dark-color);
  color: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: 2rem 0;
}

.article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-content th,
.article-content td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.article-content th {
  background: var(--light-color);
  font-weight: 600;
  color: var(--dark-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .diagram-container {
    padding: 1rem;
  }

  .fishbone {
    height: 70vh;
  }

  .problem-box {
    max-width: 250px;
    min-width: 200px;
    padding: 1rem;
  }

  .category {
    min-width: 180px;
    max-width: 220px;
  }
}

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .problem-input {
    min-width: auto;
    margin-bottom: 1rem;
  }

  .export-dropdown .dropdown-toggle {
    width: 100%;
    justify-content: center;
  }

  /* Supprime l’image de fond Bootstrap et ajoute ta couleur d’accent */
.dropdown-menu .dropdown-item:hover {
  background-color: rgba(0, 123, 255, 0.2);
  font-weight: 500;
}

  .export-dropdown-content {
    position: static;
    display: block;
    box-shadow: none;
    background: var(--light-color);
    margin-top: 0.5rem;
    border-radius: var(--border-radius);
  }

  .export-dropdown:hover .export-dropdown-content {
    display: block;
     background-color: rgba(0, 123, 255, 0.1); /* bleu léger, à adapter */
  }

  .fishbone {
    height: 60vh;
    min-height: 500px;
  }

  .spine {
    left: 10%;
    right: 10%;
  }

  .fish-head {
    right: 2%;
  }

  .fish-shape {
    width: 80px;
    height: 60px;
  }

  .problem-box {
    right: 5%;
    max-width: 200px;
    min-width: 150px;
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .category {
    min-width: 150px;
    max-width: 180px;
  }

  .category-header h3 {
    font-size: 0.9rem;
  }

  .cause-item {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .why-step {
    flex-direction: column;
    gap: 1rem;
  }

  .why-number {
    align-self: flex-start;
  }

  .modal-content {
    margin: 10% auto;
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 1rem;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .controls {
    padding: 1rem;
  }

  .diagram-container {
    padding: 0.5rem;
  }

  .fishbone {
    height: 50vh;
    min-height: 400px;
  }

  .category {
    min-width: 120px;
    max-width: 150px;
  }

  .category-header {
    padding: 0.75rem;
  }

  .category-header h3 {
    font-size: 0.8rem;
  }

  .causes-list {
    padding: 0.75rem;
  }

  .cause-item {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .problem-box {
    max-width: 150px;
    min-width: 120px;
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* Print Styles */
@media print {
  .controls,
  .export-dropdown,
  .category-actions,
  .delete-cause,
  .add-cause-btn,
  .remove-step-btn {
    display: none !important;
  }

  .diagram-container,
  .five-why-container {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .fishbone {
    background: white;
  }

  .category-header {
    background: #f3f4f6 !important;
    color: black !important;
  }

  .why-step {
    background: white !important;
    border: 1px solid #ccc;
  }

  .why-number {
    background: #6b7280 !important;
  }
}
