/**
 * Unified Header Styles for OffsetMy.ai / OffsetOur.ai
 *
 * This stylesheet provides brand-aware header styling.
 * Works with shared-header.js for dynamic header generation.
 *
 * Themes:
 * - [data-brand="offsetmy"] = Light theme (white background, dark text)
 * - [data-brand="offsetour"] = Dark theme (dark background, light text)
 */

/* =========================================================
   BASE HEADER STYLES (Dark theme default - OffsetOur)
   ========================================================= */

.shared-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shared-header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.shared-header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.shared-header-logo img {
  height: 48px;
  width: auto;
  transition: all 0.3s ease;
}

.shared-header-logo:hover img {
  filter: drop-shadow(0 0 12px rgba(247, 168, 216, 0.4));
}

/* Navigation */
.shared-header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.shared-nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.shared-nav-links a {
  color: #a7adbb;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 4px;
}

/* Animated underline */
.shared-nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #f7a8d8, #98b4fd);
  border-radius: 1px;
  transition: width 0.3s ease;
}

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

.shared-nav-links a:hover,
.shared-nav-links a.active {
  color: #f7a8d8;
}

/* CTA Buttons */
.shared-header-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shared-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  background: #202533;
  color: #a7adbb;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.shared-btn-secondary:hover {
  border-color: #98b4fd;
  background: rgba(152, 180, 253, 0.15);
  color: #e6e9ef;
}

.shared-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  background: #f7a8d8;
  color: #0f1115;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3), 0 0 30px rgba(247, 168, 216, 0.2);
}

.shared-btn-primary:hover {
  background: #ffcaeb;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4), 0 0 40px rgba(247, 168, 216, 0.3);
}

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

.shared-mobile-toggle span {
  width: 24px;
  height: 2px;
  background: #a7adbb;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.shared-mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.shared-mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation */
.shared-mobile-nav {
  display: none;
  background: #151821;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem 1.5rem;
}

.shared-mobile-nav.active {
  display: block;
}

.shared-mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.shared-mobile-nav li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shared-mobile-nav li:last-child {
  border-bottom: none;
}

.shared-mobile-nav a {
  color: #a7adbb;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}

.shared-mobile-nav a:hover,
.shared-mobile-nav a.active {
  color: #f7a8d8;
}

/* Header Spacer */
.shared-header-spacer {
  height: 72px;
}

/* =========================================================
   LIGHT THEME OVERRIDES (OffsetMy)
   ========================================================= */

[data-brand="offsetmy"] .shared-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid #e5e7eb;
}

[data-brand="offsetmy"] .shared-header-logo img {
  height: 48px;
}

[data-brand="offsetmy"] .shared-header-logo:hover img {
  filter: none;
  transform: scale(1.02);
}

[data-brand="offsetmy"] .shared-nav-links a {
  color: #374151;
}

[data-brand="offsetmy"] .shared-nav-links a::after {
  background: linear-gradient(90deg, #0d9488, #14b8a6);
}

[data-brand="offsetmy"] .shared-nav-links a:hover,
[data-brand="offsetmy"] .shared-nav-links a.active {
  color: #0f1d32;
}

[data-brand="offsetmy"] .shared-btn-secondary {
  background: transparent;
  color: #374151;
  border: 1px solid #d1d5db;
}

[data-brand="offsetmy"] .shared-btn-secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #0f1d32;
}

[data-brand="offsetmy"] .shared-btn-primary {
  background: #0d9488;
  color: white;
  box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2);
}

[data-brand="offsetmy"] .shared-btn-primary:hover {
  background: #0f766e;
  box-shadow: 0 4px 8px rgba(13, 148, 136, 0.25);
}

[data-brand="offsetmy"] .shared-mobile-toggle span {
  background: #374151;
}

[data-brand="offsetmy"] .shared-mobile-nav {
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

[data-brand="offsetmy"] .shared-mobile-nav li {
  border-bottom: 1px solid #e5e7eb;
}

[data-brand="offsetmy"] .shared-mobile-nav a {
  color: #374151;
}

[data-brand="offsetmy"] .shared-mobile-nav a:hover,
[data-brand="offsetmy"] .shared-mobile-nav a.active {
  color: #0f1d32;
}

[data-brand="offsetmy"] .shared-header-spacer {
  height: 72px;
}

/* =========================================================
   RESPONSIVE STYLES
   ========================================================= */

@media (max-width: 900px) {
  .shared-header-nav {
    display: none;
  }

  .shared-mobile-toggle {
    display: flex;
  }

  .shared-header-logo img {
    height: 40px;
  }

  [data-brand="offsetmy"] .shared-header-logo img {
    height: 40px;
  }

  [data-brand="offsetmy"] .shared-header-spacer {
    height: 72px;
  }
}

@media (max-width: 480px) {
  .shared-header-container {
    padding: 0.5rem 1rem;
  }

  [data-brand="offsetmy"] .shared-header-logo img {
    height: 36px;
  }
}

/* =========================================================
   UTILITY: Hide header in embedded/iframe contexts
   ========================================================= */

body.embedded .shared-header,
body.embedded .shared-header-spacer {
  display: none !important;
}
