
/* ==========================================================================
   LABEM - Laboratoire des Énergies et des Matériaux (LR11ES34)
   Feuille de style principale (style.css) - Unique CSS File
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES CSS & THÈME ACADÉMIQUE
   -------------------------------------------------------------------------- */
:root {
  /* Palette Principale Institutionnelle */
  --primary-color: #1e3a8a;       /* Bleu Marine Académique */
  --primary-hover: #1e40af;
  --secondary-color: #0f172a;     /* Ardoise Sombre */
  --accent-color: #0284c7;        /* Bleu Cyan Académique */
  --accent-hover: #0369a1;
  --success-color: #10b981;       /* Vert d'état / IoT connecté */
  --warning-color: #f59e0b;
  --danger-color: #ef4444;

  /* Couleurs de Fond & Surfaces */
  --bg-main: #f8fafc;             /* Gris très clair */
  --bg-card: #ffffff;             /* Blanc pur */
  --bg-alt: #f1f5f9;              /* Gris alternatif */
  --bg-dark: #0f172a;            /* Fond sombre (Hero & Footer) */

  /* Typographie & Couleurs de Texte */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --text-main: #334155;           /* Gris foncé lisible */
  --text-heading: #0f172a;        /* Titres sombres */
  --text-muted: #64748b;          /* Texte secondaire */
  --text-light: #f8fafc;          /* Texte sur fond sombre */

  /* Bordures & Ombres */
  --border-color: #e2e8f0;
  --border-radius-sm: 4px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Layout & Espacements */
  --max-width: 1200px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* --------------------------------------------------------------------------
   2. RÉINITIALISATION & BASES (RESET)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

/* --------------------------------------------------------------------------
   3. LAYOUT & CONTENEURS
   -------------------------------------------------------------------------- */
.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 15px;
}

section {
  padding: 60px 0;
}

.section-alt {
  background-color: var(--bg-alt);
}

.section-dark {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

/* --------------------------------------------------------------------------
   4. EN-TÊTE, NAVIGATION & TOP BAR
   -------------------------------------------------------------------------- */
.top-bar {
  background-color: var(--secondary-color);
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid #334155;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header {
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-badge {
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 1.25rem;
  letter-spacing: 1px;
}

.logo-text h1 {
  font-size: 1.1rem;
  color: var(--text-heading);
  font-weight: 700;
  line-height: 1.2;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 22px;
  align-items: center;
}

nav a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
  position: relative;
}

nav a:hover, nav a.active {
  color: var(--primary-color);
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-heading);
}

/* --------------------------------------------------------------------------
   5. BANNIÈRE HERO & TITRES DE PAGE
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  color: #ffffff;
  padding: 80px 0;
  position: relative;
}

.hero-content {
  max-width: 800px;
}

.hero-tag {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.15);
  color: #38bdf8;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 18px;
}

.hero p {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 32px;
}

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #ffffff;
  padding: 50px 0;
  margin-bottom: 40px;
}

.page-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.page-header p {
  color: #cbd5e1;
  font-size: 1.05rem;
  max-width: 750px;
}

/* --------------------------------------------------------------------------
   6. EN-TÊTES DE SECTION & TYPOGRAPHIE
   -------------------------------------------------------------------------- */
.section-header {
  margin-bottom: 40px;
}

.section-header span {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 4px;
}

.section-header h3 {
  font-size: 1.85rem;
  color: var(--text-heading);
}

.section-dark .section-header h3 {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   7. SYSTÈMES DE GRILLES (GRIDS)
   -------------------------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  align-items: center;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.poles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

/* --------------------------------------------------------------------------
   8. COMPOSANTS (BOUTONS, CARTES, BADGES, LISTES)
   -------------------------------------------------------------------------- */
/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  background-color: transparent;
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-outline-dark {
  border-color: var(--border-color);
  color: var(--text-heading);
  background-color: #ffffff;
}

.btn-outline-dark:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Cartes (Cards) */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.about-box {
  background-color: var(--bg-card);
  padding: 30px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.about-box h4 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.pole-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 28px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.pole-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.pole-icon {
  width: 50px;
  height: 50px;
  background-color: #e0f2fe;
  color: var(--accent-color);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.pole-card h4 {
  font-size: 1.15rem;
  color: var(--text-heading);
  margin-bottom: 10px;
}

.pole-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--border-radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-primary {
  background-color: #dbeafe;
  color: var(--primary-color);
}

.badge-accent {
  background-color: #e0f2fe;
  color: var(--accent-color);
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

/* Listes à puces académiques */
.feature-list {
  list-style: none;
  margin-top: 15px;
}

.feature-list li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

/* Stat-items */
.stats-section {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 50px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}

.stat-item h4 {
  font-size: 2.6rem;
  font-weight: 700;
  color: #38bdf8;
}

.stat-item p {
  font-size: 0.92rem;
  color: #e2e8f0;
}

/* Support & News */
.support-card {
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--border-radius-sm);
  padding: 25px;
  background-color: var(--bg-card);
}

.support-card h4 {
  color: var(--text-heading);
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.news-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 22px;
}

.news-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.news-card h4 {
  font-size: 1.05rem;
  color: var(--text-heading);
  margin-bottom: 10px;
  line-height: 1.4;
}

.news-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   9. TABLES (PUBLICATIONS JCR, THÈSES, MEMBRES)
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-card);
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  font-size: 0.92rem;
}

.table th, .table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background-color: var(--bg-alt);
  color: var(--text-heading);
  font-weight: 600;
}

.table tr:last-child td {
  border-bottom: none;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: #f8fafc;
}

.table-hover tbody tr:hover {
  background-color: #f1f5f9;
}

/* --------------------------------------------------------------------------
   10. FORMULAIRES (CONTACT & RECHERCHE)
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-heading);
}

.form-control, .form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: #ffffff;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* --------------------------------------------------------------------------
   11. PIED DE PAGE (FOOTER)
   -------------------------------------------------------------------------- */
footer {
  background-color: var(--secondary-color);
  color: #94a3b8;
  padding: 55px 0 25px 0;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: #ffffff;
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.footer-col p, .footer-col ul {
  margin-bottom: 10px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: #94a3b8;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 25px;
  text-align: center;
  font-size: 0.82rem;
  color: #64748b;
}

/* --------------------------------------------------------------------------
   12. MEDIA QUERIES (DESIGN RESPONSIVE)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .footer-grid, .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 1.9rem;
  }

  .section-header h3 {
    font-size: 1.5rem;
  }

  .top-bar .container {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    padding: 20px;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
  }

  nav ul.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}

@media (max-width: 480px) {
  section {
    padding: 40px 0;
  }
  .hero-btns {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
}
