/* ==========================================================================
   DESIGN SYSTEM - CB POWER CONCEPT
   ========================================================================== */

:root {
  /* Colors - Clean Industrial Dark Theme style DeWalt */
  --bg-primary: #0f172a; /* Dark Slate Background */
  --bg-secondary: #020617; /* Rich Black Secondary */
  --bg-glass: rgba(15, 23, 42, 0.85); /* Glassmorphism back shadow */
  
  --accent-primary: #eab308; /* Bright Yellow / Lightning Bolt */
  --accent-hover: #ca8a04;
  --accent-secondary: #f8fafc; /* Inverted Slate text for dark backgrounds */
  
  --text-primary: #f8fafc; /* Near white text */
  --text-secondary: #94a3b8; /* Muted text for descriptions */
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(234, 179, 8, 0.4);

  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  /* Layout */
  --container-width: 1200px;
  --spacing-section: 6rem;
  --spacing-element: 2rem;
  --header-height: 80px;
  --border-radius-lg: 16px;
  --border-radius-md: 8px;
  --border-radius-sm: 4px;

  /* Transitions */
  --transition-fast: 0.2s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-out;

  /* Shadows */
  --shadow-glow: 0 0 20px rgba(234, 179, 8, 0.15);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: 3rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #000000;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 179, 8, 0.4);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background-color: rgba(234, 179, 8, 0.1);
}

/* Glass Card */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-glass);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  background-color: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.form-control::placeholder {
  color: rgba(15, 23, 42, 0.4);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  background-color: rgba(249, 115, 22, 0.05);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

select.form-control option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ==========================================================================
   CERTIFICATIONS BADGES
   ========================================================================== */

.certifications-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
}

.badge-certif {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-accent);
  padding: 1rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-glow);
}

.badge-certif:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(249, 115, 22, 0.15);
}

.badge-certif svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* ==========================================================================
   LAYOUT SECTIONS
   ========================================================================== */

/* Header */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition: background-color var(--transition-normal), backdrop-filter var(--transition-normal);
  display: flex;
  align-items: center;
}

.header.scrolled {
  background: rgba(15, 23, 42, 0.95); /* matching --bg-primary with alpha */
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

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

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  max-height: 45px;
  width: auto;
  border-radius: var(--border-radius-sm);
  transition: transform var(--transition-fast);
}

.logo:hover .logo-img {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-weight: 500;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-primary);
  transition: width var(--transition-fast);
}

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

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

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

/* Abstract Background Glow for Hero */
.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
  transform: translate(-50%, -50%);
  z-index: -1;
}

.hero::after {
  content: '';
  position: absolute;
  top: 20%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
  z-index: -1;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

.hero-description {
  font-size: 1.25rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 1.25rem;
  margin-top: 2rem;
}

.hero .btn-primary {
  padding: 1.125rem 3.5rem;
  font-size: 1.125rem;
  border-radius: 50px;
  background-color: var(--accent-primary);
  color: #000000;
  box-shadow: 0 8px 20px rgba(234, 179, 8, 0.3);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hero .btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 25px rgba(234, 179, 8, 0.4);
}

.hero .btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 0.875rem 2.5rem;
  font-size: 0.95rem;
  border-radius: 50px;
  backdrop-filter: blur(4px);
}

.hero .btn-secondary:hover {
  border-color: var(--accent-primary);
  background: rgba(234, 179, 8, 0.05);
}

/* Experience Stats */
.stats-container {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-top: 5rem;
  border-top: 1px solid var(--border-light);
  padding-top: 3rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: block;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Competences Section */
.competences {
  padding: var(--spacing-section) 0;
  background-color: var(--bg-secondary);
  position: relative;
}

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

.competence-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.1);
  color: var(--accent-primary);
  border-radius: var(--border-radius-md);
  margin-bottom: 1.5rem;
}

.competence-icon svg {
  width: 32px;
  height: 32px;
}

.competence-list {
  margin-top: 1.5rem;
}

.competence-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.competence-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-weight: bold;
}

/* Contact Section */
.contact {
  padding: var(--spacing-section) 0;
  position: relative;
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.contact-info-card {
  padding: 3rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.contact-info-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item-icon {
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.contact-item-content h4 {
  margin-bottom: 0.25rem;
  font-size: 1.125rem;
}

.contact-item-content p, .contact-item-content a {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

.contact-item-content a:hover {
  color: var(--accent-primary);
}

.contact-cta-area {
  text-align: center;
}

.contact-cta-area p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.email-highlight {
  display: inline-block;
  padding: 1rem 2rem;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid var(--border-accent);
  border-radius: var(--border-radius-md);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0;
  transition: all var(--transition-normal);
}

.email-highlight:hover {
  background: rgba(249, 115, 22, 0.2);
  transform: scale(1.02);
  box-shadow: var(--shadow-glow);
}

/* Footer */
.footer {
  background-color: var(--bg-secondary);
  padding: 2rem 0;
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-secondary);
}

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

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

/* ==========================================================================
   ANIMATIONS (Scroll Reveal)
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ==========================================================================
   CAROUSEL / RÉALISATIONS
   ========================================================================== */

.carousel-container {
  position: relative;
  max-width: 900px;
  margin: 3rem auto 0 auto;
}

.carousel-window {
  width: 100%;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-glass);
}

.carousel-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.gallery-item {
  flex: 0 0 100%;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-secondary);
}

.gallery-img-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 3rem 2rem 2rem;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.5) 60%, transparent 100%);
  color: #ffffff;
}

.gallery-overlay h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-primary);
}

.gallery-overlay p {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Controls */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 45px;
  height: 45px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
  background: var(--accent-primary);
  color: #000000;
  box-shadow: var(--shadow-glow);
}

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

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(234, 179, 8, 0.3);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.carousel-dot.active {
  background: var(--accent-primary);
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

@media (max-width: 1024px) {
  .carousel-container { padding: 0 1rem; }
  .carousel-btn.prev { left: 1rem; }
  .carousel-btn.next { right: 1rem; }
  .carousel-btn { background: rgba(255,255,255,0.8); backdrop-filter: blur(4px); }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 900px) {
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  
  .stats-container {
    flex-wrap: wrap;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-section: 4rem;
  }

  .nav-links {
    display: none; /* In a real scenario, this would become a hamburger menu */
  }
  
  .mobile-menu-btn {
    display: block;
  }

  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }

  .glass-card {
    padding: 1.5rem;
  }
  
  .email-highlight {
    font-size: 1.2rem;
    padding: 0.75rem 1rem;
  }
}

/* ==========================================================================
   THEME SWITCHER (LIGHT MODE)
   ========================================================================== */

/* Light Mode Variables Override */
body.light-mode {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-glass: rgba(248, 250, 252, 0.85);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-light: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(234, 179, 8, 0.3);
}

/* Light Mode Specific Element Overrides */
body.light-mode .header.scrolled {
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Toggle Button Styling */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent-primary);
  transition: all var(--transition-fast);
  margin-left: 1rem;
}

.theme-toggle-btn:hover {
  background: rgba(234, 179, 8, 0.1);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

/* Icons Logic */
body.light-mode .theme-toggle-btn .sun-icon {
  display: none !important;
}

body.light-mode .theme-toggle-btn .moon-icon {
  display: block !important;
  color: #0f172a; /* Dark moon on light background */
}

/* Specific component fixes for Light Mode */
body.light-mode .glass-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

body.light-mode .contact-item-icon {
  background: rgba(234, 179, 8, 0.05);
}

body.light-mode .footer {
  background: #f1f5f9;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  color: #475569;
}

body.light-mode .carousel-container {
  background: #f8fafc;
}
