@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

:root {
  /* --- COULEURS THEME CLAIR (Défaut) --- */
  --bg-color: #f5f6fa;
  --text-color: #2f3640;
  --primary-color: #6c5ce7;
  --header-bg: linear-gradient(260deg, #6c5ce7, #6d76ce);
  --accent-color: #00cec9;
  --accent-hover: #019a9a;

  --card-bg: white;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  --card-hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);

  --tech-bg: #f5f6fa;
  --footer-bg: #2d3436;

  --input-bg: white;
  --input-border: #ccc;

  --wait-bg: rgba(255, 255, 255, 0.7);
  --wait-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

  --featured-card-bg: #f0f3ff;
  --nav-link-color: white;
  --nav-link-hover: #fdcb6e;
}

/* --- COULEURS THEME SOMBRE --- */
html.dark-mode {
  --bg-color: #0e1225;
  --text-color: #eaeaea;
  --header-bg: linear-gradient(180deg, #2e2163, #0e1225);

  --card-bg: #2c2c3a;
  --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  --card-hover-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);

  --tech-bg: #3d3d4f;
  --footer-bg: #111;

  --input-bg: #2c2c3a;
  --input-border: #444;

  --wait-bg: rgba(44, 44, 58, 0.8);
  --wait-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

  --featured-card-bg: #2c2c3a;
}

html {
  scroll-behavior: smooth;
}

/* --- RESET & GLOBAL --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", sans-serif;
  line-height: 1.6;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* --- HEADER & NAV --- */
header {
  background: var(--header-bg);
  color: white;
  text-align: center;
  transition: background 0.3s;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  flex-wrap: wrap;
  position: relative;
}

.navbar .logo {
  font-size: 1.8rem;
  font-weight: bold;
}

.navbar .logo span {
  color: var(--accent-color);
}

.burger-menu {
  display: none;
  cursor: pointer;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--nav-link-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--nav-link-hover);
}

html.dark-mode .nav-links a:hover {
  color: var(--accent-color);
}

/* --- TOGGLE SWITCH --- */
.toggle {
  position: relative;
  display: inline-block;
  width: 3.75rem;
  height: 2rem;
}

.toggle input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ccc;
  border-radius: 62.43rem;
  transition: background 0.4s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.slider::before {
  content: "";
  position: absolute;
  height: 1.5rem;
  width: 1.5rem;
  left: 0.25rem;
  bottom: 0.25rem;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.4s;
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  color: #fff;
  z-index: 1;
}

.sun {
  color: #f39c12;
}
.moon {
  color: #2980b9;
}

.toggle input:checked + .slider {
  background: #2d3436;
}

.toggle input:checked + .slider::before {
  transform: translateX(1.75rem);
}

/* --- HERO SECTIONS --- */
h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.title {
  padding: 2rem 1rem;
  text-align: center;
  font-size: 2.5rem;
  color: var(--primary-color);
}

.hero,
.hero-project {
  padding: 3rem 1rem;
}

.hero span,
.hero-project span {
  color: #fff3b1;
}

.hero p,
.hero-project p {
  margin-bottom: 1rem;
}

/* --- MAIN STRUCTURE --- */
main {
  flex: 1 0 auto;
  width: 100%;
}

main section {
  padding: 3rem 1rem;
  max-width: 70rem;
  margin: auto;
  text-align: center;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

/* --- ABOUT SECTION --- */
.about {
  display: flex;
  gap: 2rem;
  padding: 0 1rem;
  margin-top: 3rem;
  margin-bottom: 3rem;
  align-items: center;
}

.desc {
  width: 50%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.desc p {
  margin-bottom: 1rem;
}

.picture {
  min-height: 25rem;
  background-image: url(assets/moi.jpg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  justify-content: center;
  width: 50%;
  border-radius: 10px;
}

/* --- NEWS & CARDS --- */
.news {
  text-align: center;
  padding: 0;
}

.more {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.more a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.more p {
  margin: 0;
}

.chevron {
  width: 1.5rem;
  height: auto;
}

html.dark-mode .chevron {
  filter: invert(1);
}

.cards-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.cards-container h3 {
  margin-bottom: 1rem;
}

.card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  width: 100%;
  max-width: 20rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  margin: 0 auto;
}

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

html.dark-mode .logo_atelier {
  background: #ffffff;
  border-radius: 16px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
}

/* --- BENTO GRID PROJECTS --- */
.projects {
  padding: 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 1.5rem;
  padding: 0 1rem;
  grid-auto-flow: dense;
}

.project-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, background 0.3s, color 0.3s, opacity 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

html.dark-mode .project-card {
  box-shadow: var(--card-shadow);
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card.hide {
  display: none;
}

.project-card:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
  background-color: var(--featured-card-bg);
}

.project-card:nth-child(6) {
  grid-column: span 2;
}

/* --- SKILLS --- */
.skills ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0;
}

.skills li {
  background: #dfe6e9;
  padding: 0.7rem 1.2rem;
  border-radius: 25px;
  font-weight: 500;
  list-style: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
}

html.dark-mode .skills li {
  background: var(--tech-bg);
  color: var(--text-color);
}

.skills li:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  background: #b2bec3;
}

.skills li.active {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 4px 10px rgba(0, 206, 201, 0.4);
}

html.dark-mode .skills li.active {
  background: var(--accent-color);
  color: white;
}

/* --- BUTTONS & MISC --- */
.btn {
  margin-top: 1rem;
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s;
  cursor: pointer;
  font-weight: 500;
}

.btn:hover {
  background: var(--accent-hover);
}

main > div {
  margin: 2rem;
}

main > div p {
  margin-bottom: 1rem;
}

.freelance-content p {
  margin-bottom: 1rem;
}

/* --- PROJECT PAGE SPECIFIC --- */
.detail-section {
  padding: 2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.row-layout {
  flex-direction: row;
}

.content-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

html.dark-mode .content-card {
  box-shadow: var(--card-shadow);
}

.content-card h2 {
  margin-top: 0;
  text-align: left;
}

.full-width {
  width: 100%;
}

.half-width {
  flex: 1;
  min-width: 300px;
}

.tech-list {
  list-style: none;
  padding: 0;
}

.tech-list li {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  background: var(--tech-bg);
  padding: 0.8rem;
  border-radius: 8px;
  transition: transform 0.2s, background 0.3s;
}

.tech-list li:hover {
  transform: translateX(5px);
}

.tech-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  margin-right: 1rem;
}

.styled-list {
  list-style: none;
}

.styled-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
}

.styled-list li::before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
  font-size: 1.2rem;
  line-height: 1.5rem;
}

.center-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.caption {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--primary-color);
  font-style: italic;
  text-align: center;
}

/* --- WAIT SCREEN SPECIFIC --- */
.wait-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 2rem 1rem;
}

.containerwait {
  background: var(--wait-bg);
  padding: 3rem 4rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: var(--wait-shadow);
  text-align: center;
  margin-bottom: 2rem;
  max-width: 600px;
  width: 90%;
  animation: fadeIn 0.8s ease-out;
  transition: background 0.3s, box-shadow 0.3s;
}

.containerwait h1 {
  margin-bottom: 1rem;
  font-size: 3rem;
  color: var(--primary-color);
}

.containerwait p {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.sticker img {
  width: 100%;
  max-width: 150px;
  height: auto;
  animation: float 3s ease-in-out infinite;
}

/* --- FORMULAIRE DE CONTACT --- */
.contact-form {
  max-width: 600px;
  margin: 2rem auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form label {
  font-weight: 600;
  margin-left: 0.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  font-family: inherit;
  font-size: 1rem;
  background: var(--input-bg);
  color: var(--text-color);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s, color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

html.dark-mode .contact-form input:focus,
html.dark-mode .contact-form textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 206, 201, 0.2);
}

.contact-form button {
  align-self: center;
  border: none;
  font-size: 1rem;
  width: 100%;
  max-width: 200px;
}

/* --- DISCORD MOCKUP SPECIFIC --- */
main .discord-mockup {
  background: #36393f;
  color: #dcddde;
  font-family: "Whitney", "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2rem;
  gap: 1.5rem;
  height: auto;
  border: none;
  border-radius: 8px;
}

.discord-msg {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  width: 100%;
  text-align: left;
}

.discord-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.discord-avatar.user {
  background-color: #5865f2;
}

.discord-avatar.bot {
  background-color: #00cec9;
}

.discord-content {
  display: flex;
  flex-direction: column;
}

.discord-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.discord-username {
  font-weight: bold;
  color: white;
  font-size: 1rem;
}

.discord-badge {
  font-size: 0.625rem;
  background: #5865f2;
  color: white;
  padding: 0.15rem 0.275rem;
  border-radius: 3px;
  line-height: 1;
}

.discord-date {
  font-size: 0.75rem;
  color: #72767d;
  margin-left: 0.2rem;
}

.discord-text {
  margin: 0;
  line-height: 1.375rem;
  color: #dcddde;
}

.discord-divider {
  width: 100%;
  height: 1px;
  background-color: #4f545c;
  margin: 0.5rem 0;
  opacity: 0.4;
}

/* --- FOOTER --- */
footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--footer-bg);
  color: white;
  font-size: 0.9rem;
  transition: background 0.3s;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 99;
  width: 100%;
  margin-top: auto;
}

.Socialmedia {
  margin-top: 1rem;
  gap: 2rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- PYGAME PROJECT SPECIFIC --- */
.pygame-screen {
  background-color: #bbada0; 
  width: 300px;
  height: 300px;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  position: relative;
}

/* 2048 SPECIFICS */
.pygame-grid-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  height: 100%;
}

.pygame-cell {
  background-color: #cdc1b4; 
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.5rem;
  color: #776e65;
}

.cell-2 {
  background-color: #eee4da;
}
.cell-4 {
  background-color: #ede0c8;
}
.cell-8 {
  background-color: #f2b179;
  color: white;
}
.cell-2048 {
  background-color: #edc22e;
  color: white;
  box-shadow: 0 0 10px #edc22e;
}

/* COINFLIP SPECIFICS */
.coinflip-bg {
  background-color: white;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1rem;
}

.coinflip-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: black;
}

.coinflip-container {
  display: flex;
  gap: 1rem;
}

.coinflip-btn {
  padding: 1rem 1.5rem;
  color: white;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-pile {
  background-color: #00c800; 
}
.btn-face {
  background-color: #c80000; 
}

.coinflip-result {
  font-size: 1.2rem;
  color: #00c800;
  font-weight: bold;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .hero h1 {
    font-size: 2rem;
  }
  .about {
    flex-direction: column;
    text-align: center;
  }
  .desc,
  .picture {
    width: 100%;
  }
  .picture {
    min-height: 20rem;
    width: 80%;
    margin: 0 auto;
  }
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
  }
  .project-card:nth-child(6) {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
    justify-content: space-between;
  }
  .burger-menu {
    display: block;
    order: 2;
  }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    text-align: center;
    padding-top: 1rem;
    order: 3;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  .nav-links.mobile-menu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
  }

  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  .hero,
  main section {
    padding: 2rem 1rem;
  }
  .picture {
    width: 100%;
    min-height: 15rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }
  .project-card:nth-child(1),
  .project-card:nth-child(6) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .detail-section {
    padding: 1rem;
    flex-direction: column;
  }
  .content-card {
    padding: 1.5rem;
  }

  .containerwait {
    padding: 2rem;
    width: 95%;
  }
  .containerwait h1 {
    font-size: 2rem;
  }
  .containerwait p {
    font-size: 1rem;
  }

  footer {
    padding-bottom: 2rem;
  }

  .pygame-screen {
    width: 250px;
    height: 250px;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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