/* Universal Header Styles for SEO Library */
/* Based on IndexV2/UniversalPublicHeader design */

/* Reset and Base Styles */
.universal-header * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Header Container */
.universal-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.universal-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Logo Styles */
.header-logo {
  flex-shrink: 0;
}

.logo-link {
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s;
}

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

.logo-gradient {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

/* Navigation Styles */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.desktop-nav {
  display: flex;
}

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

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  color: #4a5568;
  transition: color 0.2s;
  font-family: inherit;
  font-weight: 500;
}

.dropdown-trigger:hover {
  color: #1a202c;
}

.chevron-icon {
  transition: transform 0.2s;
}

.dropdown:hover .chevron-icon,
.dropdown.active .chevron-icon {
  transform: rotate(180deg);
}

/* Dropdown Content */
.dropdown-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  padding: 0.5rem;
  min-width: 320px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  min-width: 500px;
}

.app-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.app-item:hover {
  background: #f7fafc;
}

.app-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.app-icon .icon {
  width: 20px;
  height: 20px;
  color: white;
}

/* Gradient backgrounds for app icons */
.purple-gradient { background: linear-gradient(135deg, #667eea, #764ba2); }
.orange-gradient { background: linear-gradient(135deg, #f093fb, #f5576c); }
.amber-gradient { background: linear-gradient(135deg, #ffd89b, #f9a826); }
.yellow-gradient { background: linear-gradient(135deg, #fcff9e, #ffd700); }
.rose-gradient { background: linear-gradient(135deg, #ff6fd8, #ff3b7d); }
.emerald-gradient { background: linear-gradient(135deg, #00c9ff, #00d084); }
.green-gradient { background: linear-gradient(135deg, #a8ff78, #78ffd6); }
.indigo-gradient { background: linear-gradient(135deg, #667eea, #4c63d2); }
.blue-gradient { background: linear-gradient(135deg, #4facfe, #00f2fe); }

.app-info {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a202c;
  margin-bottom: 0.125rem;
}

.app-desc {
  font-size: 0.75rem;
  color: #718096;
  line-height: 1.2;
}

.app-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 0.25rem;
  margin-top: 0.25rem;
}

.app-badge.popular {
  background: #f0f4ff;
  color: #5a67d8;
}

/* Resources Menu */
.resources-menu {
  min-width: 280px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.resource-item:hover {
  background: #f7fafc;
}

.resource-item.active {
  background: #f0f4ff;
}

.resource-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.academy-icon { background: linear-gradient(135deg, #f093fb, #f5576c); }
.blog-icon { background: linear-gradient(135deg, #a8ff78, #78ffd6); }
.library-icon { background: linear-gradient(135deg, #667eea, #764ba2); }
.faq-icon { background: linear-gradient(135deg, #ffd89b, #f9a826); }

.resource-icon .icon {
  width: 18px;
  height: 18px;
  color: white;
}

.resource-info {
  flex: 1;
  min-width: 0;
}

.resource-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #1a202c;
  margin-bottom: 0.125rem;
}

.resource-desc {
  font-size: 0.75rem;
  color: #718096;
}

.resource-badge {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 600;
  border-radius: 0.25rem;
  margin-left: 0.5rem;
}

.resource-badge.new {
  background: #fef5e7;
  color: #f39c12;
}

/* Direct Navigation Links */
.nav-link {
  padding: 0.5rem 1rem;
  color: #4a5568;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #1a202c;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* Language Switcher */
.language-switcher {
  position: relative;
}

.lang-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #4a5568;
  transition: all 0.2s;
  font-family: inherit;
}

.lang-trigger:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.lang-trigger .flag {
  font-size: 1.2rem;
  line-height: 1;
}

.lang-trigger .lang-name {
  font-weight: 500;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s;
}

.language-switcher:hover .lang-dropdown,
.language-switcher.active .lang-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: #4a5568;
  transition: background 0.2s;
  font-size: 0.9rem;
}

.lang-option:hover {
  background: #f7fafc;
  color: #1a202c;
}

.lang-option[data-lang="{LANG_CODE}"],
.lang-option.active {
  background: #f0f4ff;
  color: #5a67d8;
  font-weight: 500;
}

.lang-option .flag {
  font-size: 1.2rem;
  line-height: 1;
}

/* CTA Buttons */
.btn-login {
  padding: 0.5rem 1.25rem;
  color: #4a5568;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.btn-login:hover {
  color: #1a202c;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-start .arrow-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.btn-start:hover .arrow-icon {
  transform: translateX(2px);
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  gap: 4px;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: #4a5568;
  transition: all 0.3s;
  transform-origin: center;
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translateY(6px);
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translateY(-6px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  transition: transform 0.3s ease;
  transform: translateY(-100%);
}

.mobile-menu[data-state="open"] {
  transform: translateY(0);
}

.mobile-menu-content {
  padding: 1rem;
}

.mobile-section {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.mobile-section-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #1a202c;
  text-align: left;
}

.mobile-section-toggle .chevron-icon {
  transition: transform 0.2s;
}

.mobile-section.open .chevron-icon {
  transform: rotate(90deg);
}

.mobile-section-content {
  display: none;
  padding: 0.5rem 0;
}

.mobile-section.open .mobile-section-content {
  display: block;
}

.mobile-app-link,
.mobile-resource-link,
.mobile-nav-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #4a5568;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.mobile-app-link:hover,
.mobile-resource-link:hover,
.mobile-nav-link:hover {
  background: #f7fafc;
  color: #1a202c;
}

.mobile-resource-link.active {
  background: #f0f4ff;
  color: #5a67d8;
  font-weight: 500;
}

/* Mobile Language Selector */
.mobile-language-selector {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.mobile-lang-label {
  font-size: 0.875rem;
  color: #718096;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.mobile-lang-options {
  display: flex;
  gap: 0.5rem;
}

.mobile-lang-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #4a5568;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.mobile-lang-option:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.mobile-lang-option[data-lang="{LANG_CODE}"],
.mobile-lang-option.active {
  background: #f0f4ff;
  border-color: #667eea;
  color: #5a67d8;
  font-weight: 500;
}

.mobile-lang-option .flag {
  font-size: 1.5rem;
}

/* Mobile CTAs */
.mobile-cta-section {
  display: flex;
  gap: 1rem;
  padding: 1rem;
}

.mobile-btn-login,
.mobile-btn-start {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.mobile-btn-login {
  background: #f7fafc;
  color: #4a5568;
  border: 1px solid #e2e8f0;
}

.mobile-btn-login:hover {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.mobile-btn-start {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mobile-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .header-container {
    padding: 1rem 1.5rem;
  }
  
  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
    min-width: 400px;
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .header-actions {
    display: none;
  }
  
  .mobile-toggle {
    display: flex;
  }
  
  .mobile-menu {
    display: block;
  }
  
  .header-container {
    padding: 0.75rem 1rem;
  }
  
  .logo-gradient {
    font-size: 1.25rem;
  }
}

/* Accessibility */
.universal-header *:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Smooth scrolling for the page when header is sticky */
html {
  scroll-padding-top: 70px;
}

/* Print styles */
@media print {
  .universal-header {
    position: static;
    box-shadow: none;
    border-bottom: 1px solid #000;
  }
  
  .dropdown-content,
  .lang-dropdown,
  .mobile-menu,
  .mobile-toggle {
    display: none !important;
  }
}