* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8fafc;
  color: #334155;
}

.site {
  max-width: 100%;
  margin: 0 auto;
}

.header {
  position: sticky;
  top: 0;
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 0;
  z-index: 1000;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.search-container {
  position: relative;
}

.search-input {
  padding: 8px 16px;
  padding-left: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f1f5f9;
  width: 300px;
  font-size: 0.9rem;
  transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
  background-size: 18px;
}

.search-input:focus {
  outline: none;
  background-color: white;
  border-color: #417893;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
  width: 350px;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
  border: 1px solid #e2e8f0;
}

.search-results.active {
  display: block;
}

.search-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: #f8fafc;
}

.search-item-title {
  font-weight: 600;
  color: #417893;
  margin-bottom: 4px;
  display: block;
}

.search-item-snippet {
  font-size: 0.85rem;
  color: #417893;
  display: block;
  line-height: 1.4;
}

.search-item-snippet mark {
  background: rgba(13, 110, 253, 0.1);
  color: #417893;
  padding: 0 2px;
  border-radius: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.85rem;
}

.lang-switcher a {
  text-decoration: none;
  color: #417893;
  transition: all 0.2s;
}

.lang-switcher a:hover {
  color: #417893;
}

.lang-switcher a.active {
  color: #417893;
  font-weight: bold;
}

.divider {
  color: #e2e8f0;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
}

.titre {
  font-weight: bold;
  font-size: 1.6rem;
  color: #417893;
  text-decoration: none;
}

.search,
.search-sidebar {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  width: 200px;
}

.layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 70px;
  left: 0;
  width: 300px;
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  height: calc(100vh - 70px);
  transition: transform 0.3s ease;
}

.sidebar-content {
  padding: 1.5rem;
}

.section-title {
  font-weight: bold;
  color: #417893;
  margin: 1.5rem 0 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.table-container {
  max-width: 700px;
  margin: 10px auto;
  padding: 2rem;
}

.table-container h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: #1e293b;
}

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

.tab-list li {
  list-style: none;
  margin: 1rem 0;
  display: block;
  background: white;
  color: #1e293b;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 500;
}

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

.nav-list li {
  margin: 0.25rem 0;
}

.nav-list a {
  display: block;
  padding: 0.75rem 0.5rem;
  text-decoration: none;
  color: #475569;
  transition: all 0.2s ease-in-out;
}

.nav-list a:hover {
  color: #0366cf;
  background: #e2e8f0;
}

.nav-list a.active {
  color: #0366cf;
  font-weight: 500;
  border-left: 3px solid #417893;
}

.gad li {
  list-style: none;
}

.content {
  max-width: 650px;
  margin: 0 40px;
  overflow-y: auto;
  height: auto;
  line-height: 1.6;
}

.content h1 {
  margin-bottom: 1rem;
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c6badff;
}

.content h2 {
  font-size: 1.8rem;
  color: #2c4a75ff;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content p {
  line-height: 1.8;
  margin-bottom: 1rem;
}

.content ul {
  list-style-type: disc;
  padding-left: 2rem;
  margin-bottom: 1rem;
}

img {
  display: block;
  margin: 1rem auto;
  border: 2px solid #b5c6d6ff;
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

.imaggro {
  height: 45vh;
  margin: 1rem auto;
}

.imaggra {
  max-width: 100%;
  margin: 1rem auto;
}

.btn-menu {
  display: none;
  background: #b1b1b1ff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: white;
  padding: 0.25rem 1rem;
  border-radius: 6px;
}

.nav-list li {
  display: block;
}

.contenu {
  display: flex;
  align-items: flex-start;
  position: relative;
  width: 100%;
}

.sousch {
  position: fixed;
  top: 100px;
  right: 5%;
  width: 250px;
  background: #f9f9f9;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: fit-content;
}

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

.sousch li {
  margin: 8px 0;
}

.sousch a {
  text-decoration: none;
  color: #333;
  padding: 0 10px;
}

.sousch a:hover {
  color: #417893;
}

.sousch a.active {
  color: #417893;
  border-left: 2px solid #417893;
}

.chap3 {
  flex: 3;
  width: 100%;
}

[id]::before {
  content: "";
  display: block;
  height: 70px;
  margin-top: -70px;
}

.tableau {
  width: 100%;
  overflow-x: auto;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
  text-align: left;
  overflow-x: auto;
}

.param-table thead {
  background-color: #417893;
  color: white;
}

.param-table th,
.param-table td {
  border: 1px solid #ddd;
  padding: 3px 15px;
}

.param-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.code-container {
  overflow-x: auto;
  white-space: nowrap;
}

.code-container code {
  white-space: nowrap;
  display: inline-block;
  width: 100%;
  background-color: #f5f5f5;
  color: #e83e8c;
  padding: 6px 20px;
  border-radius: 4px;
  box-sizing: border-box;
  font-family: monospace;
  font-size: 1.1em;
}

strong {
  font-size: 1.1em;
}

.link-doc {
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s, text-decoration 0.3s;
  font-size: 1.1rem;
}

.link-doc:hover {
  color: #334155;
  text-decoration: underline;
}

pre {
  background: #1e1e1e;
  border-radius: 12px !important;
  margin: 1.5rem 0 !important;
  padding: 1.25rem !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  position: relative;
}

code {
  font-family: "JetBrains Mono", "Fira Code", "Source Code Pro", monospace;
  font-size: 0.95rem;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
  z-index: 10;
}

pre:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.grey {
  background-color: #DDD;
  padding: 1px 4px;
  border-radius: 4px;
}

.language-json {
  color: #e6db74;
}

@media (max-width: 1400px) {
  .header-content {
    padding: 0 2rem;
  }
}

@media (max-width: 1317px) {
  .sousch {
    display: none;
  }
}

@media (max-width: 1175px) {
  .sidebar {
    width: 240px;
  }
}

@media screen and (max-width: 985px) {
  .btn-menu {
    display: inline-block;
  }

  .search {
    display: none;
  }

  .layout {
    margin-left: 0;
  }

  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 300px;
    height: calc(100vh - 60px);
    transform: translateX(-100%);
    z-index: 99;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .imaggro {
    height: 45vh;
    margin: 1rem auto;
  }

  img {
    max-width: 100%;
    margin: 1rem auto;
  }

  .content,
  body.chapitre3 main {
    margin: 0 20px;
  }
}

@media (max-width: 544px) {
  .content {
    padding: 0.5rem;
  }

  .content h1 {
    font-size: 1.7rem;
  }

  .content h2 {
    font-size: 1.2rem;
  }

  .content p,
  strong,
  li,
  td,
  th {
    font-size: 0.9rem;
  }

  .code-container code {
    font-size: 0.9rem;
  }

  .nav-list a {
    font-size: 0.9rem;
  }

  .link-doc {
    font-size: 0.9rem;
  }

  img {
    margin: 1rem auto;
  }

  .imaggro {
    height: 35vh;
  }

  .imaggra {
    max-width: 80%;
  }
}

@media (max-width: 384px) {
  .content {
    padding: 0;
  }

  .content h1 {
    font-size: 1.4rem;
  }

  .content h2 {
    font-size: 1.2rem;
  }

  .code-container code {
    font-size: 0.7rem;
  }

  .content p,
  strong,
  a,
  li,
  td,
  th {
    font-size: 0.9rem;
  }
}

/* Feature Cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: #417893;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: rgba(65, 120, 147, 0.1);
  color: #417893;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.feature-card h4 {
  margin: 0;
  color: #1e293b;
  font-size: 1.1rem;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  color: #417893;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Workflow Stepper */
.workflow-stepper {
  margin: 2.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  display: flex;
  gap: 1.5rem;
  position: relative;
  padding-bottom: 2rem;
}

.step:last-child {
  padding-bottom: 0;
}

.step::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.step:last-child::before {
  display: none;
}

.step-number {
  width: 32px;
  height: 32px;
  background: #417893;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
  z-index: 1;
}

.step-content {
  background: white;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  flex: 1;
}

.step-content h4 {
  margin: 0 0 0.5rem 0;
  color: #1e293b;
  font-size: 1rem;
}

.step-content p {
  margin: 0;
  color: #417893;
  font-size: 0.9rem;
  line-height: 1.6;
}

.badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 4px;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-active {
  background: #dcfce7;
  color: #166534;
}