/* HEADER STYLES */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: #17877c;
  color: white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

header .logo img {
  height: 50px;
}

/* Right side (nav + profile + theme + hamburger) */
.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

/* NAV LINKS */
.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links a {
  text-decoration: none;
  color: white;
  padding: 5px;
  transition: color 0.3s;
}
.nav-links .dropdown-menu li a {
  color: black;
}
.nav-links .dropdown-menu li a:hover {
  color: #ffdd57;
}
.nav-links a:hover { color: #ffdd57; }

/* Dropdown */
.nav-links li { position: relative; }
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  display: none;
  list-style: none;
  min-width: 150px;
  border-radius: 6px;
  overflow: hidden;
}

body.dark-theme .dropdown-menu {
  background: #1a1a1a;
}
body.dark-theme .dropdown-menu li a {
  color: #eee;
}
body.dark-theme .dropdown-menu li:hover {
  background: #333;
}
.dropdown:hover .dropdown-menu { display: block; }

/* Profile + Theme */
#themeToggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}
#profile-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #007bff;
  color: #fff;
  border-radius: 50%;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
}
.profile-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: none;
  list-style: none;
  padding: 10px 0;
  margin: 0;
  min-width: 150px;
  z-index: 1000;
}
.profile-dropdown li { padding: 8px 16px; }
.profile-dropdown li a { text-decoration: none; color: #333; display: block; }
.profile-dropdown li:hover { background: #f5f5f5; }

/* Hamburger button */
.hamburger {
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  /* Logo on left, controls on right */
  header {
    padding: 10px 20px;
  }

  /* Nav hidden by default */
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    background: #17877c;
    padding: 15px;
    border-radius: 6px;
    z-index: 2000;
  }

  .nav-links.mobile-active { 
    display: flex;
  }

  /* Dropdown inside mobile */
  .nav-links .dropdown-menu {
    position: static;
    background: #147267;
    border-radius: 4px;
    margin-top: 5px;
    display: none;
  }
  
  .nav-links .dropdown.open .dropdown-menu { display: block; }
  .nav-links .dropdown-menu li a { color: white; }

  /* Show hamburger */
  .hamburger { display: block; }
  .dropdown:hover .dropdown-menu { display: block; }
}
/* Hide "All Services" link on desktop */
.nav-links .dropdown-menu .mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .nav-links .dropdown-menu .mobile-only {
    display: block;
  }
}

.profile-container {
  position: relative;
   /* anchor for dropdown */
}

.profile-dropdown {
  position: absolute;
  top: 110%; /* just below the profile circle */
  min-width: 150px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  display: none;
  list-style: none;
  padding: 10px 0;
  margin: 0;
  z-index: 1000;
  text-align: center;
  white-space: nowrap;
}
body {
  margin: 0;
  padding: 0;
}
/* Works in Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 8px;   /* make it thinner */
}

::-webkit-scrollbar-track {
  background: #f1f1f1;  /* scrollbar background */
}

::-webkit-scrollbar-thumb {
  background: #888;      /* scrollbar handle */
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;      /* on hover */
}


/* LTR: align dropdown to the right edge */
html[dir="ltr"] .profile-dropdown {
  right: 0;
}

/* RTL: align dropdown to the left edge */
html[dir="rtl"] .profile-dropdown {
  left: 0;
}

/* Dark theme support */
body.dark-theme .profile-dropdown {
  background: #1a1a1a;
  border: 1px solid #444;
}
body.dark-theme .profile-dropdown li a {
  color: #eee;
}
body.dark-theme .profile-dropdown li:hover {
  background: #333;
}
/* Profile container */
.profile-container {
  position: relative;
  display: inline-block;
  font-family: Arial, sans-serif;
}

/* Circle profile icon */
.profile {
  width: 40px;
  height: 40px;
  background-color: #007bff; /* blue circle */
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Dropdown menu */
.profile-dropdown {
  position: absolute;
  top: 50px; /* space below profile icon */
  right: 0;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  list-style: none;
  padding: 4px 0;   /* reduced padding */
  margin: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: none;
  min-width: 110px; /* slightly compact */
  z-index: 1000;
}

/* Show dropdown when active */
.profile-dropdown.show {
  display: block;
}

/* Dropdown items */
.profile-dropdown li {
  margin: 0;
  padding: 0;
}

/* Logout link */
.profile-dropdown li a {
  display: block;
  padding: 6px 12px;  /* reduced whitespace */
  color: #333;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s ease, color 0.2s ease;
  border-radius: 4px;
}

/* Hover effect */
.profile-dropdown li a:hover {
  background-color: #f2f2f2;
  color: #007bff;
}

/* ---------------- DARK MODE ---------------- */
body.dark-theme .profile-dropdown {
  background-color: #1e1e1e;
  border: 1px solid #333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

body.dark-theme .profile-dropdown li a {
  color: #ddd;
}

body.dark-theme .profile-dropdown li a:hover {
  background-color: #333;
  color: #4da6ff;
}
/* ===== Dropdown menu container ===== */
.dropdown-menu,
.profile-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  margin-top: 8px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 1000;
}

/* show when parent hovered (desktop) */
.dropdown:hover > .dropdown-menu,
.profile-container:hover > .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===== Individual items ===== */
.dropdown-menu li a,
.profile-dropdown li a {
  display: block;
  padding: 10px 16px;
  font-size: 0.95rem;
  color: #444;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s;
}

.dropdown-menu li a:hover,
.profile-dropdown li a:hover {
  background: #f5f5f5;
  color: #0f766e; /* accent color */
}

/* ===== Profile dropdown alignment ===== */
.profile-dropdown {
  right: 0;
  left: auto;
}
