@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=swap");

/* Bases de mes différentes pages */
body {
  background: url("../images/background/milkyway.jpg");
  font-family: "Space Grotesk", sans-serif;
  overflow: auto;
  background-size: cover;
  margin: 0;
  padding: 0;
  color: #fff6ff;
}

main {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* Partie Navbar */
:root {
  --clr-bg-header: #0b0b0b;
  --clr-btn: #0b0b0b;
  --clr-dropdown: #0b0b0b;
  --clr-nav-hover: #fff6ff;
  --clr-light: #fafafa;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  /* outline: 1px solid red; */
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

header {
  position: fixed;
  top: 0px;
  background-color: var(--clr-bg-header);
  height: 4rem;
  width: 100%;
  z-index: 1000;
}

.overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.container {
  max-width: 65rem;
  padding: 0 1rem;
  margin: 0 auto;
  display: flex;
  position: relative;
  align-items: center;
}

.logo-container {
  flex: 1;
  display: flex;
  margin-top: 10px;
  align-items:flex-start;
}

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.8rem;
  color: var(--clr-light);
  margin-left: -70px;
}

@media (max-width: 920px) {
  .logo {
    margin-left: 0;
  }
}

.logo:hover {
  transition: 0.8s;
  transform: scale(1.2);
}

.admin-icon {
  margin-top: 12px;
  color: var(--clr-light);
  font-size: 1.1rem;
}

.nav-btn {
  flex: 3;
  display: flex;
}

.nav-links {
  flex: 2;
}

.log-sign {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

/* Tous les bouttons  */
.btn-see, 
.btn {
  font-size: 0.8rem;
  padding: 6px 12px;
  margin-top: 15px;
  border: 2px solid #fff;
  border-radius: 20px;
  background-color: transparent;
  color: white;
  text-transform: uppercase;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}

.btn-see:hover, 
.btn:hover {
  background-color: white;
  color: black;
  cursor: pointer;
}

.btn-add {
  display: inline-block;
  margin: 2rem auto;
  padding: 0.4rem 1.3rem;
  font-size: 0.8rem;
  border: 2px solid #2bb673; 
  border-radius: 2rem;
  background-color: transparent;
  color: #2bb673;
  text-transform: uppercase;
  text-align: center;
  transition: 0.3s;
}

.btn-add:hover {
  background-color: #2bb673;
  color: #000;
  cursor: pointer;
}

.btn-back-home {
  padding: 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: #7dcfff;
  border: 1.5px solid;
  border-radius: 30px;
  margin-top: 20px;
  background-color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  transition: all 0.3s ease;
}

.btn-back-home:hover {
  background-color: #7dcfff;
  color: black;
  box-shadow: 0 0 20px #7dcfff;
}

.btn-delete {
  display: inline-block;
  margin: 2rem auto;
  padding: 0.4rem 1.3rem;
  font-size: 0.8rem;
  border: 2px solid #e74c3c; 
  border-radius: 2rem;
  background-color: transparent;
  color: #e74c3c;
  text-transform: uppercase;
  text-align: center;
  transition: 0.3s;
}


.centered-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 5px;
}

.nav-links > ul {
  display: flex;
  margin-top: 12px;
  justify-content: center;
  align-items: center;
}

.nav-link {
  position: relative;
}

.nav-link > a {
  color: var(--clr-nav-hover);
  line-height: 3rem;
  padding: 0 0.8rem;
  letter-spacing: 1px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: 0.5s;
}

.nav-link > a > i {
  margin-left: 0.2rem;
}

.nav-link:hover > a {
  transform: scale(1.1);
  color: #fff6ff;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 10rem;
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: 0.5s;
}

@media (max-width: 920px) {
  .dropdown {
    width: 100%; 
  }
}

.dropdown ul {
  position: relative;
}

.dropdown-link {
  position: relative;
}

.dropdown-link > a {
  display: flex;
  background-color: var(--clr-light);
  color: var(--clr-dropdown);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  align-items: center;
  justify-content: space-between;
  transition: 0.3s;
  text-decoration: none;
}

.dropdown-link:hover > a {
  background-color: var(--clr-dropdown);
  color: var(--clr-light);
}

.dropdown-link:not(:nth-last-child(2)) {
  border-bottom: 1px solid var(--clr-light);
}

.dropdown-link i {
  transform: rotate(-90deg);
}

.dropdown-link:first-child:hover {
  background-color: var(--clr-dropdown);
}

.nav-link:hover > .dropdown,
.dropdown-link:hover > .dropdown {
  transform: translate(0, 0);
  opacity: 1;
  pointer-events: auto;
}

.hamburger-menu-container {
  flex: 1;
  display: none;
  align-items: center;
  justify-content: flex-end;
}

.hamburger-menu {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.hamburger-menu div {
  width: 1.6rem;
  height: 3px;
  border-radius: 3px;
  background-color: var(--clr-light);
  position: relative;
  z-index: 1001;
  transition: 0.5s;
}

.hamburger-menu div:before,
.hamburger-menu div:after {
  content: "";
  position: absolute;
  width: inherit;
  height: inherit;
  background-color: var(--clr-light);
  border-radius: 3px;
  transition: 0.5s;
}

.hamburger-menu div:before {
  transform: translateY(-7px);
}

.hamburger-menu div:after {
  transform: translateY(7px);
}

#check {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  z-index: 90000;
  cursor: pointer;
  opacity: 0;
  display: none;
}

#check:checked ~ .hamburger-menu-container .hamburger-menu div {
  background-color: transparent;
}

#check:checked ~ .hamburger-menu-container .hamburger-menu div:before {
  transform: translateY(0) rotate(-45deg);
}

#check:checked ~ .hamburger-menu-container .hamburger-menu div:after {
  transform: translateY(0) rotate(45deg);
}

.user-menu {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.user-icon {
  color: white;
  text-decoration: none;
  margin-top: 12px;
}

@keyframes animation {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0px);
  }
}

@media (max-width: 920px) {
  .hamburger-menu-container {
    display: flex;
    color: #000;
  }

  #check {
    display: block;
  }

  .nav-btn {
    position: fixed;
    height: calc(100vh - 3rem);
    top: 3rem;
    left: 0;
    width: 100%;
    background-color: var(--clr-btn);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* pour que les menus soient bien empilés vers le haut */
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(100%);
    transition: 0.65s;
    padding-top: 1rem; /* petit espace au-dessus */
  }

  #check:checked ~ .nav-btn {
    transform: translateX(0);
  }

  #check:checked ~ .nav-btn .nav-link,
  #check:checked ~ .nav-btn .log-sign {
    animation: animation 0.5s ease forwards var(--i);
  }

  .nav-links {
    flex: initial;
    width: 100%;
  }

  .nav-links > ul {
    flex-direction: column;
  }

  .nav-link {
    width: 100%;
    opacity: 1;
    transform: translateY(15px);
    margin-bottom: 2rem; 
  }

  .nav-link > a {
    line-height: 1;
    padding: 1.6rem 2rem;
    color: var(--clr-light);
  }

  .nav-link:hover > a {
    background-color: var(--clr-nav-hover);
    color: var(--clr-btn);
  }

  .dropdown {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    display: none;
    margin-top: 1rem;
  }

  .nav-link:hover > .dropdown,
  .dropdown-link:hover > .dropdown {
    display: block;
  }
}


/* Partie Footer */
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: none;
  background-color: var(--clr-bg-header);
  padding: 10px 0;
  color: #fff6ff;
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
  margin-top: auto;
  position: relative;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.footer-text {
  font-size: 11px;
  color: #fff6ff;
  letter-spacing: 0.8px;
  opacity: 0.9;
}

.footer .fa-github {
  font-size: 25px;
}

@media (max-width: 600px) {
  .footer-logo {
    width: 30px;
  }
  .footer-text {
    font-size: 12px;
  }
}

/* Home Page */
.main-container {
  width: 80%;
  margin: auto;
  padding: 20px;
  z-index: 0;
}

/* Registration & Login */
.h1-registration {
  margin-bottom: 40px;
  margin-top: -80px;
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
}

/* Animation (pas encore intégrée) */
.animation-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
}

/* Actualitées récentes */
.recent-articles {
  margin-top: 50px;
  margin-bottom: 50px;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.recent-articles h2 {
  margin-bottom: 20px;
  text-transform: uppercase;
}

.articles-list {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.article-card {
  background-color: rgba(84, 82, 82, 0.359);
  padding: 8px;
  border-radius: 10px;
  flex: 1 1 calc(50% - 20px); /* largeur de mes cards */
  min-height: 250px; /* hauteur de mes cards, à modif après l'implément d'images */
}

.card-image {
	width: 100%;
	height: 140px; 
	object-fit: cover;
	border-radius: 12px;
	display: block;
  opacity: 80%;
  margin-bottom: 10px;
}

.article-card h3 {
  text-transform: uppercase;
  margin-bottom: 10px;
}
.article-card p {
  margin-bottom: 8px;
}

.article-card a {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .article-card {
    flex: 1 1 100%;
  }
}

.favorite-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.star-icon {
  fill: none;
  stroke: #FFD700;
  stroke-width: 2;
}

.star-icon.filled {
  fill: #FFD700;
}


/* Articles détails */
.article-banner {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.article-show-container {
  width: 90%;
  max-width: 1000px;
  margin: 2rem auto;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  padding: 2rem;
  color: #fff6ff;
}

.article-show-container h1 {
  margin-bottom: 1rem;
  font-size: 2rem;
  text-transform: uppercase;
}

.article-show-container .publication-date {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.article-show-container .article-content {
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: justify;
  white-space: pre-line;
  margin-bottom: 1rem;
}

/* Formulaire d'édition article */
.form-container {
  width: 650px;
  margin: 0 auto;
  max-width: 600px;
  background: rgba(84, 82, 82, 0.359);
  padding: 20px;
  border-radius: 8px;
  color: #fff6ff;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  margin-bottom: 10px;
  border: 1px solid #fff6ff;
  border-radius: 4px;
  box-sizing: border-box;
}

.content-field {
  min-height: 150px;
}

/* Admin Dashboard */

.h1-dashboard {
  margin-top: 40px;
  text-align: center;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
}

.admin-section,
.admin-section.members {
  width: 100%;
  margin: 40px auto;
  padding: 20px;
  border-radius: 10px;
  text-align: left;
}

.admin-section h2 {
  margin-bottom: 20px;
  font-size: 15px;
  text-align: left;
}

.table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  color: #fff6ff;
  font-size: 1rem;
  min-width: 600px;
}

.table th,
.table td {
  padding: 12px 15px;
  text-align: left;
}

.table thead {
  background-color: rgba(255, 255, 255, 0.05);
}

/* et le responsive du adminDashboard */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* pour un défilement fluide sur iOS */
}

/* Ajustements pour les petits écrans */
@media (max-width: 768px) {
  .table th,
  .table td {
    font-size: 0.75rem;
    padding: 8px 10px;
    word-break: break-word; /* évite les débordements de mots longs */
  }
}

/* User Dashboard */
.user-dashboard {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.05);
  color: #fff6ff;
  border-radius: 15px;
  padding: 40px;
  max-width: 1200px;
  margin: 60px auto;
  font-size: 1.1rem;
}

.dashboard-left,
.dashboard-right {
  flex: 1;
  min-width: 300px;
}

.dashboard-top {
  margin-top: 130px;
}

.dashboard-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  padding: 20px;
  border-radius: 15px;
}

.profile-picture {
  max-width: 160px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.upload-btn {
  margin-top: 15px;
}

.username {
  font-size: 1.3rem;
  margin: 10px 0;
  text-transform: uppercase;
}

.user-info-section {
  margin-bottom: 35px;
}

.user-info-section h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.dashboard-bottom {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 40px;
  max-width: 1200px;
  margin: 0 auto 60px;
  color: #fff6ff;
  font-size: 1.05rem;
}

.user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.favorites-table {
  width: 100%;
  margin-top: 25px;
  border-collapse: collapse;
}

.favorites-table th,
.favorites-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.btn.small {
  display: flex;
  font-size: 0.9rem;
  padding: 6px 12px;
  justify-content: center;
}


/* Fenêtre modale après succès du register */
.modal-flash {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.modal-content {
  background: #101010;
  color: #cccccc;
  padding: 15px;
  border-radius: 8px;
  max-width: 90%;
  text-align: center;
}

.modal-content button {
  margin-top: 10px;
  padding: 6px 14px;
  border: none;
  background: #1e1e1e;
  color: #fff;
  border-radius: 4px;
}


/* Partie inclusive - dyslexia */
#toggle-dyslexia {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 10px 14px;
  font-size: 14px;
  background-color: #ffffff;
  color: #000;
  border-radius: 8px;
  cursor: pointer;
  z-index: 2;
}

#toggle-dyslexia:hover {
  background-color: #d7d5d5;
}

body.dyslexia-mode {
  font-family: Arial, sans-serif;
  font-size: 1.1em;
  line-height: 1.6;
  letter-spacing: 0.05em;
  background-color: #fdfdfd;
  color: #111;
}

body.dyslexia-mode a {
  text-decoration: underline;
}


/* About me & RGPD */
  .about-us {
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 5px;
    margin-top: 80px;
    margin-bottom: 60px;
    color: #fff6ff;
    font-size: 1rem;
    line-height: 1.5;
  }

.about-us p {
  margin-bottom: 15px;
  text-align: justify;
  padding: 10px;
}

/* Actualities index */
.comment-form {
  background: rgba(255, 255, 255, 0.07);
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  margin: 40px auto 0;
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff6ff;
}

.comments-section {
  width: 100%;
  max-width: 1000px;
  margin: 80px auto 60px auto;
  padding: 30px;
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  color: #fff;
}

.animation-container {
margin-top: 90px;
}


/* éléments cachés */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}