/* ============================================
   SHARED NAVBAR STYLES
   Reference: index.html navbar implementation
   ============================================ */

/* CSS Variables needed for navbar (can be overridden by page) */
:root {
  --black: #000000;
  --white: #ffffff;
  --orange: #FF6B35;
  --orange-dark: #E55A2B;
  --gray: #6B6560;
  --light-gray: #f5f5f5;
  --nav-max-width: 1280px;
  --announcement-height: 44px;
}

/* ============================================
   NAVIGATION - CORE STYLES
   ============================================ */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--white);
  z-index: 1050;
  padding: 1.5rem 0;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

nav.scrolled {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: var(--white);
}

.nav-container {
  max-width: var(--nav-max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s ease;
  justify-self: start;
}

.logo:hover {
  transform: rotate(-2deg) scale(1.05);
}

.logo img {
  height: 46px;
  transition: height 0.3s ease;
}

nav.scrolled .logo img {
  height: 38px;
}

/* ============================================
   NAV RIGHT - DESKTOP LINKS
   ============================================ */
.nav-right {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  justify-self: end;
}

.nav-right a {
  color: var(--black);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-right a:not(.btn-donate):not(.btn-get-involved)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange);
  transition: width 0.3s ease;
}

.nav-right a:not(.btn-donate):not(.btn-get-involved):hover::after {
  width: 100%;
}

.nav-right a:not(.btn-donate):not(.btn-get-involved):hover {
  color: var(--orange);
  transform: none;
}

/* ============================================
   BUTTON STYLES - DONATE & GET INVOLVED
   ============================================ */
.btn-donate {
  background: var(--orange);
  color: var(--white) !important;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
  border: 2px solid var(--black);
  position: relative;
  overflow: hidden;
  font-size: 0.85rem;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-donate::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--black);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn-donate:hover::before {
  left: 0;
}

.btn-donate:hover {
  transform: scale(1.05);
}

.btn-get-involved {
  background: transparent;
  color: var(--black) !important;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
  border: 2px solid var(--black);
  position: relative;
  overflow: hidden;
  font-size: 0.85rem;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-get-involved::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--black);
  transition: left 0.3s ease;
  z-index: -1;
}

.btn-get-involved:hover::before {
  left: 0;
}

.btn-get-involved:hover {
  color: var(--white) !important;
  transform: scale(1.05);
}

/* ============================================
   DROPDOWN STYLES - DESKTOP
   ============================================ */
.dropdown {
  position: relative;
  display: inline-block;
  height: 100%;
}

.nav-right a.dropdown-trigger {
  display: flex;
  align-items: center;
  height: 100%;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--white);
  min-width: 240px;
  box-shadow: 8px 8px 0 var(--black);
  border: 3px solid var(--black);
  z-index: 1001;
  padding: 0.5rem 0;
  margin-top: 0;
}

/* Invisible bridge to maintain hover state */
.dropdown::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 10px;
}

/* Explicit bridge for content */
.dropdown-content::after {
  content: '';
  position: absolute;
  top: -15px;
  left: 0;
  width: 100%;
  height: 15px;
}

/* Arrow for dropdown box */
.dropdown-content::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 8px 8px 8px;
  border-style: solid;
  border-color: transparent transparent var(--black) transparent;
  z-index: 1002;
}

.dropdown:hover .dropdown-content {
  display: block;
  animation: fadeIn 0.2s ease;
}

.dropdown-item {
  color: var(--black) !important;
  padding: 0.85rem 1.5rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 0.95rem !important;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-item:last-child {
  border-bottom: none;
}

/* Disable the underline effect from parent */
.nav-right .dropdown-item::after {
  display: none !important;
}

.dropdown-item:hover {
  background-color: var(--light-gray);
  padding-left: 1.75rem;
  color: var(--orange) !important;
}

.badge-beta {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dropdown-item:hover .badge-beta {
  background: var(--orange);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ============================================
   MOBILE CONTROLS
   ============================================ */
.mobile-controls {
  display: none;
  gap: 1rem;
  align-items: center;
  justify-self: end;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.mobile-get-involved {
  display: none;
}

.mobile-menu-btn span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--black);
  margin: 6px 0;
  transition: all 0.3s ease;
}

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

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

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* ============================================
   MOBILE MENU - SLIDE IN PANEL
   ============================================ */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: var(--white);
  z-index: 1040;
  padding: 6rem 2rem;
  transition: right 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

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

.mobile-menu a {
  display: block;
  padding: 1.5rem 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  border-bottom: 2px solid var(--black);
  transition: all 0.2s ease;
}

.mobile-menu a:hover {
  color: var(--orange);
  padding-left: 1rem;
}

.mobile-menu a.mobile-sub-item {
  font-size: 1.25rem;
  padding: 0.75rem 0 0.75rem 1.5rem;
  font-weight: 500;
  border-bottom: 1px solid #e5e5e5;
  color: #666;
}

.mobile-menu a.mobile-sub-item:hover {
  color: var(--orange);
  padding-left: 2rem;
}

/* ============================================
   MOBILE ACCORDION OVERRIDES
   ============================================ */
.mobile-menu {
  padding: 5rem 1.5rem 2rem !important;
}

.mobile-menu a {
  font-size: 1.5rem !important;
  padding: 1rem 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.mobile-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--black);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.mobile-dropdown-toggle .arrow {
  transition: transform 0.3s ease;
  font-size: 1.2rem;
}

.mobile-dropdown-toggle.active .arrow {
  transform: rotate(180deg);
  color: var(--orange);
}

.mobile-dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: #f9f9f9;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
}

.mobile-dropdown-content.open {
  max-height: 500px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-dropdown-content a {
  font-size: 1.1rem !important;
  padding: 0.75rem 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
  color: var(--gray) !important;
  padding-left: 1rem !important;
}

.mobile-dropdown-content a:hover {
  color: var(--orange) !important;
  padding-left: 1.5rem !important;
  background: rgba(0, 0, 0, 0.02);
}

/* ============================================
   ANNOUNCEMENT BAR
   ============================================ */
.announcement-bar {
  background: linear-gradient(135deg, var(--orange), #ff8c5a);
  color: white;
  text-align: center;
  padding: 12px 48px;
  font-size: 0.95rem;
  font-weight: 600;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

.announcement-bar a {
  color: white;
  text-decoration: underline;
  font-weight: 700;
}

.announcement-bar a:hover {
  opacity: 0.9;
}

.announcement-close {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
  line-height: 1;
}

.announcement-close:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.2);
}

.announcement-bar.hidden {
  display: none;
}

body.has-announcement nav {
  top: var(--announcement-height) !important;
}

body.has-announcement .mobile-menu {
  top: var(--announcement-height) !important;
  height: calc(100vh - var(--announcement-height)) !important;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Large tablet / small desktop */
@media (max-width: 1200px) {
  .nav-right {
    gap: 1.5rem;
  }

  .nav-right a {
    font-size: 0.95rem;
  }

  .btn-donate,
  .btn-get-involved {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .nav-right {
    gap: 1.25rem;
  }

  .btn-donate,
  .btn-get-involved {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
  }
}

/* Mobile - hide desktop nav, show mobile */
@media (max-width: 968px) {
  .nav-container {
    grid-template-columns: 1fr auto;
    gap: 1rem;
  }

  .nav-right {
    display: none;
  }

  .mobile-controls {
    display: flex;
  }

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

  .mobile-get-involved {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    font-size: 0.72rem;
  }

  .mobile-menu {
    display: block;
  }
}

/* Small mobile */
@media (max-width: 768px) {
  .announcement-bar {
    font-size: 0.85rem;
    padding: 10px 40px 10px 16px;
  }

  .announcement-close {
    right: 8px;
  }
}
