/* Modern Anthropic-Style Header for TranslateConnect Pro */

/* Body padding to account for fixed header */
body {
  padding-top: 64px; /* Height of the header */
}

:root {
  /* Light Mode Colors */
  --header-bg: #FFFFFF;
  --header-text: #1A1A1A;
  --header-border: #E5E7EB;
  --header-search-bg: #F3F4F6;
  --header-search-border: #E5E7EB;
  --header-hover: #F9FAFB;
  --header-btn-bg: #0EA5E9;
  --header-btn-hover: #0284C7;
  --header-btn-text: #FFFFFF;
  --header-link: #4B5563;
  --header-link-hover: #1F2937;
  --theme-toggle-bg: #F3F4F6;
  --theme-toggle-hover: #E5E7EB;
  --color-primary: #0EA5E9;
  --bg-primary: #FFFFFF;
  --text-primary: #1A1A1A;
}

[data-theme="dark"] {
  /* Dark Mode Colors */
  --header-bg: #0B1929;
  --header-text: #FFFFFF;
  --header-border: #1E293B;
  --header-search-bg: #1E293B;
  --header-search-border: #334155;
  --header-hover: #1E293B;
  --header-btn-bg: #0EA5E9;
  --header-btn-hover: #38BDF8;
  --header-btn-text: #FFFFFF;
  --header-link: #CBD5E1;
  --header-link-hover: #F1F5F9;
  --theme-toggle-bg: #1E293B;
  --theme-toggle-hover: #334155;
  --color-primary: #0EA5E9;
  --bg-primary: #0B1929;
  --text-primary: #FFFFFF;
}

/* Header Container */
.modern-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Brand Section */
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--header-text);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.header-brand:hover {
  opacity: 0.8;
}

.header-brand img,
.header-brand svg {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.header-brand span {
  display: none;
}

@media (min-width: 640px) {
  .header-brand span {
    display: inline;
  }
}

/* Search Section */
.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 40px;
  background: var(--header-search-bg);
  border: 1px solid var(--header-search-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--header-text);
  transition: all 0.2s ease;
  outline: none;
}

.header-search input::placeholder {
  color: var(--header-link);
  opacity: 0.7;
}

.header-search input:focus {
  border-color: var(--header-btn-bg);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.header-search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234B5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  pointer-events: none;
}

[data-theme="dark"] .header-search::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23CBD5E1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* Actions Section */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Navigation Links */
.header-nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-right: 16px;
}

@media (min-width: 1024px) {
  .header-nav {
    display: flex;
  }
}

.header-nav a {
  padding: 8px 12px;
  color: var(--header-link);
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-nav a:hover {
  color: var(--header-link-hover);
  background: var(--header-hover);
  text-decoration: none !important;
}

.header-nav a:visited,
.header-nav a:active,
.header-nav a:focus {
  text-decoration: none !important;
}

/* Sign Up Button */
.signup-btn {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: var(--header-btn-bg);
  color: var(--header-btn-text);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none !important;
}

@media (min-width: 640px) {
  .signup-btn {
    display: flex;
  }
}

.signup-btn:hover {
  background: var(--header-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
  text-decoration: none !important;
}

.signup-btn:active {
  transform: translateY(0);
  text-decoration: none !important;
}

/* Ensure no underlines in any state */
.signup-btn:link,
.signup-btn:visited,
.signup-btn:focus,
.signup-btn:focus-visible {
  text-decoration: none !important;
}

.signup-btn span {
  text-decoration: none !important;
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--theme-toggle-bg);
  border: 1px solid var(--header-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.theme-toggle:hover {
  background: var(--theme-toggle-hover);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--header-link);
}

/* Theme Icons */
.theme-icon-light,
.theme-icon-dark {
  display: none;
}

[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
  display: block;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--header-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu-btn:hover {
  background: var(--header-hover);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
  color: var(--header-text);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; /* Position right below the fixed header */
  left: 0;
  right: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 999;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.mobile-menu nav a {
  padding: 12px 16px;
  color: var(--header-link);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.mobile-menu nav a:hover {
  color: var(--header-link-hover);
  background: var(--header-hover);
}

.mobile-menu .signup-btn-mobile {
  width: 100%;
  padding: 12px 16px;
  background: var(--header-btn-bg);
  color: var(--header-btn-text);
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu .signup-btn-mobile:hover {
  background: var(--header-btn-hover);
}

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

.header-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 200px;
  background: var(--header-bg);
  border: 1px solid var(--header-border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.header-dropdown:hover .header-dropdown-content,
.header-dropdown:focus-within .header-dropdown-content {
  display: block;
}

.header-dropdown-content a {
  display: block;
  padding: 10px 16px;
  color: var(--header-link);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.header-dropdown-content a:hover {
  background: var(--header-hover);
  color: var(--header-link-hover);
}

/* Language Selector in Header - Modern Glassmorphism Design */
.header-language-select {
  position: relative;
  display: flex; /* Show by default, visibility script will control */
  flex-shrink: 0;
  margin-left: 12px;
}

@media (min-width: 768px) {
  .header-language-select {
    display: block;
  }
}

.header-language-select select {
  appearance: none;
  padding: 10px 36px 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--header-text);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
  outline: none;
}

/* Light theme adjustments */
[data-theme="light"] .header-language-select select {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.header-language-select select:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .header-language-select select:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
}

.header-language-select select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Custom dropdown arrow */
.header-language-select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--header-text);
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.header-language-select:hover::after {
  opacity: 0.8;
}

/* Option styles */
.header-language-select select option {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 8px;
  font-weight: 400;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-menu.active {
  animation: slideDown 0.3s ease;
}

/* Accessibility */
.header-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--header-btn-bg);
  color: var(--header-btn-text);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  z-index: 1001;
}

.header-skip-link:focus {
  top: 0;
}