h1, h2, h3 { font-family: 'Poppins', sans-serif; }
body, p, input, button { font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

:root{
      --ec-bg: #0b1020;
      --ec-card: rgba(255,255,255,0.06);
      --ec-border: rgba(255,255,255,0.10);
      --ec-text: rgba(255,255,255,0.88);
      --ec-muted: rgba(255,255,255,0.65);
      --ec-accent: #7c3aed; /* violet */
      --ec-accent-2: #22c55e; /* vert */
}

body {
  background: radial-gradient(1200px 700px at 20% 0%, rgba(124,58,237,0.35), transparent 55%),
                  radial-gradient(900px 600px at 90% 10%, rgba(34,197,94,0.22), transparent 55%),
                  var(--ec-bg);
  color: var(--ec-text);
  min-height: 100vh;
  padding-top:100px;
  color: white;
}

#header {
  background: rgba(15, 23, 42, 0.75); /* dark glass */
  border: 1px solid rgba(124, 58, 237, 0.35); /* accent violet */
  margin: 10px;
  border-radius: 14px;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow:
    0 10px 30px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.05);

  transition:
    opacity 0.3s ease,
    background-color 0.3s ease,
    box-shadow 0.3s ease;
}


#header.scrolled {
  background: rgba(15, 23, 42, 0.6);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.08);
}


#header.scrolled:hover {
  opacity: 1;
}

/* Dropdown menus animation */
.dropdown-menu {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 12px;

  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.dropdown-item {
  color: var(--ec-text);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.dropdown-item:hover {
  background: rgba(124, 58, 237, 0.25);
  color: white;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Animate the inner wrapper instead */
.dropdown-inner {
  transform: translateY(10px);
  transition: transform 0.2s ease;
  will-change: transform;
}

.dropdown-menu.show .dropdown-inner {
  transform: translateY(0);
}

.my-btn {
  color: var(--ec-text);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--ec-border);
  border-radius: 10px;

  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.my-btn:hover {
  background: rgba(124, 58, 237, 0.25); /* violet accent */
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
  color: white;
}

/* IMPORTANT: pas de mouvement pour le dropdown toggle */
.my-btn:not(.dropdown-toggle):hover {
  transform: translateY(-1px);
}

.search-btn {
  width: 50px;              /* normal width */
  text-align: center;
  white-space: nowrap;

  transition:
    width 0.25s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;

  /* IMPORTANT */
  transform-origin: right center;
}

.search-btn:hover {
  width: 150px;             /* expanded width */
}


.rounded-pill {
  border: 1px solid var(--ec-border) !important;
  background: rgba(0,0,0,0.25) !important;
  color: var(--ec-muted) !important;

  border-radius: 999px !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);

  padding: .35rem .7rem;
  font-size: .85rem;
  font-weight: 500;

  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

/* === Cards (Glass) === */
.ec-card {
  background: var(--ec-card);
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ec-card-soft {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--ec-border);
  border-radius: 14px;
}

.ec-card-title {
  font-family: Poppins, Inter, sans-serif;
  color: rgba(255,255,255,0.92);
}

.ec-muted {
  color: var(--ec-muted);
}

/* === Feature cards === */
.ec-feature {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--ec-border);
  border-radius: 18px;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ec-feature:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  border-color: rgba(124, 58, 237, 0.35);
}

/* Petit carré icône */
.ec-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ec-border);
  background: rgba(0,0,0,0.18);
  font-size: 1.2rem;
}

/* Lien "→" dans les cartes */
.ec-link {
  color: rgba(255,255,255,0.90);
  text-decoration: none;
  font-weight: 600;
}
.ec-link:hover { text-decoration: underline; }

/* Option: un léger "glow" sur certaines cartes */
.ec-glow {
  box-shadow:
    0 20px 60px rgba(0,0,0,0.35),
    0 0 0 1px rgba(124, 58, 237, 0.12),
    0 0 40px rgba(124, 58, 237, 0.12);
}

/* Search bar */
/* === Central search box === */
.search-box {
  max-width: 720px;
  width: 100%;
  height: 64px;

  display: flex;
  align-items: center;
  gap: 0.75rem;

  padding: 0 0.75rem 0 1rem;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 18px;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  box-shadow: 0 20px 60px rgba(0,0,0,0.35);

}

/* icon */
.search-box-icon {
  font-size: 1.25rem;
  opacity: 0.8;
}

/* input */
.search-box-input {
  flex: 1;
  height: 100%;

  background: transparent;
  border: none;
  outline: none;

  color: var(--ec-text);
  font-size: 1.05rem;
}

/* placeholder */
.search-box-input::placeholder {
  color: var(--ec-muted);
}

/* button */
.search-box-btn {
  background: linear-gradient(135deg, var(--ec-accent), #4f46e5);
  border: none;
  color: white;

  height: 44px;
  padding: 0 1.25rem;
  border-radius: 12px;

  font-weight: 600;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.search-box-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

#search {
  margin-top: 0px;
  margin-bottom: 40px;
}

/* Styles pour pagination de recherche */
.ec-description-truncate {
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Nombre de lignes maximum avant le "..." */
  line-clamp: 3;
  -webkit-box-orient: vertical;  
  overflow: hidden;
  text-overflow: ellipsis;
  
  /* Hauteur fixe pour que les cartes soient identiques même si une description ne fait qu'une ligne */
  min-height: 4.5em; 
  line-height: 1.5em;
}

.active-page {
    background: var(--ec-accent) !important;
    border-color: var(--ec-accent) !important;
    color: white !important;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
}

/* Styles pour les reviews de cours */
.text-warning {
    color: #f1c40f !important; /* Jaune doré pour les étoiles */
    letter-spacing: 2px;
}

#reviews-container .ec-card-soft {
    transition: transform 0.2s ease;
}

#reviews-container .ec-card-soft:hover {
    background: rgba(255, 255, 255, 0.08);
}

.bg-black-25 {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.text-xs {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg-success {
    background-color: #28a745 !important; /* Vert */
    color: white !important;
}

.bg-danger {
    background-color: #dc3545 !important; /* Rouge */
    color: white !important;
}

/* Style pour l'état par défaut ou inconnu */
.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

/* Style pour les badges de sentiment */
.badge.bg-dark {
    font-size: 0.7rem;
    padding: 0.4em 0.8em;
    text-transform: capitalize;
}

/* Barre latérale de score (statique) */
.vote-sidebar {
    background: rgba(0, 0, 0, 0.2); /* Fond légèrement plus sombre */
    width: 45px;
    min-width: 45px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.vote-arrow {
    color: var(--ec-muted);
    font-size: 0.9rem;
    user-select: none; /* Empêche de sélectionner les flèches comme du texte */
}

.vote-count {
    font-size: 0.85rem;
    color: var(--ec-text);
}

.bg-black-25 {
    background: rgba(255, 255, 255, 0.05);
}

.text-xs {
    font-size: 0.7rem;
}

#logo {
    text-decoration: none;
    color: white;
}

#fav-btn {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fav-btn:active {
    transform: scale(1.4); /* Effet de rebond au clic */
}

/* Force l'alignement des colonnes d'horaires */
#schedules-container table {
    table-layout: fixed; 
    width: 100%;
}

#schedules-container th:nth-child(1), 
#schedules-container td:nth-child(1) {
    width: 150px; /* Largeur pour TYPE (TH, TP, Intra...) */
}

#schedules-container th:nth-child(2), 
#schedules-container td:nth-child(2) {
    width: 150px; /* Largeur pour JOUR */
}

#schedules-container th:nth-child(3), 
#schedules-container td:nth-child(3) {
    width: 150px; /* Largeur pour HEURE */
}

/* Style pour la ligne d'examen dans le tableau */
.exam-row {
    background: rgba(255, 193, 7, 0.08); 
    border-left: 3px solid #ffc107 !important; 
    transition: background 0.3s ease;
}

.exam-row:hover {
    background: rgba(255, 193, 7, 0.15);
}

.text-warning {
    color: #ffc107 !important;
}

/* Style épuré pour le tableau de comparaison */
#compare-result table {
    border-collapse: collapse;
    width: 100%;
    background: transparent; /* Supprime les fonds de cellule par défaut */
}

/* En-tête : Bordure violette fine en bas uniquement */
#compare-table-head th {
    color: #ffffff !important;
    font-weight: 600;
    text-transform: none;
    padding: 1rem 0.5rem;
    border-bottom: 2px solid var(--ec-accent) !important; /* Ligne d'accentuation */
    border-top: none;
}

/* Lignes du corps : Bordure fine grise entre les lignes */
#compare-table-body td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; /* Ligne fine comme image 2 */
    border-top: none;
    vertical-align: middle;
}

/* Supprime la bordure de la dernière ligne */
#compare-table-body tr:last-child td {
    border-bottom: none !important;
}

/* Alignement spécifique pour ressembler à l'image 2 */
#compare-table-body td:first-child {
    font-weight: 600;
    color: #ffffff; /* Le critère doit être bien visible */
}

#compare-table-body td {
    color: var(--ec-text);
}

.spinner-border.text-primary {
    color: var(--ec-accent) !important;
}

/* Animation pour l'apparition du résultat */
#compare-result:not(.d-none) {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#summary-cards-container:empty {
    display: none !important;
}

/* Style pour les cartes de résumé qui seront injectées */
.summary-card-inner {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ec-border);
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
}