/* Modern SaaS Header Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #b45309; /* Darkened to improve contrast */
  --primary-hover: #9a3412; /* Darkened for better hover state */
  --secondary-color: #0f172a;
  --text-primary: #0f172a; /* Darkened for better contrast */
  --text-secondary: #475569; /* Darkened to meet contrast requirements */
  --background: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.navbar {
  width: 100%;
  padding: 0 1rem;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-logo .logo-image {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.logo-link {
  display: flex;
  align-items: center;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  transition: var(--transition);
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  align-items: center;
}

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

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: -0.01em;
  outline: none; /* Remove default focus outline - we'll add a custom one */
}

/* Add focus styles for keyboard navigation */
.nav-link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 2px;
}

.nav-link:hover {
  color: var(--text-primary) !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

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

/* Style pour l'élément de menu actif */
.nav-link.active {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.05);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Dropdown Menu Styles */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  width: 220px;
  padding: 0.5rem 0;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  visibility: hidden;
  max-height: 60vh;
  overflow-y: auto;
  pointer-events: none;
}

/* Show dropdown when .show class is added */
.dropdown-menu.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

/* Rotate arrow when dropdown is shown */
.dropdown.show .dropdown-arrow {
  transform: rotate(180deg);
}

/* Ensure the dropdown arrow is clickable */
.dropdown-arrow {
  pointer-events: auto !important;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.4rem 1rem;
  clear: both;
  font-weight: 400;
  color: var(--text-secondary);
  text-align: inherit;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  transition: all 0.2s ease;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item:hover, .dropdown-item:focus {
  color: var(--primary-color);
  background-color: #f8fafc;
  outline: none;
}

/* Dropdown section title and divider */
.dropdown-section-title {
  padding: 0.3rem 0.75rem 0.2rem 0.75rem;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.dropdown-divider {
  height: 1px;
  margin: 0.2rem 0;
  background: var(--border-color);
}

.dropdown-arrow {
  margin-left: 0.25rem;
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.25rem;
  border-radius: 0.25rem;
}

.dropdown-arrow:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.dropdown-arrow:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

/* Mobile Styles */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    text-align: center;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 0;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    border: none;
    box-shadow: none;
    padding: 0.5rem 0 0 0;
    margin: 0.5rem 0 0 0;
    opacity: 1;
    transform: none;
    visibility: visible;
    display: none;
    background-color: #f8fafc;
    border-radius: 0.5rem;
  }

  .dropdown-menu.show {
    display: block;
  }

  .dropdown-item {
    text-align: center;
    padding: 0.5rem 1rem;
  }

  .dropdown-section-title {
    justify-content: center;
    padding: 0.5rem 1rem;
  }

  .nav-actions {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .mobile-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .mobile-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .mobile-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
}
