/**
 * Header Styles
 * Styles for the persistent header that appears across all modes
 */

.header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 0;
  background: var(--header-blue);
  color: white;
  flex-shrink: 0;
  width: 100%;
}

/* Header left section (logo + scroll selector) */
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Browse-specific header controls - hidden by default, shown only in Browse mode */
#sefer-torah-container,
year-kriyah-selector {
  display: none;
}

body.browse-mode-active #sefer-torah-container,
body.browse-mode-active year-kriyah-selector {
  display: inline-block;
}

/* Hide scroll selector when only one collection is available */
#sefer-torah-container.hidden-single-collection {
  display: none !important;
}

#synagogue-logo {
  height: 40px;
  width: auto;
  background: white;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 10px 20px 10px 20px;
}

#sefer-torah-container {
  align-items: center;
  gap: 8px;
}

#sefer-torah-container label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

#sefer-torah-dropdown {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
  cursor: pointer;
}

#sefer-torah-dropdown:hover {
  background: rgba(255, 255, 255, 0.15);
}


/* Header bookmark container - shown only in Browse mode, centered over main content */
.header-bookmark-container {
  display: none;
  position: absolute;
  /* Center over main content area: 50% + half of sidebar width (320px / 2 = 160px) */
  left: calc(50% + 160px);
  transform: translateX(-50%);
  bottom: 8px;
  align-items: center;
  justify-content: center;
}

body.browse-mode-active .header-bookmark-container {
  display: flex;
}

/* Ensure header-info can contain absolutely positioned children */
.header-info {
  position: relative;
}

/* Header center section (mode tabs) */
.header-center {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  padding-right: 20px;
}

/* Legacy mode tabs styling - kept as fallback if Web Component fails to load (Phase 1A) */
.mode-tabs-temp {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px;
}

.mode-tab {
  padding: 8px 20px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.mode-tab.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-tab:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Keyboard shortcut hints (Phase 4) */
.mode-tab::after {
  content: attr(data-shortcut);
  font-size: 11px;
  margin-left: 6px;
  opacity: 0.5;
  font-weight: 400;
}

/* Specific shortcuts for each mode */
.mode-tab[data-mode="browse"]::after {
  content: "⌘1";
}

.mode-tab[data-mode="learn"]::after {
  content: "⌘2";
}

.mode-tab[data-mode="teach"]::after {
  content: "⌘3";
}

.mode-tab[data-mode="calendar"]::after {
  content: "⌘4";
}

.mode-tab[data-mode="resources"]::after {
  content: "⌘5";
}

/* Hide shortcuts on smaller screens to save space */
@media (max-width: 768px) {
  .mode-tab::after {
    display: none;
  }
}

/* Header right section (account) */
.header-right {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.account-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* User icon styling */
.account-btn::before {
  content: "👤";
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

/* Responsive */
@media (max-width: 1024px) {
  .header-info {
    gap: 12px;
  }

  .header-left {
    gap: 12px;
  }

  .mode-tab {
    padding: 6px 16px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .header-info {
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left {
    order: 1;
  }

  .header-bookmark-container {
    /* On mobile, sidebar is hidden so center normally */
    left: 50%;
    position: absolute;
  }

  .header-right {
    order: 3;
  }

  .header-center {
    order: 4;
    width: 100%;
    margin-top: 8px;
  }

  #synagogue-logo {
    height: 32px;
  }
}
