@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap");

:root {
  --bg-color: #0d0e12;
  --surface-color: #16181e;
  --surface-light: #20232c;
  --primary-color: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --accent-color: #06b6d4;
  --text-color: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;

  --max-width: 1200px;
  --header-height: 80px;

  --glass-bg: rgba(22, 24, 30, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --glow: 0 0 20px rgba(79, 70, 229, 0.3);

  --font-main: "Poppins", sans-serif;
  --big-font: clamp(2.5rem, 5vw, 4rem);
  --h2-font: clamp(2rem, 4vw, 3rem);
  --p-font: 1rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  list-style: none;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-main);
  overflow-x: hidden;
  line-height: 1.6;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-light);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: var(--primary-gradient);
  color: #fff;
  border-radius: 50px;
  font-weight: 500;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 5px 15px rgba(79, 70, 229, 0.3);
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
}

section {
  padding: 100px 10%;
  position: relative;
  overflow: hidden;
}

.heading {
  text-align: center;
  margin-bottom: 4rem;
}

.heading h2 {
  font-size: var(--h2-font);
  font-weight: 700;
  background: var(--primary-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.heading span {
  color: var(--accent-color);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

header {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 10%;
  background: transparent;
  transition: all 0.4s ease;
}

header.sticky {
  padding: 12px 10%;
  background: rgba(13, 14, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

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

.navbar {
  display: flex;
  gap: 2rem;
}

.navbar a {
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 0.5rem 0;
  position: relative;
}

.navbar a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: width 0.3s ease;
}

.navbar a:hover,
.navbar a.active {
  color: var(--accent-color);
}

.navbar a:hover::after,
.navbar a.active::after {
  width: 100%;
}

#menu-icon {
  font-size: 28px;
  cursor: pointer;
  display: none;
  color: var(--text-color);
}

.accueil {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  padding-top: var(--header-height);
  background:
    radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 40%);
}

.accueilText {
  order: 1;
}

.accueilText h1 {
  font-size: var(--big-font);
  line-height: 1.1;
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.accueilText h1 span {
  color: var(--primary-color);
}

.accueilText h2 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 2.4rem;
}

.accueilText .textMedium {
  color: var(--accent-color);
  font-weight: 600;
}

.animText {
  border-right: 2px solid var(--accent-color);
  padding-right: 5px;
  animation: blink 0.7s infinite;
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.social {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social a {
  width: 45px;
  height: 45px;
  background: var(--surface-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-color);
  transition: all 0.3s ease;
  border: var(--glass-border);
}

.social a:hover {
  background: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

.accueil-img {
  order: 2;
  position: relative;
  display: flex;
  justify-content: center;
}

.accueil-img img {
  max-width: 100%;
  width: 400px;
  border-radius: 20px;
  z-index: 1;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.a-propos {
  background: var(--surface-color);
}

.a-propos-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  align-items: center;
}

.a-propos-img img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--glow);
  transition: transform 0.4s ease;
}

.a-propos-img img:hover {
  transform: scale(1.02);
}

.a-propos-text p {
  font-size: var(--p-font);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.information {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.info-box {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.info-box i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.info-box span a {
  color: var(--text-color);
  transition: color 0.3s;
}

.info-box span a:hover {
  color: var(--accent-color);
}

.competences-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  align-items: center;
}

.competences-img {
  width: 100%;
  text-align: center;
}

.competences-img img {
  width: 100%;
  max-width: 500px;
  border-radius: 20px;
  box-shadow: var(--glass-shadow);
  border: var(--glass-border);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  object-fit: cover;
}

.competences-img img:hover {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(79, 70, 229, 0.2);
}

.skills-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  width: 100%;
}

.skill-card {
  background: var(--glass-bg);
  padding: 1.5rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.2);
}

.skill-circle {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.skill-circle svg {
  position: relative;
  width: 150px;
  height: 150px;
  transform: rotate(270deg);
  overflow: visible;
}

.skill-circle svg circle {
  width: 100%;
  height: 100%;
  fill: transparent;
  stroke-width: 8;
  stroke: var(--surface-light);
  transform: translate(5px, 5px);
}

.skill-circle svg circle:nth-child(2) {
  stroke: var(--primary-color);
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
  transition: stroke-dashoffset 2s ease;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--primary-color));
}

.skill-card:hover .skill-circle svg circle:nth-child(2) {
  filter: drop-shadow(0 0 10px var(--accent-color));
  stroke: var(--accent-color);
}

.skill-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.skill-inner i,
.skill-inner .skill-icon {
  font-size: 2.5rem;
  width: 2.5rem;
  color: var(--text-color);
  margin-bottom: 5px;
}

.skill-inner span {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
}

.skill-card h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--glass-bg);
  border-radius: 20px;
  overflow: hidden;
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(79, 70, 229, 0.3);
}

.project-img {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.1);
}

.project-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-info p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.btn-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
  transition: gap 0.3s ease;
}

.btn-more:hover {
  gap: 10px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--surface-color);
  border: var(--glass-border);
  border-radius: 20px;
  width: 80%;
  /* requested 80% width */
  max-width: 1400px;
  /* Increased max-width */
  max-height: 90vh;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  animation: slideUp 0.4s ease forwards;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 25px;
  color: var(--text-muted);
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  transition: color 0.3s;
}

.close-modal:hover {
  color: var(--primary-color);
}

.modal-img-container {
  width: 100%;
  height: 50vh;
  /* Adjust height based on screen size */
  max-height: 600px;
  position: relative;
  background: #000;
}

.modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Ensure image is fully visible */
  border-bottom: 1px solid var(--surface-light);
}

/* Carousel Styles */
.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  /* Center image */
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  /* Increased from 40px */
  height: 60px;
  /* Increased from 40px */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s, transform 0.2s;
  font-size: 2rem;
  /* Increased icon size */
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 20px;
}

.carousel-btn.next {
  right: 20px;
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s;
}

.carousel-indicators button.active {
  background: white;
}

.modal-title {
  margin: 1.5rem 2rem 0.5rem;
  font-size: 1.8rem;
  color: var(--text-color);
}

.modal-tags {
  margin: 0 2rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-tag {
  background: rgba(79, 70, 229, 0.15);
  /* Primary color low opacity */
  color: var(--primary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(79, 70, 229, 0.3);
}

.modal-desc {
  padding: 0 2rem 2rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
  overflow-y: auto;
}

.alert {
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  font-weight: 500;
  text-align: center;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.contact-form {
  max-width: 700px;
  margin: 0 auto;
  background: var(--surface-light);
  padding: 2rem;
  border-radius: 20px;
  border: var(--glass-border);
}

.contact-form p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.contact-form p span a {
  color: var(--primary-color);
  font-weight: 600;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1.5rem;
  background: var(--surface-color);
  border: var(--glass-border);
  border-radius: 12px;
  color: var(--text-color);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

div:has(> .form-btn) {
  text-align: center;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
  transform: translateY(-2px);
}

.form-textarea {
  resize: none;
  min-height: 150px;
}

.copyright {
  padding: 2rem 5%;
  text-align: center;
  background: var(--surface-color);
  border-top: 1px solid var(--surface-light);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .accueil {
    grid-template-columns: auto 1fr;
    text-align: left;
    padding-top: 120px;
    align-items: center;
    gap: 1.5rem;
  }

  .accueil-img {
    display: none;
  }

  .socialsAccueilText {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0;
  }

  .social {
    gap: 1rem;
    left: -3px;
    margin-bottom: 0;
    position: relative;
  }

  .header {
    padding: 15px 4%;
  }

  #menu-icon {
    display: block;
  }

  .navbar {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(13, 14, 18, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 1rem 0;
    gap: 0;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.4s ease-in-out;
  }

  .navbar.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar a {
    display: block;
    padding: 1rem 2rem;
    border-left: 2px solid transparent;
  }

  .navbar a:hover,
  .navbar a.active {
    background: var(--surface-light);
    border-left-color: var(--primary-color);
    color: #fff;
  }

  .navbar a::after {
    display: none;
  }
}