/* =========================
   GLOBAL
========================= */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f7f4ef;
  font-family: Inter, Arial, sans-serif;
  color: #1d2433;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* =========================
   HEADER
========================= */

.site-header {
  background: linear-gradient(90deg, #081a36, #0d326d);
  color: white;
  padding: 8px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;

  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 240px;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.top-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.language-switcher {
    display: flex;
    gap: 0;
}

.language-switcher a {
    color: white;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

/* Desktop - LTR (English) */
html[lang="en"] .language-switcher a:first-child {
    border-radius: 12px 0 0 12px;
}

html[lang="en"] .language-switcher a:last-child {
    border-radius: 0 12px 12px 0;
    border-left: none;
}

/* Mobile/RTL (Farsi) */
html[lang="fa"] .language-switcher a:first-child {
    border-radius: 0 12px 12px 0;
}

html[lang="fa"] .language-switcher a:last-child {
    border-radius: 12px 0 0 12px;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.language-switcher a.active {
    background: rgba(255, 255, 255, 0.184);
}

.language-switcher a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Header layout */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: linear-gradient(90deg, #081a36, #0d326d);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* Responsive */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .header-right {
        display: none;
    }

    .site-header {
        padding: 12px 16px;
    }
}

/* =========================
   HAMBURGER MENU
========================= */

.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-btn span {
    width: 24px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 78px;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #081a36, #0d326d);
    flex-direction: column;
    padding: 20px;
    display: none;
    gap: 16px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    max-height: calc(100vh - 78px);
    overflow-y: auto;
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu-link {
    color: white;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 20px;
    border-color: rgba(255, 255, 255, 0.4);
}

.language-switcher-mobile {
    display: flex;
    gap: 10px;
    padding-top: 10px;
}

.language-switcher-mobile a {
    flex: 1;
    padding: 10px;
    text-align: center;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.language-switcher-mobile a.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: white;
}

.language-switcher-mobile a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
    /* ✅ Afficher hamburger et masquer header-right */
    .hamburger-btn {
        display: flex;
    }

    .header-right {
        display: none !important;
    }

    .site-header {
        padding: 12px 16px;
    }

    .logo {
        width: 150px;
    }

    .mobile-menu {
        position: fixed;
        top: 78px;
        left: 0;
        right: 0;
    }
}

@media (max-width: 480px) {
    .hamburger-btn span {
        width: 20px;
        height: 2px;
    }

    .mobile-menu {
        top: 70px;
        padding: 16px;
    }

    .mobile-menu-link {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* =========================
   HERO SECTION
========================= */

.hero-search {
  padding: 45px 10px 10px 45px;
  text-align: center;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
}

.hero-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0d1f3c;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.hero-content p {
  font-size: 1rem;
  color: #5e6470;
  max-width: 760px;
  margin: 20px auto 40px;
}

/* =========================
   SEARCH BAR
========================= */

.search-form {
  position: relative;
  overflow: visible !important;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  background: white;
  border: 1.2px solid #dbe3f4;
  border-radius: 24px;
  padding: 8px;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(32, 33, 36, 0.08);
  transition: all 0.2s ease;
}

.search-form:has(.search-input:focus) {
    border: 1.2px solid #ffbe2676;
    transition: all 0.6s ease;
    box-shadow: 0 1px 4px rgba(255, 187, 15, 0.307);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 20px 36px;
  font-size: 1rem;
  color: #1d2433;
  transition: all 0.2s ease;
}

.search-input::placeholder {
  color: #2431489d;
}

.search-left {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 10px;
}

/* dropdown connecté */
.suggestions-box {
  position: absolute;
  top: calc(100% + 10px);      /* Espace sous la barre */
  left: 12px;
  right: 0px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(32, 33, 36, 0.386);
  max-height: 600px;
  min-width: 800px;
  overflow-y: auto;
}

.suggestion-group-title {
  align-items: center;
  padding: 4px;
  background: #f8f9fa;   
  font-weight: 500;
  font-size: 1rem;
  text-align: center;
  color: #151f54;
  border-bottom: 0.25px solid #c8c9d0 ;
}

.suggestion-group-title i {
  color: #151f54;
  font-size: 15px;
  margin-right: 8px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  transition: background-color 0.15s ease;
}

.suggestion-item::before {
  font-size: 16px;
  opacity: 0.54;
}

.suggestion-item:hover {
  background: #151f54;
  color: white;
}

.suggestion-content {
  display: flex;
  align-items: center;
}

.suggestion-type {
  font-size: 12px;
  opacity: 0.6;
}

.search-button {
  background: transparent;
  flex-shrink: 0;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 16px;
  color: #151f54;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-button:hover {
  background:#0b3475;
  transform: translateY(-2px);
  color: #ffffff;
}

.search-button:active {
  transform: translateY(0);
}

/* =========================
   SEARCH EXAMPLES
========================= */

.search-examples {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-examples a {
  text-decoration: none;
  padding: 8px 20px;
  background: white;
  border: 1px solid #dde3ee;
  border-radius: 999px;
  color: #23395d;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.search-examples a:hover {
  background: #0d326d;
  border-color: #0d326d;
  color: white;
}

/* =========================
   RESULTS SECTION
========================= */

.results-section {
    padding: 20px 0 20px;
    text-align: center;
}

.results-title {
    font-size: 1rem;
    margin: 20px;
    color: rgb(37, 37, 37);
    font-weight: 400;
}

.results-count,
.results-query {
    color: #182672;
    font-weight: 600;
}

/* Styles pour "Aucun résultat" */
.no-results-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 25px 20px;
}

.no-results {
    text-align: center;
    max-width: 500px;
}

.no-results h3 {
    font-size: 24px;
    color: #333;
    margin: 20px 0;
    font-weight: 600;
}

.no-results-query {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    word-break: break-word;
}

.no-results-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 500;
}

/* =========================
   RESULTS LIST
========================= */

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* =========================
   RESULT CARD
========================= */

.result-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 35px 50px 35px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #f4f8ff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
    transition: 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 26, 55, 0.226);
    border: 1px solid #306fdc59;
}

/* =========================
   IMAGE
========================= */

.result-image {

    width: 300px;
    flex-shrink: 0;
}

.result-image img {

    width: 100%;
    border-radius: 10px;
    display: block;
    border: 1px solid #e5e7eb;
}

.viewer-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:12px;
    padding: 20px;
}

.fullscreen-btn{
    border:none;
    background:#ffffff;
    color: #151f54;
    padding: 8px 10px;
    border-radius:6px;
    cursor:pointer;
    font-size:16px;
}

.fullscreen-btn:hover{
    opacity:.8;
}

.image-modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.95);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:99999;
    padding:30px;
}

.image-modal img{
    max-width:95%;
    max-height:95%;
    object-fit:contain;
}

.close-modal{
    position:absolute;
    top:20px;
    right:30px;
    color:white;
    font-size:40px;
    cursor:pointer;
    font-weight:bold;
}

/* =========================
   CONTENT
========================= */

.result-content {

    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-top {

    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.result-title {

    font-size: 1.2rem;
    font-weight: 600;
    color: #10213d;
}

/* BADGE */

.result-badge {

    background: #f1f1f1;
    color: #183b7b;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
}

/* META */

.result-meta {

    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 14px;
}

/* LINK */

.analysis-link {
    background: #f2f6ff;
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid #e5e7eb;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #053fb4;
    margin: 2px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: 0.2s ease;
}

.analysis-link:hover {
    background: #dce7ff;
    color: #0055ff;
    border: 1px solid #0055ff;
}

/* =========================
   META ICONS
========================= */

.result-meta {

    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 14px;
}

.result-meta span {

    display: flex;
    align-items: center;
    gap: 8px;
}

.result-meta i {

    color: #64748b;
    font-size: 13px;
}

/* =========================
   RESULTS LAYOUT
========================= */

.results-layout {

    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 30px;
}

/* =========================
   RESULTS LIST
========================= */

.results-list {

    display: flex;

    flex-direction: column;

    gap: 20px;
}

/* ============================================================================
   SIDEBAR FILTERS STYLING
   Cases cliquables + styles pour unavailable
   ============================================================================ */

.filters-sidebar {
    flex: 0 0 280px;
    padding: 16px;
    background: #f5f7fa;
    border-radius: 8px;
    border: 1px solid #e0e6ed;
}

.filters-sidebar h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 500;
    color: #1a202c;
}

.filters-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    text-transform: uppercase;
}

.filter-group-title i {
    color: #0d4fd6;
}

.filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.filter-list li {
    margin: 0;
    padding: 0;
}

/* ✅ CHECKBOX STYLING */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.filter-checkbox:hover {
    background: #e8f0ff;
}

/* Checkbox input (native) */
.filter-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #0d4fd6;
    flex-shrink: 0;
}

.filter-checkbox span {
    display: flex;
    text-align: start;
    justify-content: space-between;
    width: 100%;
    font-size: 14px;
}

.filter-checkbox span small {
    margin-left: 8px;  /* ✅ Espace avant l'ID */
    flex-shrink: 0;    /* ✅ ID ne rétrécit pas */
}

.filter-checkbox span small {
    font-size: 12px;
    color: #b4b4b4;
}

/* ✅ CHECKED STATE */
.filter-checkbox input[type="checkbox"]:checked ~ span {
    color: #0d4fd6;
    font-weight: 600;
}

.filter-checkbox input[type="checkbox"]:checked ~ span small {
    color: #0d7ae8;
}

/* ✅ UNAVAILABLE CHECKED STATE */
.filter-checkbox.unavailable input[type="checkbox"]:checked ~ span {
    color: #4299e1;
    opacity: 1;
}

/* ============================================================================
   CLEAR FILTERS BUTTON STYLING
   ============================================================================ */

.filter-actions {
    display: flex;
    gap: 12px;
}

.btn-clear-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: #f5f7fa;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #d63031;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear-filters:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: white;
}

.btn-clear-filters:active {
    transform: scale(0.98);
}

.btn-clear-filters i {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .filter-actions {
        padding: 16px 0;
        margin-top: 16px;
        border-top: 1px solid #e0e6ed;
    }

    .btn-clear-filters {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* ============================================================================
   RESPONSIVE (MOBILE)
   ============================================================================ */

@media (max-width: 768px) {
    .filters-sidebar {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 24px;
        border-radius: 12px;
        padding: 18px;
    }

    .filters-form {
        gap: 20px;
    }

    .filter-group {
        gap: 10px;
    }

    .filter-list {
        gap: 6px;
    }

    .filter-checkbox {
        padding: 10px 12px;
    }

    .filter-checkbox span {
        font-size: 13px;
    }

    .filter-checkbox span small {
        font-size: 11px;
    }

    .suggestions-box {
        min-width: 110%
    }

}

/*
|--------------------------------------------------------------------------
| ANALYSIS PAGE
|--------------------------------------------------------------------------
*/

.analysis-page {
    padding: 8px 20px;
}

.analysis-container {
    flex: 1;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 13px;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: .2s;
}

.breadcrumb a:hover {
    color: #000000;
}

.breadcrumb .separator {
    color: #bbb;
}

.breadcrumb .current {
    color: #0c2340ba;
    font-weight: 500;
}

.analysis-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: 40px;
    margin-bottom: 30px;
}

.hero-left {
    flex: 1;
}

.hero-title-row {
    display: flex;
    align-items: center;
    gap: 15px;

    margin-bottom: 20px;
}

.hero-title-row h1 {
    margin: 0;
    font-size: 2.5rem;
    line-height: 1.1;
}

.hero-badge {
    background: #eef4ff;
    color: #2952cc;

    padding: 8px 14px;
    border-radius: 999px;

    font-size: 14px;
    font-weight: 600;
}

.hero-meta-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 42px;
}

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

.hero-info i {
    font-size: 18px;
    color: #667085;
}

.hero-info span {
    color: #667085;
    font-size: 14px;
}

.hero-info strong {
    color: #111827;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.hero-action-btn {
    width: 82px;
    height: 82px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;

    border: 1px solid #e5e7eb;
    border-radius: 18px;

    background: #fff;

    cursor: pointer;

    transition: all .2s ease;
}

.hero-action-btn:hover {
    transform: translateY(-2px);

    box-shadow: 0 8px 20px rgba(0,0,0,.08);

    border-color: #d1d5db;
}

.hero-action-btn i {
    font-size: 20px;
    color: #111827;
}

.hero-action-btn span {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.analysis-carousel {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.analysis-carousel::-webkit-scrollbar {
    height: 6px;
}

.analysis-carousel::-webkit-scrollbar-thumb {
    background: #aeaeb1;
    border-radius: 20px;
}

.carousel-item {
    flex: 0 0 auto;
    width: 100%;
    scroll-snap-align: start;
}

.carousel-item img {
    width: 100%;
    border-radius: 14px;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/*
|------------------------------------------------------------------
| GRID
|------------------------------------------------------------------
*/

.viewer-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(500px, 1fr));

    gap: 25px;

    margin-bottom: 30px;
}

/*
|--------------------------------------------------------------------------
| SYNCHRONIZED VIEWER
|--------------------------------------------------------------------------
*/

.sentence-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.sentence-nav-btn {
    padding: 6px 10px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 6px;
}

.sentence-nav-btn.active {
    background: #222;
    color: white;
    border-color: #222;
}

/*
|--------------------------------------------------------------------------
| STACK LAYOUT
|--------------------------------------------------------------------------
*/

.viewer-stack {

    display: flex;
    flex-direction: column;
    gap: 32px;
}

/*
|--------------------------------------------------------------------------
| BLOCK
|--------------------------------------------------------------------------
*/

.viewer-block {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.155);
}

.viewer-block.active {
    background: #1f1f1f;
    box-shadow: 0 0 0 2px #4a90e2 inset;
}

.viewer-block h3 {
    font-size: 1.4rem;
    text-align: center;
    color: #0c2340;
    margin: auto 0;
}

/* =========================
   SUB-VIEWER TITLE
========================= */

.sub-viewer-title {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 8px;
}

.sub-viewer-title h4 {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #0c2340;
    margin: 0;
}

.sub-viewer-title .fullscreen-btn {
    border: none;
    background: #ffffff;
    color: #151f54;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.sub-viewer-title .fullscreen-btn:hover {
    opacity: 0.8;
    background: #151f54;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sub-viewer-title .fullscreen-btn:active {
    transform: translateY(0);
}

.sub-viewer {
    margin-bottom: 28px;
}

.sub-viewer:last-child {
    margin-bottom: 0;
}

/*
|--------------------------------------------------------------------------
| IMAGE
|--------------------------------------------------------------------------
*/

.viewer-block img {
    width: 100%;
    height: 260px;

    object-fit: contain;

    border-radius: 8px;

    display: block;

    max-width: 100%;
    overflow: hidden;
}

.image-wrapper {
    width: 100%;
    height: 260px;
    position: relative;
    overflow: hidden;
}

.image-wrapper img {
    display: block;
    width: 100%;
}

.empty-image {
    width: 100%;
    height: 100%;

    display: none;

    align-items: center;
    justify-content: center;

    background: #f8fafc;
    border: 2px dashed #d1d5db;
    border-radius: 10px;

    color: #94a3b8;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
}

/*
|--------------------------------------------------------------------------
| CONTROLS
|--------------------------------------------------------------------------
*/

.viewer-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.viewer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #0c2340;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.viewer-btn:hover {
    transform: translateY(-2px);
    border-color: #0c2340;
    box-shadow: 0 10px 24px rgba(12,35,64,.12);
}

.viewer-btn i {
    font-size: 13px;
}

.sentence-counter {
    min-width: 180px;
    background: #ecf2ffda;
    text-align: center;
    padding: 14px 20px;
    border-radius: 999px;
    border: 1px solid #b4cdff;
    font-size: 15px;
    font-weight: 700;
    color: #343435;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.sync-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-left: 12px;
}

.ios-switch {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 32px;
}

.ios-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #ffa11d;  /* ✅ Orange par défaut (OFF) */
    border-radius: 999px;
    transition: 0.3s;
}

.slider::before {
    content: '';
    position: absolute;
    height: 26px;
    width: 26px;
    left: 3px;
    top: 3px;
    background: rgb(255, 255, 255);
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ✅ Quand checked : vert */
input:checked + .slider {
    background: #34c759;
}

input:checked + .slider::before {
    transform: translateX(26px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: #323232;
    transition: all 0.3s ease;
}

/* ─── Loop Button ─────────────────────────────────────── */

.loop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;

    border: 1.6px solid #e5e7eb;
    border-radius: 50%;

    background: #ffffff;
    color: #667085;

    cursor: pointer;
    font-size: 16px;

    transition: all 0.25s ease;
}

.loop-btn:hover {
    transform: translateY(-2px);
    border-color: #667085;
    color: #667085;
}

/* ✅ État actif (loopSentence = true) */
.loop-btn.active {
    background: #3cbc69;
    color: white;
    border-color: #3cbc69;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.104)
}

.loop-btn.active:hover {
    background: #34a853;
    border-color: #34a853;
}

/* Animation de rotation continue quand actif */
.loop-btn.active i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/*
|--------------------------------------------------------------------------
| HERO ACTIONS
|--------------------------------------------------------------------------
*/

.hero-actions {

    display: flex;

    gap: 15px;
}

.hero-btn {

    border: none;

    background: white;

    padding:
        15px 24px;

    border-radius: 16px;

    cursor: pointer;

    font-weight: 600;

    display: flex;

    align-items: center;

    gap: 10px;

    transition: 0.25s ease;

    box-shadow:
        0 10px 25px rgba(0,0,0,0.05);
}

.hero-btn:hover {

    transform:
        translateY(-2px);

    background: #0c2340;

    color: white;
}

.card-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 30px;
}

.card-header h2 {

    font-size: 30px;

    color: #0c2340;

    margin-bottom: 8px;
}

.card-header p {

    color: #7f7f7f;
}

/*
|--------------------------------------------------------------------------
| AUDIO
|--------------------------------------------------------------------------
*/

.audio-top {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 22px;
}

.audio-top h3 {

    font-size: 24px;

    margin-bottom: 8px;
}

.audio-top span {

    color: #7f7f7f;
}

audio {

    width: 100%;
}

.midi-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin: 15px 0;
    border-radius: 8px;
}
 
.midi-btn {
    padding: 12px 40px;
    color: #0c2340;
    background: #edf6ff;
    border: 0.25px solid #0c234057;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.midi-btn:hover {
    background: rgb(133, 192, 255);
    transform: translateY(-1px);
}

.midi-btn:active {
    transform: translateY(0);
}

.midi-btn.stop-btn {
    background: #dc3546cf;
}

.midi-btn.stop-btn:hover {
    background: #c82333;
}

.midi-btn.play-btn {
    background: #3eb357;
}

.midi-btn.play-btn:hover {
    background: #1d9a38;
}

@media (max-width: 768px) {
    .midi-controls {
        flex-direction: column;
    }
    .midi-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Audio player */

.audio-card {
    padding: 4px;
}

/* Bouton flottant Play/Pause */
.floating-play-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #2f6cae;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(13, 79, 214, 0.3);
}

.floating-play-btn.show {
    display: flex;
}

.floating-play-btn.playing {
    background: #22b455;
}

.floating-play-btn:hover {
    background: #ff7a3d;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .floating-play-btn {
        width: 55px;
        height: 55px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}

/*
|--------------------------------------------------------------------------
| OVERVIEW
|--------------------------------------------------------------------------
*/

.overview-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 22px;
}

.overview-item {

    background: #f7f8fb;

    border-radius: 20px;

    padding: 25px;
}

.overview-item span {

    display: block;

    color: #7f7f7f;

    margin-bottom: 10px;
}

.overview-item strong {

    font-size: 36px;

    color: #0c2340;
}

/* ─── Timing bar  ─────────────────────────────────────── */

.timing-info {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 20px;
    position: relative;
}

.timing-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.timing-track {
    height: 8px;
    display: flex;
    gap: 6px;
    background: transparent;
}

/* BASE SEGMENT */
.timing-segment {
    flex: 1;
    background: #d9d9d9;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* PROGRESSION INTERNE */
.timing-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: #3cbc69;
    transition: width 0.08s linear;
}

/* ✅ SEGMENT LU (PLAYED) */
.timing-segment.played {
    background: #a8d5a8;
}

.timing-segment.played .timing-fill {
    width: 100% !important;
    background: #3cbc69;
}

/* ✅ SEGMENT ACTIF (ACTIVE) */
.timing-segment.active {
    background: #ebffed;
    box-shadow: 0 0 0 1.6px rgba(60, 188, 105, 0.668) inset;
}

.timing-segment.active .timing-fill {
    background: #3cbc69;
}

/* HOVER */
.timing-segment:hover {
    background: #3cbc69;
}

/* ─── Sentence Indicator ─────────────────────────────────── */

.sentence-timing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
}

.sentence-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: #323232;
}

.indicator-label {
    color: #0c2340;
}

.current-sentence {
    color: #0c2340;
    font-weight: 600;
}

.timing-start-time,
.timing-end-time {
    color: #44484f;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.timing-separator,
.timing-separator-dash {
    color: #7a7b7d;
    font-weight: 500;
}

.timing-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    font-size: 17px;
    font-weight: 500;
    color: #4d5769;
}

.timing-label {
    font-weight: 600;
    color: #0c2340;
}

.timing-duration strong {
    font-weight: 500;
    color: #1e8944;
}

/*
|--------------------------------------------------------------------------
| Carousel
|--------------------------------------------------------------------------
*/

.mini-carousel {
    display: grid;
    grid-template-columns: 50px 1fr 50px;

    align-items: center;
    gap: 15px;

    min-height: 260px;
}

.carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border: 1.6px solid #e5e7eb;
    border-radius: 50%;
    background: #f4f4f5e9;
    color: #5e5e5f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: #153154;
    color: white;
}

.mini-carousel img {
    max-width: 100%;
    border-radius: 8px;
}

/*
|--------------------------------------------------------------------------
| SECTIONS
|--------------------------------------------------------------------------
*/

.analysis-section {
    margin-bottom: 40px;
}

.section-header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 35px;
}

.section-header h2 {

    font-size: 40px;

    color: #0c2340;
}

.section-header span {

    background: white;

    padding:
        10px 18px;

    border-radius: 999px;

    box-shadow:
        0 8px 20px rgba(0,0,0,0.05);

    color: #444;
}

/*
|--------------------------------------------------------------------------
| SUBSECTION
|--------------------------------------------------------------------------
*/

.analysis-subsection {

    margin-bottom: 50px;
}

.analysis-subtitle {

    font-size: 22px;

    margin-bottom: 25px;

    color: #0c2340;
}

/*
|--------------------------------------------------------------------------
| GALLERY
|--------------------------------------------------------------------------
*/

.analysis-gallery {

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(340px, 1fr));

    gap: 28px;
}

.gallery-card {

    background: white;

    border-radius: 24px;

    overflow: hidden;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.06);

    transition: 0.3s ease;
}

.gallery-card:hover {

    transform:
        translateY(-5px);
}

.gallery-card img {

    max-width: 800px;

    display: block;
}

/*
|--------------------------------------------------------------------------
| RESPONSIVE
|--------------------------------------------------------------------------
*/

@media(max-width:1200px){

    .analysis-hero {

        flex-direction: column;
    }

    .hero-actions {

        width: 100%;
    }
}

@media(max-width:768px){

    .analysis-page {

        padding-top: 30px;
    }

    .analysis-hero h1 {

        font-size: 38px;
    }

    .section-header {

        flex-direction: column;

        align-items: flex-start;

        gap: 15px;
    }

    .section-header h2 {

        font-size: 32px;
    }

    .analysis-gallery {

        grid-template-columns: 1fr;
    }

    .timeline {

        flex-direction: column;
    }

    .timeline-item {

        width: 100%;
    }

    .card-header {

        flex-direction: column;

        align-items: flex-start;

        gap: 12px;
    }
}

@media(max-width:768px){

    .viewer-block {

        padding: 12px;
    }

    .hero-title-row h1 {
        font-size: 20px;
    }

    .viewer-block h3 {

        font-size: 16px;
    }

    .viewer-btn {

        width: 100%;
    }
}

/*
|------------------------------------------------------------------
| HISTO CAROUSEL
|------------------------------------------------------------------
*/

.analysis-carousel {

    display: flex;

    gap: 20px;

    overflow-x: auto;

    padding-bottom: 10px;

    scroll-snap-type: x mandatory;
}

.analysis-carousel::-webkit-scrollbar {

    height: 8px;

}

.analysis-carousel::-webkit-scrollbar-thumb {

    background: #b7bcc7;

    border-radius: 999px;
}

.carousel-item {

    flex: 0 0 auto;

    width: 700px;

    scroll-snap-align: start;
}

.carousel-item img {

    width: 100%;

    border-radius: 18px;

    display: block;

    box-shadow:
        0 10px 30px rgba(0,0,0,0.15);
}

/*
|------------------------------------------------------------------
| RESPONSIVE
|------------------------------------------------------------------
*/

@media(max-width:1200px){

    .viewer-grid {

        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .filters-sidebar {
        display: none;
    }

    .results-layout {
        grid-template-columns: 1fr;
        margin: 0 16px;
    }

    .results-list {
        width: 100%;
    }
}

@media (max-width: 900px) {
    
    .result-card {
        flex-direction: column;
        align-items: flex-center;
    }
    
    .result-image {

        width: 100%;
    }

    .result-title {
        font-size: 16px;
    }
}

/* =========================
   FILTER SIDEBAR
========================= */

.filters-sidebar {
  background: #fff;
  border: 1px solid #e6eaf2;
  border-radius: 18px;
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

.filters-sidebar h3 {
  margin-bottom: 24px;
  font-size: 1.15rem;
  color: #16253f;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* GROUP */
.filter-group {
  margin-bottom: 26px;
}

/* TITLE */
.filter-group-title {
  display: flex;
  align-items: center;
  gap: 10px;

  font-weight: 700;
  font-size: 0.95rem;
  color: #1f2f4d;

  margin-bottom: 14px;
  padding-bottom: 8px;

  border-bottom: 1px solid #eef2f7;
}

.filter-group-title i {
  color: #6b7cff;
  font-size: 0.95rem;
}

/* LIST */
.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filter-list li {
  margin: 4px 0;
}

/* LINKS */
.filter-list li a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;

  color: #4a5568;
  text-decoration: none;

  transition: all 0.2s ease;
}

.filter-list li a:hover {
  background: #f3f6ff;
  color: #1a73e8;
  transform: translateX(3px);
}

/* =========================
   HOW TO PAGE
========================= */

.howto-page {
    padding: 60px 20px;

}

.howto-container {
    max-width: 1100px;
}

.howto-hero {
    text-align: center;
    margin-bottom: 100px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 18px;
    background: #111;
    color: #fff;
    border-radius: 999px;
    margin-bottom: 20px;
    font-size: 14px;
}

.howto-hero h1 {
    font-size: 54px;
    margin-bottom: 20px;
}

.hero-text {
    font-size: 20px;
    color: #666;
    max-width: 700px;
    margin: auto;
}

.howto-section {
    display: flex;
    gap: 40px;
    margin-bottom: 80px;
    align-items: flex-start;
}

.step-number {
    font-size: 60px;
    font-weight: bold;
    color: #1f2f4d;
    min-width: 120px;
}

.step-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.step-content p {
    color: #000000;
    line-height: 1.8;
    margin-bottom: 20px;
}

.step-content ul {
    padding-left: 20px;
}

.step-content li {
    margin-bottom: 10px;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.section-card {
    padding: 28px;
    border-radius: 20px;
    color: white;
}

.section-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.section-card p {
    color: white;
}

.noteA {
    background: #f98a29;
}

.firstB {
    background: #e7ae00;
}

.lastC {
    background: #42b514;
}

@media (max-width: 768px) {

    .howto-section {
        flex-direction: column;
    }

    .step-number {
        font-size: 40px;
    }

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

    .howto-hero h1 {
        font-size: 38px;
    }
}

/* =========================
   FOOTER
========================= */

.site-footer {
  margin-top: 60px;
  padding: 32px 32px;
  border-top: 1px solid #e4e7ee;
  text-align: center;
  color: #6b7280;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

  /* HERO */

  .hero-search {
    padding: 40px 14px;
  }

  .hero-content h2 {
    font-size: 1.4rem;
    line-height: 1.5;
  }

  .hero-content p {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 28px;
  }

  /* SEARCH */

  .search-icon {
    display: none;
  }

  .search-form {

    flex-direction: row;
    align-items: center;
    border-radius: 18px;
  }

  .search-input-wrapper {
    
    width: 100%;
  }

  .search-input {

    width: 100%;
    padding: 14px 14px;
    font-size: 0.95rem;
    text-align: center;
  }

  .clear-search {
    display: none;
  }

  .search-button {
    width: 52px;
    min-width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 14px;
  }

  .search-button span {
    display: none;
  }

  /* SEARCH EXAMPLES */

  .search-examples {
    margin-top: 20px;
    gap: 10px;
  }

  .search-examples a {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .header-right {
        display: none;
    }

    .mobile-menu {
        position: fixed;
        top: 78px;
        left: 0;
        right: 0;
    }

    .site-header {
        padding: 12px 16px;
    }

    .logo {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .hamburger-btn span {
        width: 20px;
        height: 2px;
    }

    .mobile-menu {
        top: 70px;
        padding: 16px;
    }

    .mobile-menu-link {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* =========================
   TABLET
========================= */

@media (max-width: 900px) {

  .site-header {

    padding: 14px 20px;
  }

  .logo {

    width: 180px;
  }

  .header-right {

    gap: 12px;
  }

  .language-switcher button {

    padding: 9px 14px;
    font-size: 0.92rem;
  }

  .top-nav a {

    font-size: 0.9rem;
  }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 640px) {

  .site-header {

    flex-direction: row;

    justify-content: space-between;

    align-items: center;

    padding: 14px 16px;
  }

  .logo {

    width: 150px;
  }

  .header-right {

    width: 100%;

    justify-content: space-between;

    align-items: center;

    gap: 10px;
  }

  .language-switcher {

    flex: 1;
    max-width: 150px;
  }

  .language-switcher button {

    flex: 1;
    padding: 10px 0;
    font-size: 0.8rem;
  }

  .top-nav a {
    font-size: 0.8rem;
    white-space: nowrap;
    padding: 10px;
  }
}

/* =========================
   VERY SMALL MOBILE
========================= */

@media (max-width: 768px) {

  .site-header {

    flex-direction: row;

    justify-content: space-between;

    align-items: center;

    padding: 12px 14px;

    gap: 10px;
  }

  .logo {

    width: 150px;
  }

  .header-right {

    display: flex;

    flex-direction: row;

    align-items: center;

    justify-content: flex-end;

    gap: 8px;

    width: auto;
  }

  .language-switcher {

    max-width: 130px;
  }

  .language-switcher button {

    padding: 8px 10px;

    font-size: 0.75rem;
  }

  .top-nav a {

    font-size: 0.8rem;
    padding: 8px;
  }

}

/* =========================
   Right-To-Left SUPPORT
========================= */

body.rtl {
  direction: rtl;
}

/* optionnel: icône cachée */
body.rtl .search-icon {
  display: none;
}

@media (max-width: 768px) {
    /* Page */
    .analysis-page {
        padding: 16px 12px;
    }
    
    .analysis-container {
        width: 100%;
        padding: 12px;
        gap: 20px;
    }
    
    /* Viewer stack */
    .viewer-stack {
        gap: 20px;
    }
    
    /* Viewer block */
    .viewer-block {
        padding: 16px;
        border-radius: 12px;
    }
    
    .viewer-block h3 {
        font-size: 1;
    }

    .viewer-btn, .sentence-counter {
        display: none;
    }
    
    /* Image wrapper */
    .image-wrapper {
        height: 200px;
    }
    
    .viewer-block img {
        height: 200px;
    }
    
    /* Mini carousel */
    .mini-carousel {
        grid-template-columns: 40px 1fr 40px;
        gap: 10px;
        min-height: 160px;
    }
    
    .carousel-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    /* Timing info */
    .timing-info {
        margin: 12px 0;
    }
    
    .timing-bar {
        gap: 3px;
    }
    
    .timing-track {
        height: 6px;
        gap: 4px;
    }
    
    .sentence-timing-container {
        gap: 8px;
        margin-top: 16px;
    }
    
    .sentence-indicator {
        font-size: 14px;
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .timing-display {
        font-size: 14px;
        gap: 6px;
    }
    
    /* Overview grid */
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .overview-item {
        padding: 16px;
    }
    
    /* Analysis gallery */
    .analysis-gallery {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .gallery-card {
        border-radius: 12px;
        overflow: hidden;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 11px;
        margin-bottom: 16px;
    }
    
    /* Hero section */
    .analysis-hero {
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .hero-title-row h1 {
        font-size: 1.5rem;
    }
    
    .hero-meta-inline {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .analysis-page {
        padding: 12px 8px;
    }
    
    .analysis-container {
        padding: 8px;
        gap: 16px;
    }
    
    .viewer-block {
        padding: 12px;
    }
    
    .viewer-block h3 {
        font-size: 1rem;
    }
    
    .image-wrapper {
        height: 140px;
    }
    
    .viewer-block img {
        height: 120px;
    }
    
    .hero-title-row h1 {
        font-size: 1.2rem;
    }
}