@import 'variables.css';

/* Utility Classes */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  background: var(--gradient-main);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font-weight: 700;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--gradient-main);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
  /* Bleu clair glow */
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.15);
  /* Bleu ciel rgba */
}

/* Structure Components */
header {
  height: var(--header-height);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 17, 26, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header .container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

/* Top Navigation (Desktop) - Modified */
nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
}

/* Hide text links on Desktop, keep only Logo if needed. 
   Actually, we want to hide the LINKS but keep the Logo block.
*/
.nav-links-desktop {
  display: none;
  /* Hidden by default on desktop if using sidebar */
}

/* Mobile Nav (Fallback) */
@media (max-width: 1024px) {
  .nav-skills-desktop {
    display: flex;
    /* Show normal nav on smaller screens if sidebar is hidden */
  }
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 600px;
  z-index: 2;
}

.hero h1 {
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.hero-bg-glow {
  position: absolute;
  top: 20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: var(--color-primary);
  filter: blur(150px);
  opacity: 0.2;
  border-radius: 50%;
  z-index: 1;
}

/* Cards (Projects, Skills) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--color-bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  padding: 2rem;
  border-radius: var(--radius-md);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* Effet de survol désactivé pour éviter de penser que la carte est cliquable */

.card h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(56, 189, 248, 0.15);
  /* Bleu ciel rgba */
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* --- LEFT SIDEBAR (Navigation) --- */
.nav-sidebar {
  position: fixed;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /* Glassmorphism background for the whole bar? Or just icons?
     User said "comme le carousel". The carousel uses icons. 
     I'll stick to individual icons.
  */
}

.nav-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  color: var(--color-text-muted);
  position: relative;
  text-decoration: none;
}

.nav-icon:hover,
.nav-icon.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-primary);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
  /* Blue glow */
}

.nav-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

/* Tooltip for Nav Icons */
.nav-icon::after {
  content: attr(title);
  position: absolute;
  left: 70px;
  background: var(--color-bg-card);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.nav-icon:hover::after {
  opacity: 1;
  visibility: visible;
  left: 75px;
}

/* --- RIGHT SIDEBAR (Skills) --- */
.skills-scroller {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  height: 60vh;
  width: 80px;
  overflow: hidden;
  z-index: 50;
  mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 90%, transparent);
}

.skills-track {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: scroll-vertical 20s linear infinite;
  width: 100%;
  align-items: center;
}

.skill-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s;
  padding: 10px;
  cursor: pointer;
}

.skill-icon:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.1);
}

.skill-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes scroll-vertical {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-50%);
  }
}

/* Responsive Logic */
@media (max-width: 1400px) {

  /* On tablets/mobile: Hide Sidebars, Show Top Nav Links */
  .nav-sidebar,
  .skills-scroller {
    display: none;
  }

  .nav-links-desktop {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
  }

  header {
    height: auto;
    padding: 0.5rem 0;
  }

  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  .logo {
    margin-bottom: 0;
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
}

/* Add scroll offset for anchors so title isn't hidden */
html {
  scroll-padding-top: 140px;
  /* Approx height of expanded mobile header */
}

.hero p {
  font-size: 1.1rem;
}

.section-title {
  font-size: 2rem;
}

.container {
  padding: 0 1.5rem;
}

.card-grid {
  gap: 1.5rem;
}

/* Make sure hero content doesn't break */
.hero-content {
  text-align: center;
  margin: 0 auto;
}

.hero-actions {
  justify-content: center;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (min-width: 1401px) {

  /* On Desktop: Show Sidebars, Hide Top text links (keep Logo) */
  .nav-links-desktop {
    display: none;
  }
}


/* Project Details Enhancements */
.project-details {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.project-details h4 {
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.project-details h4:first-child {
  margin-top: 0;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tech-badge {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
}

.card-actions {
  margin-top: 2rem;
}

/* Footer */
footer {
  padding: 4rem 0;
  text-align: center;
  color: var(--color-text-muted);
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, visibility;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: none;
}

/* Table Synthesis */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-top: 2rem;
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.table-synthesis {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.table-synthesis th {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.table-synthesis td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  vertical-align: top;
}

.table-synthesis tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table-synthesis td br {
  margin-bottom: 0.5rem;
  display: block;
}

/* Modal (Lightbox) Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.modal-caption {
  margin-top: 1rem;
  color: #fff;
  font-size: 1.2rem;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

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

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 40px;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  padding: 10px 15px;
  border-radius: 50%;
  transition: background 0.3s;
  user-select: none;
}

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

.modal-prev { left: -60px; }
.modal-next { right: -60px; }

@media (max-width: 768px) {
  .modal-prev { left: 10px; }
  .modal-next { right: 10px; }
}

/* Accordion Projects Layout */
.projects-accordion {
  background: var(--color-bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-radius: var(--radius-md);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  margin-bottom: 2rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.accordion-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none; /* Hide default triangle */
  transition: background 0.3s;
}

.accordion-header::-webkit-details-marker {
  display: none; /* Hide for Safari */
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.accordion-icon {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--color-text-muted);
  transition: transform 0.3s ease;
}

details[open] .accordion-icon {
  transform: rotate(180deg);
  color: var(--color-primary);
}