@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Magra:wght@400;700&display=swap');

*, ::before, ::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

:root {
  --grey-light: #e6e6e6;
  --white-light: #fff;
  --black-light: #222;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --orange: #e06b1a;
  --remove-btn-orange: #c55a12;
  --remove-btn-white: #fff;
  --text-grey: #888;
  --black-dark: #1a1a1a;
  --text-color-dark: #f5f5f5;
  --gris-dark: #2b2b2b;
  --shadow-dark: rgba(0, 0, 0, 0.6);
  --crimson: "Crimson Text";
  --magra: "Magra";
}

/* Thèmes */
html[data-theme="light"] {
  --bg-color: var(--grey-light);
  --text-color: var(--black-light);
  --card-bg: var(--white-light);
  --shadow-color: var(--shadow-light);
}

html[data-theme="dark"] {
  --bg-color: var(--black-dark);
  --text-color: var(--text-color-dark);
  --card-bg: var(--gris-dark);
  --shadow-color: var(--shadow-dark);
}

/* Style général */
body {
  font-family: var(--crimson, --magra);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--card-bg);
  box-shadow: 0 2px 6px var(--shadow-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

header nav a {
  margin-left: 1.5rem;
  font-family: var(--magra);
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s;
}

header nav a:hover {
  color: var(--orange);
}

#themeToggle {
  cursor: pointer;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--text-color);
}

#logo {
  background-color: #fff;
  border-radius: 2rem;
  width: 15rem;
}

/* Main */
main {
  min-height: calc(100vh - 8rem);
  padding-bottom: 2rem;
}

.page-title {
  text-align: center;
  margin: 2rem 0;
  font-family: var(--crimson);
  font-size: 2.5rem;
  color: var(--orange);
  font-weight: 700;
}

/* grid fav */

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* carte fav */

.carte-favori {
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.carte-favori:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow-color);
}

/* Container image */
.image-container {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background-color: var(--bg-color);
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.carte-favori:hover .image-container img {
  transform: scale(1.05);
}

/* Contenu de la carte */
.carte-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.carte-content h3 {
  font-family: var(--crimson);
  font-size: 1.3rem;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
  font-weight: 600;
}

/* infos recette ( badges ) */

.infos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--magra);
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 500;
}

html[data-theme="dark"] .badge {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.temps {
  background: rgba(52, 152, 219, 0.1);
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.3);
}

html[data-theme="dark"] .badge.temps {
  color: #5dade2;
}

.badge.niveau {
  background: rgba(46, 204, 113, 0.1);
  color: #27ae60;
  border-color: rgba(46, 204, 113, 0.3);
}

html[data-theme="dark"] .badge.niveau {
  color: #58d68d;
}

/* action btn*/

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.btn-voir {
  flex: 1;
  padding: 0.75rem 1.2rem;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  text-align: center;
  border-radius: 8px;
  font-family: var(--magra);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(230, 107, 26, 0.3);
}

.btn-voir:hover {
  background: #c55a12;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 107, 26, 0.4);
}

.btn-voir:active {
  transform: translateY(0);
}

.btn-supprimer {
  padding: 0.75rem 1rem;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--magra);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.btn-supprimer:hover {
  background: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.btn-supprimer:active {
  transform: translateY(0);
}

.btn-supprimer .material-symbols-outlined {
  font-size: 1.2rem;
}

/* si vide */

.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-grey);
  font-family: var(--magra);
  max-width: 600px;
  margin: 0 auto;
}

.empty-state .material-symbols-outlined {
  font-size: 5rem;
  color: var(--orange);
  opacity: 0.4;
  margin-bottom: 1rem;
}

.empty-state h2 {
  margin: 1.5rem 0 1rem;
  font-size: 2rem;
  color: var(--text-color);
  font-family: var(--crimson);
  font-weight: 600;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.empty-state a {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  background: var(--orange);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(230, 107, 26, 0.3);
}

.empty-state a:hover {
  background: #c55a12;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230, 107, 26, 0.4);
}

.empty-state a:active {
  transform: translateY(0);
}

#menuToggle {
  display: none; 
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  background-color: var(--card-bg);
  color: var(--text-grey);
  box-shadow: 0 -2px 6px var(--shadow-color);
  margin-top: auto;
}

/* responsive tablette */

@media (max-width: 990px) {
  header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  header nav {
   gap: 1rem;
   flex: 1;
   justify-content: center;
  }

  #logo {
    width: 10rem;
  }

  .theme-toggle {
    font-size: 1.6rem;
  }

  .page-title {
    font-size: 2rem;
    margin: 1.5rem 0;
  }

  .favorites-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .image-container {
    height: 180px;
  }

  .carte-content {
    padding: 1.25rem;
  }

  .carte-content h3 {
    font-size: 1.15rem;
  }

  .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .btn-voir,
  .btn-supprimer {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }

  .empty-state {
    padding: 4rem 2rem;
  }

  .empty-state .material-symbols-outlined {
    font-size: 4rem;
  }

  .empty-state h2 {
    font-size: 1.7rem;
  }

  footer {
    font-size: 0.9rem;
    padding: 1rem;
  }
}

/* responsive mobile */

@media (max-width: 600px) {
  header {
    padding: 0.8rem 1rem;
  }

  header nav {
    font-size: 0.8rem;
  }

  header nav a {
    font-size: 0.9rem;
  }

  #logo {
    width: 7rem;
  }

  .theme-toggle {
    font-size: 1.5rem;
  }

  .page-title {
    font-size: 1.6rem;
  }

  .favorites-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1rem;
  }

  .image-container {
    height: 160px;
  }

  .carte-content {
    padding: 1rem;
  }

  .carte-content h3 {
    font-size: 1rem;
  }

  .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }

  .actions {
    flex-direction: column;
    gap: 0.6rem;
  }

  .btn-voir,
  .btn-supprimer {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .empty-state {
    padding: 3rem 1rem;
  }

  .empty-state .material-symbols-outlined {
    font-size: 3.5rem;
  }

  .empty-state h2 {
    font-size: 1.5rem;
  }

  .empty-state p {
    font-size: 1rem;
  }

  #menuToggle {
    display: block;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    z-index: 110;
    padding: 0.25rem 0.5rem;
  }

  #navLinks {
    display: none;           
    position: absolute;        
    left: 0;
    right: 0;
    top: 100%;                 
    background-color: var(--card-bg);
    box-shadow: 0 6px 16px var(--shadow-color);
    padding: 1rem 1.25rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  #navLinks.active {
    display: flex;
  }

  #navLinks a {
    padding: 0.5rem 0;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06); 
  }

  #navLinks a:last-child {
    border-bottom: none;
  }
}