/* ==============================
   STYLE PRINCIPAL DU SITE
   ============================== */

/* --- Structure de base --- */
body {
  font-family: "Segoe UI", sans-serif;
  background: radial-gradient(1200px 600px at 10% 10%, #eef2ff 0%, rgba(255,255,255,0) 40%),
              radial-gradient(900px 500px at 90% 20%, #dbeafe 0%, rgba(255,255,255,0) 45%),
              linear-gradient(180deg, #f7fafc 0%, #f5f7fa 100%);
  margin: 0;
  padding: 0;
  color: #222;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 900px;
  margin: auto;
  padding: 20px;
}

/* --- Barre de navigation --- */
.nav {
  position: sticky;
  top: 0;
  background: rgba(17,17,17,0.7);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  color: white;
  padding: 12px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 50;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  box-shadow: 0 6px 18px rgba(34,211,238,0.35);
}

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

.nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav a:hover {
  text-decoration: none;
  color: #7dd3fc;
}

/* --- Titres --- */
h1, h2 {
  color: #222;
  text-align: center;
}

/* --- Cartes --- */
.card {
  background: rgba(255,255,255,0.85);
  padding: 24px;
  border-radius: 18px;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.08);
}

/* --- Boutons --- */
button, .tab, .btn {
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.3s ease;
  box-shadow: 0 10px 20px rgba(99,102,241,0.25);
}

button:hover, .tab:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(99,102,241,0.28);
}

.tab {
  background: transparent;
  color: #0f172a;
  border: 1px solid rgba(99,102,241,0.25);
}

.tab.active {
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: white;
  border-color: transparent;
}

/* --- Grille --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

/* --- Images --- */
.img, .zoomable {
  width: 100%;
  border-radius: 12px;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.img:hover, .zoomable:hover {
  transform: scale(1.05);
}

/* --- Lightbox (zoom image) --- */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  cursor: zoom-out;
}

/* --- Formulaires --- */
form {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

input[type="text"], input[type="password"], input[type="file"] {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
}

input[type="submit"], button[type="submit"] {
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}

input[type="submit"]:hover, button[type="submit"]:hover {
  transform: translateY(-1px);
}

/* --- Tableau admin --- */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

th, td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #f1f1f1;
  font-weight: bold;
}

tr:hover {
  background-color: #f9f9f9;
}

/* --- Footer --- */
footer {
  text-align: center;
  margin: 40px 0 20px;
  color: #555;
}

/* --- Utilitaires de design --- */
.gradient-text {
  background: linear-gradient(90deg, #6366f1 0%, #22d3ee 50%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.muted {
  color: #64748b;
}

/* ==============================
   MODE SOMBRE
   ============================== */
body.dark {
  background-color: #1c1c1c;
  color: #ddd;
}

body.dark .card {
  background: #2a2a2a;
  box-shadow: 0 2px 8px rgba(255,255,255,0.05);
}

body.dark .nav {
  background-color: #000;
  box-shadow: 0 2px 10px rgba(255,255,255,0.05);
}

body.dark a { color: #fff; }

body.dark .tab {
  background: #333;
  color: #ddd;
  border-color: #444;
}

body.dark .tab.active {
  background: #0ea5e9;
  color: white;
}

body.dark table {
  background-color: #2b2b2b;
  color: #eee;
}

body.dark th { background-color: #3b3b3b; }
body.dark footer { color: #aaa; }