/* CSS pour la page Liens Généalogiques - Système Simplifié */
/* Harmonisé avec le style global du site Niegle */

/* ========================================
   VARIABLES HARMONISÉES
======================================== */

:root {
  --links-primary: #a76107;
  --links-secondary: #d4822a;
  --links-accent: #f4a261;
  --links-bg: #f8fafc;
  --links-card-bg: #ffffff;
  --links-text: #333333;
  --links-text-light: #4a5568;
  --links-border: #e2e8f0;
  --links-shadow: rgba(167, 97, 7, 0.1);
}

/* Variables pour le thème sombre */
:root.theme-dark {
  --links-primary: #f4a261;
  --links-secondary: #d4822a;
  --links-accent: #a76107;
  --links-bg: var(--bg-page);
  --links-card-bg: var(--bg-main);
  --links-text: var(--text-color);
  --links-text-light: #a0aec0;
  --links-border: #4a5568;
  --links-shadow: rgba(244, 162, 97, 0.1);
}

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

.hero {
  position: relative;
  background: url('/mediasite/hero.webp') no-repeat center center;
  background-size: cover;
  color: white;
  padding: 4rem 0;
  text-align: center;
  border-bottom: 3px solid var(--links-primary);
  height: 300px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 0;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* ========================================
   CONTENU PRINCIPAL
======================================== */

.links-content {
  background: var(--links-bg);
  min-height: 60vh;
  padding: 3rem 0;
}

.links-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========================================
   INTRODUCTION
======================================== */

.tool-intro {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--links-card-bg);
  border-radius: 12px;
  border: 1px solid var(--links-border);
  box-shadow: 0 2px 8px var(--links-shadow);
  border-left: 4px solid var(--links-primary);
  position: relative;
  overflow: hidden;
}

.tool-intro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--links-primary), var(--links-secondary), var(--links-accent));
}

.tool-intro h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--links-text);
  margin-bottom: 1rem;
}

.tool-intro p {
  font-size: 1.1rem;
  color: var(--links-text-light);
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

/* ========================================
   OUTIL DE RECHERCHE
======================================== */

.links-tool {
  background: var(--links-card-bg);
  border-radius: 12px;
  padding: 3rem;
  box-shadow: 0 2px 8px var(--links-shadow);
  border: 1px solid var(--links-border);
  border-left: 4px solid var(--links-primary);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.links-tool::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--links-primary), var(--links-secondary), var(--links-accent));
}

/* ========================================
   ÉTAPES
======================================== */

.step-container {
  margin-bottom: 2rem;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--links-primary);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.1rem;
}

.step-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--links-text);
  margin: 0;
  flex: 1;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ========================================
   SECTION FAVORIS
======================================== */

.favorites-container {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-left: 4px solid #f59e0b;
}

.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.favorites-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--links-text);
  margin: 0;
}

.clear-favorites-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-favorites-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.favorites-selector {
  max-width: 400px;
}

/* ========================================
   SÉLECTEUR DE CATÉGORIE ET THÈME
======================================== */

.category-selector,
.theme-selector {
  max-width: 400px;
}

/* Grille des boutons de thème */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.theme-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--links-card-bg);
  border: 2px solid var(--links-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
  color: var(--links-text);
  text-align: left;
}

.theme-button:hover {
  background: var(--links-primary);
  color: white;
  border-color: var(--links-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--links-shadow);
}

.theme-button .icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.theme-button .text {
  flex: 1;
}

/* Bouton retour */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--links-card-bg);
  border: 1px solid var(--links-border);
  border-radius: 6px;
  color: var(--links-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.back-button:hover {
  background: var(--links-primary);
  color: white;
  border-color: var(--links-primary);
  transform: translateX(-2px);
}

/* Boutons d'action (signaler et proposer) */
.report-button,
.contribute-button {
  background: var(--links-secondary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.contribute-button {
  background: #10b981;
}

.report-button:hover {
  background: var(--links-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--links-shadow);
}

.contribute-button:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.report-button:active,
.contribute-button:active {
  transform: translateY(0);
}

.form-select {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--links-border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--links-card-bg);
  color: var(--links-text);
  transition: all 0.3s ease;
  font-family: "Segoe UI", Roboto, sans-serif;
}

.form-select:focus {
  outline: none;
  border-color: var(--links-primary);
  box-shadow: 0 0 0 3px var(--links-shadow);
  transform: translateY(-2px);
}

.form-select:hover {
  border-color: var(--links-secondary);
}

/* ========================================
   GRILLE DES LIENS
======================================== */

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.link-card {
  background: var(--links-card-bg);
  border: 2px solid var(--links-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--links-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.link-card:hover::before {
  transform: scaleX(1);
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px var(--links-shadow);
  border-color: var(--links-primary);
}

.link-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.link-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--links-text);
  margin: 0;
  flex: 1;
}

.favorite-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.favorite-btn:hover {
  transform: scale(1.2);
}

.favorite-btn.active {
  filter: brightness(1.2);
}

.link-description {
  font-size: 0.95rem;
  color: var(--links-text-light);
  line-height: 1.5;
  margin: 0;
}

.link-url {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--links-primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  margin-top: auto;
}

.link-url:hover {
  background: var(--links-secondary);
  transform: translateX(4px);
  box-shadow: 0 4px 12px var(--links-shadow);
}

.link-url::after {
  content: '→';
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.link-url:hover::after {
  transform: translateX(4px);
}

/* ========================================
   MESSAGE D'INFORMATION
======================================== */

.info-message {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(167, 97, 7, 0.1);
  border: 1px solid rgba(167, 97, 7, 0.2);
  border-radius: 8px;
  color: var(--links-text);
}

.info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-message p {
  margin: 0;
  font-size: 1rem;
}

/* ========================================
   DESCRIPTION DU THÈME
======================================== */

.theme-story {
  background: var(--links-card-bg);
  border-radius: 12px;
  padding: 2.5rem;
  border: 1px solid var(--links-border);
  border-left: 4px solid var(--links-primary);
  box-shadow: 0 2px 8px var(--links-shadow);
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
}

.theme-story::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--links-primary), var(--links-secondary), var(--links-accent));
}

.theme-story h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--links-text);
  margin-bottom: 1.5rem;
  text-align: center;
}

.story-content {
  font-size: 1rem;
  color: var(--links-text);
  line-height: 1.7;
  text-align: justify;
}

.story-content p {
  margin-bottom: 1rem;
}

.story-content p:last-child {
  margin-bottom: 0;
}

.story-highlight {
  color: var(--links-primary);
  font-weight: 600;
}

/* ========================================
   THÈME SOMBRE
======================================== */

:root.theme-dark .links-content {
  background: var(--bg-page);
}

:root.theme-dark .hero {
  border-bottom-color: var(--links-primary);
}

:root.theme-dark .tool-intro,
:root.theme-dark .links-tool,
:root.theme-dark .theme-story {
  background: var(--bg-main);
  border-color: var(--links-border);
}

:root.theme-dark .form-select,
:root.theme-dark .link-card {
  background: var(--bg-main);
  border-color: var(--links-border);
  color: var(--text-color);
}

:root.theme-dark .form-select:focus {
  border-color: var(--links-primary);
}

:root.theme-dark .link-card:hover {
  border-color: var(--links-primary);
}

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

@media (max-width: 768px) {
  .hero {
    padding: 3rem 0;
    height: 250px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .tool-intro {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }

  .tool-intro h2 {
    font-size: 1.5rem;
  }

  .tool-intro p {
    font-size: 1rem;
  }

  .links-tool {
    padding: 2rem 1.5rem;
  }

  .step-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .header-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .report-button,
  .contribute-button {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
  }

  .themes-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .links-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .link-card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .links-container {
    padding: 0 0.75rem;
  }

  .tool-intro {
    padding: 1rem;
  }

  .tool-intro h2 {
    font-size: 1.3rem;
  }

  .links-tool {
    padding: 1.5rem 1rem;
  }

  .step-number {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .step-header h3 {
    font-size: 1.1rem;
  }

  .form-select {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
  }

  .link-card {
    padding: 1rem;
  }

  .link-title {
    font-size: 1.1rem;
  }
}

/* ========================================
   SECTIONS SEO
======================================== */

.seo-content {
  background: var(--links-bg);
  padding: 4rem 0;
  border-top: 1px solid var(--links-border);
}

.faq-section,
.themes-section {
  background: var(--links-card-bg);
  border-radius: 12px;
  padding: 3rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 8px var(--links-shadow);
  border: 1px solid var(--links-border);
  border-left: 4px solid var(--links-primary);
  position: relative;
  overflow: hidden;
}

.faq-section::before,
.themes-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--links-primary), var(--links-secondary), var(--links-accent));
}

.faq-section h2,
.themes-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--links-text);
  margin-bottom: 2rem;
  text-align: center;
}

.faq-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(167, 97, 7, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--links-secondary);
}

.faq-item h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--links-primary);
  margin-bottom: 1rem;
}

.faq-item p {
  line-height: 1.6;
  color: var(--links-text);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.theme-type {
  padding: 1.5rem;
  background: rgba(167, 97, 7, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--links-accent);
}

.theme-type h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--links-primary);
  margin-bottom: 1rem;
}

.theme-type p {
  line-height: 1.6;
  color: var(--links-text);
  font-size: 0.95rem;
}

/* Responsive pour les sections SEO */
@media (max-width: 768px) {
  .seo-content {
    padding: 2rem 0;
  }

  .faq-section,
  .themes-section {
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
  }

  .faq-section h2,
  .themes-section h2 {
    font-size: 1.5rem;
  }

  .theme-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .faq-item,
  .theme-type {
    padding: 1rem;
  }
}
