/* =============================================
   AL HANDASSA DZ — Page TD & Exercices
   ============================================= */

/* ── Hero ── */
.td-hero {
  background: linear-gradient(135deg, #1B3A6B 0%, #0D2144 100%);
  padding: 72px 0 52px;
  position: relative;
  overflow: hidden;
}
.td-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.td-hero-inner {
  max-width: 680px;
}
.td-hero-label {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .6px;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}
.td-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 14px;
  line-height: 1.15;
}
.td-hero h1 span { color: #60A5FA; }
.td-hero p {
  color: rgba(255,255,255,.72);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 28px;
}
.td-hero-stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.td-stat { color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 600; }
.td-stat span { color: #60A5FA; font-size: 1.2rem; font-weight: 900; }
.td-stat-sep { color: rgba(255,255,255,.3); font-size: 1.2rem; }

/* ── Barre filtres ── */
.td-filters-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 60px;
  z-index: 90;
  padding: 0;
}
.td-filters-bar .container {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 0;
  padding-bottom: 0;
}
.td-filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0;
  flex: 1;
  scrollbar-width: none;
}
.td-filter-scroll::-webkit-scrollbar { display: none; }
.td-filter-btn {
  white-space: nowrap;
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: transparent;
  color: #374151;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}
.td-filter-btn:hover { border-color: #1B3A6B; color: #1B3A6B; background: #EFF6FF; }
.td-filter-btn.active { background: #1B3A6B; border-color: #1B3A6B; color: #fff; }
.td-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  padding: 7px 14px;
  min-width: 220px;
}
.td-search-wrap i { color: #9ca3af; font-size: .85rem; }
.td-search-wrap input {
  border: none;
  background: transparent;
  outline: none;
  font-size: .9rem;
  color: #111;
  width: 100%;
  font-family: inherit;
}

/* ── Main ── */
.td-main { padding: 40px 0 80px; }

/* ── Skeleton ── */
.td-skeleton-wrap { display: flex; flex-direction: column; gap: 40px; }
.td-skel-section { display: flex; flex-direction: column; gap: 16px; }
.td-skel-block { background: #e5e7eb; border-radius: 8px; animation: td-pulse 1.5s ease-in-out infinite; }
.td-skel-title { height: 28px; width: 220px; }
.td-skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.td-skel-card { height: 160px; border-radius: 12px; }
@keyframes td-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .45; }
}

/* ── Section thème ── */
.td-theme-section { margin-bottom: 52px; }
.td-theme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e5e7eb;
}
.td-theme-title-block { display: flex; align-items: center; gap: 12px; }
.td-theme-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.td-theme-title { font-size: 1.25rem; font-weight: 800; color: #111827; margin: 0; }
.td-theme-sub   { font-size: .82rem; color: #6b7280; margin: 2px 0 0; }
.td-theme-count {
  background: #f3f4f6;
  color: #374151;
  font-size: .8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ── Grille cartes ── */
.td-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

/* ── Carte TD ── */
.td-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.td-card:hover {
  box-shadow: 0 8px 32px rgba(27,58,107,.12);
  border-color: #bfdbfe;
  transform: translateY(-2px);
}

/* Bande couleur top */
.td-card-stripe {
  height: 5px;
  width: 100%;
}

.td-card-body {
  padding: 18px 18px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.td-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.td-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.td-badge {
  font-size: .72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .4px;
}
.td-badge-type  { background: #EFF6FF; color: #1B3A6B; }
.td-badge-enonce  { background: #DBEAFE; color: #1e40af; }
.td-badge-corrige { background: #DCFCE7; color: #15803d; }
.td-badge-niveau  { background: #f3f4f6; color: #374151; }
.td-badge-gratuit { background: #DCFCE7; color: #166534; }

.td-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.4;
}
.td-card-desc {
  font-size: .85rem;
  color: #6b7280;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.td-card-footer {
  padding: 12px 18px 14px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.td-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  color: #9ca3af;
}
.td-card-meta i { font-size: .75rem; }
.td-card-actions { display: flex; gap: 8px; }
.td-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all .15s;
  font-family: inherit;
}
.td-btn-primary {
  background: #1B3A6B;
  color: #fff;
}
.td-btn-primary:hover { background: #0D2144; }
.td-btn-outline {
  background: transparent;
  color: #1B3A6B;
  border: 1.5px solid #1B3A6B;
}
.td-btn-outline:hover { background: #EFF6FF; }

/* ── Vide ── */
.td-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
}
.td-empty-icon { font-size: 3rem; }
.td-empty h3 { font-size: 1.3rem; color: #374151; margin: 0; }
.td-empty p  { color: #6b7280; margin: 0; }

/* ── Footer ── */
.td-footer {
  background: #0D2144;
  color: #fff;
  padding: 40px 0 20px;
}
.td-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.td-footer-logo {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 8px;
}
.td-footer-logo span { color: #60A5FA; }
.td-footer-desc { color: rgba(255,255,255,.55); font-size: .85rem; max-width: 280px; }
.td-footer-links { display: flex; flex-direction: column; gap: 8px; }
.td-footer-links a { color: rgba(255,255,255,.7); font-size: .85rem; text-decoration: none; }
.td-footer-links a:hover { color: #fff; }
.td-footer-copy { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; color: rgba(255,255,255,.4); font-size: .8rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .td-filters-bar .container { flex-direction: column; align-items: stretch; padding: 10px 16px; }
  .td-search-wrap { min-width: unset; }
  .td-cards-grid  { grid-template-columns: 1fr; }
}
