/* === RESET & VARIABLES === */
:root {
  --primary: #2563eb; /* Bleu principal */
  --primary-dark: #1e40af;
  --secondary: #f97316; /* Orange accent */
  --bg: #f9fafb;
  --text: #1f2937;
  --light: #ffffff;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === BODY === */
body {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* === HEADER === */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--light);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  font-size: 1.6em;
  letter-spacing: 0.5px;
}

nav a {
  color: var(--light);
  text-decoration: none;
  margin-left: 20px;
  font-weight: 500;
  transition: opacity 0.3s;
}

nav a:hover {
  opacity: 0.8;
}

/* === CONTAINER === */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

/* === TITRES === */
h1, h2 {
  margin-bottom: 20px;
  color: var(--primary-dark);
  font-weight: 600;
}

/* === GRILLE DE LIVRES === */
.livres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 25px;
}

.livre-card {
  background-color: var(--light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.livre-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.livre-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.livre-card:hover img {
  transform: scale(1.05);
}

.livre-content {
  padding: 15px;
  flex-grow: 1;
}

.livre-card h3 {
  font-size: 1.1em;
  margin-bottom: 10px;
  color: var(--text);
}

.livre-card p {
  font-size: 0.9em;
  color: #555;
  margin-bottom: 10px;
  height: 45px;
  overflow: hidden;
}

/* === BOUTONS === */
button,
input[type="submit"] {
  background: var(--primary);
  color: var(--light);
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.1s ease;
}

button:hover,
input[type="submit"]:hover {
  background: var(--primary-dark);
  transform: scale(1.03);
}

.btn-secondary {
  background: var(--secondary);
}

.btn-secondary:hover {
  background: #c2410c;
}

/* === FORMULAIRES === */
form {
  background: var(--light);
  padding: 25px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border 0.2s;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  outline: none;
}

/* === TABLES (Admin, Panier, Commandes) === */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--light);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

th, td {
  padding: 12px 15px;
  text-align: left;
}

th {
  background-color: var(--primary);
  color: var(--light);
}

tr:nth-child(even) {
  background-color: #f3f4f6;
}

tr:hover {
  background-color: #e0e7ff;
}

/* === FOOTER === */
footer {
  text-align: center;
  background: var(--primary-dark);
  color: var(--light);
  padding: 20px;
  margin-top: 50px;
  box-shadow: var(--shadow);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    margin-top: 10px;
  }

  .livre-card img {
    height: 220px;
  }
}
/* === HEADER MODERNE === */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--light);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* === LOGO === */
.logo h1 {
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 15px;
  cursor: pointer;
  transition: transform 0.2s ease;
  color: #ffcc00;
}

.logo h1:hover {
  transform: scale(1.5);
}

/* === NAVIGATION === */
nav {
  display: flex;
  gap: 25px;
  align-items: center;
}

nav a {
  position: relative;
  color: var(--light);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 0;
  transition: color 0.3s ease;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background: var(--secondary);
  transition: width 0.3s ease;
}

nav a:hover {
  color: #fff;
}

nav a:hover::after {
  width: 100%;
}

/* === BOUTON BURGER (MOBILE) === */
.menu-toggle {
  display: none;
  font-size: 1.8em;
  cursor: pointer;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  nav {
    position: absolute;
    top: 65px;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    align-items: flex-start;
    width: 200px;
    padding: 20px;
    border-bottom-left-radius: 8px;
    box-shadow: var(--shadow);
    display: none;
  }

  nav.open {
    display: flex;
    animation: slideIn 0.3s ease;
  }

  @keyframes slideIn {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  .menu-toggle {
    display: block;
  }
}
.pagination a, .pagination strong {
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
}
.pagination a:hover {
    background: #f0f0f0;
}
.pagination strong {
    background: #007bff;
    color: white;
    border-color: #007bff;
}
