:root {
  /* Color Variables */
  --primary-red: #d91951;
  --primary-blue: #004890;
  --header-height: 100px;
  --news-banner-height: 40px;
}

/* News Banner */
.news-banner {
  padding: 0;
  background: #004890;
  color: var(--white);
  height: var(--news-banner-height);
  width: 100%;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  z-index: 1001; /* Higher than header's z-index: 1000 */
}

.news-content {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: var(--spacing-md);
  padding: 0 var(--spacing-lg);
}

.news-icon {
  font-size: 16px;
  color: #ffd700;
}

.news-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  background: var(--primary-red);
  padding: 4px 8px;
  border-radius: 4px;
}

/* News Ticker Container */
.news-ticker-container {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* OLD NEWS TICKER STYLES - REMOVED TO PREVENT CONFLICTS */

.header-actions .btn {
  min-width: 100px !important;
  max-width: 120px;
  width: 100%;
  text-align: center;
}

/* OLD NEWS ITEM STYLES - REMOVED TO PREVENT CONFLICTS */

/* Header */
.header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 40px;
  z-index: 1000;
  height: var(--header-height);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo-img {
  height: 50px; /* Reduced from 120px */
  width: auto;
}

img.logo-img {
  height: 80px;
}

/* Navigation */
.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
  list-style: none;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: color 0.3s ease;
  padding: var(--spacing-sm) 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-red);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-red);
  border-radius: 1px;
}

.nav-dropdown {
  position: relative;
}

.dropdown-arrow {
  margin-left: var(--spacing-xs);
  font-size: 12px;
  transition: transform 0.3s ease;
}

.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: 8px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 9997;
  margin-top: var(--spacing-sm);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--text-dark);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: all 0.3s ease;
}

.dropdown-item:hover {
  background: var(--light-gray);
  color: var(--primary-red);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* Button Styles */
.btn {
  color: var(--white) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: 6px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary-red) !important;
  color: var(--white) !important;
}

.btn-primary:hover {
  background-color: #c21547;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.btn-secondary {
  background-color: var(--primary-blue) !important;
  color: var(--white) !important;
}

.btn-secondary:hover {
  background: #003a75 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 72, 144, 0.3);
}

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

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  transition: all 0.3s ease;
  border-radius: 1px;
}

/* Mobile Menu Active States */
.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* Hide mobile actions on desktop */
.mobile-header-actions {
  display: none;
}

/* Responsive Design */

/* Two-row layout: Nav links on top, buttons on bottom */
@media (max-width: 1416px) {
  .nav-wrapper {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
    padding: var(--spacing-md) 0;
  }

  .logo {
    order: 1;
    flex: 0 0 auto;
  }

  .nav-menu {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-sm);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }

  .header-actions {
    order: 2;
    margin-left: auto;
  }

  .mobile-menu-toggle {
    order: 4;
  }

  .header {
    height: auto;
  }
}

@media (max-width: 1200px) {
  .header-actions {
    gap: var(--spacing-sm);
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
  }
}

@media (max-width: 1100px) {
  .nav-menu {
    gap: var(--spacing-lg);
  }

  .nav-link {
    font-size: 13px;
  }

  .header-actions {
    gap: var(--spacing-xs);
  }

  .btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 13px;
    min-width: 80px;
  }
}

@media (max-width: 1000px) {
  .nav-menu {
    gap: var(--spacing-md);
  }

  .nav-link {
    font-size: 12px;
  }

  .header-actions {
    gap: var(--spacing-xs);
  }

  .btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 12px;
    min-width: 70px;
  }
}

@media (max-width: 900px) {
  .nav-menu {
    gap: var(--spacing-sm);
  }

  .nav-link {
    font-size: 11px;
  }

  .header-actions {
    gap: var(--spacing-xs);
  }

  .btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 11px;
    min-width: 60px;
  }
}

@media (max-width: 850px) {
  .logo-img {
    height: 50px;
  }

  img.logo-img {
    height: 60px;
  }

  .nav-menu {
    gap: 10px;
  }

  .nav-link {
    font-size: 10px;
  }

  .btn {
    padding: 6px 8px;
    font-size: 10px;
    min-width: 55px;
  }
}

@media (max-width: 1024px) {
  .header-actions {
    gap: var(--spacing-sm);
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
  }
}

/* Mobile hamburger menu - only activate on smaller screens */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + var(--news-banner-height));
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    z-index: 999;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-height: calc(100vh - var(--header-height) - var(--news-banner-height));
    overflow-y: auto;
  }

  .nav-menu.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--light-gray);
    width: 100%;
    font-size: var(--font-size-base);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-dropdown {
    width: 100%;
  }

  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    margin-top: var(--spacing-sm);
    margin-left: var(--spacing-md);
    background: var(--light-gray);
    border-radius: 4px;
    min-width: auto;
  }

  .nav-dropdown:hover .dropdown-menu {
    margin-top: 0;
    opacity: 1;
    visibility: visible;
  }

  /* Show mobile header actions */
  .mobile-header-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--light-gray);
    width: 100%;
  }

  .mobile-header-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .header-actions {
    display: none;
  }

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

  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden;
  }

  .logo-img {
    height: 40px;
  }

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

.header .container {
  overflow: visible;
}

/* ============================================================================
   NEWS TICKER - PRIMARY DEFINITION
   Updated: 2025-10-10 - Fixed animation issues across browsers
   DO NOT duplicate in other CSS files - this is the single source of truth
   ============================================================================ */

.news-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  /* Ensure hardware acceleration for smoother animation */
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.news-ticker-content {
  display: flex !important;
  align-items: center;
  gap: 2rem; /* Using fixed value instead of var for better compatibility */
  white-space: nowrap;
  /* Default animation - will be overridden by JavaScript */
  animation: scroll-ticker 50s linear infinite;
  animation-play-state: running;
  padding-left: 100%;
  /* Hardware acceleration for better performance */
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* Fallback for older browsers */
  -webkit-animation: scroll-ticker 50s linear infinite;
  -moz-animation: scroll-ticker 50s linear infinite;
  -o-animation: scroll-ticker 50s linear infinite;
  /* Force animation to start immediately */
  animation-fill-mode: both;
  -webkit-animation-fill-mode: both;
  -moz-animation-fill-mode: both;
  -o-animation-fill-mode: both;
}

.news-ticker .news-item {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
}

.news-separator {
  width: 4px;
  height: 4px;
  background: var(--white);
  border-radius: 50%;
  opacity: 0.7;
  display: inline-block;
  margin: 0 1.5rem;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

/* Keyframe animation - Standard */
@keyframes scroll-ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Webkit-specific keyframes for Safari and older Chrome */
@-webkit-keyframes scroll-ticker {
  0% {
    -webkit-transform: translateX(0);
  }
  100% {
    -webkit-transform: translateX(-100%);
  }
}

/* Mozilla-specific keyframes for Firefox */
@-moz-keyframes scroll-ticker {
  0% {
    -moz-transform: translateX(0);
  }
  100% {
    -moz-transform: translateX(-100%);
  }
}

/* Opera-specific keyframes */
@-o-keyframes scroll-ticker {
  0% {
    -o-transform: translateX(0);
  }
  100% {
    -o-transform: translateX(-100%);
  }
}

/* Pause animation on hover */
.news-ticker:hover .news-ticker-content {
  animation-play-state: paused !important;
  -webkit-animation-play-state: paused !important;
}

/* Remove any conflicting styles */
.ticker-content {
  display: none;
}

/* CSS-only fallback for users with JavaScript disabled */
.no-js .news-ticker-content {
  animation: scroll-ticker 90s linear infinite;
  -webkit-animation: scroll-ticker 90s linear infinite;
  -moz-animation: scroll-ticker 90s linear infinite;
  -o-animation: scroll-ticker 90s linear infinite;
}

/* Ensure animation works even if JavaScript fails to load */
.news-ticker-content:not([style*="animation-duration"]) {
  animation: scroll-ticker 90s linear infinite !important;
  -webkit-animation: scroll-ticker 90s linear infinite !important;
  -moz-animation: scroll-ticker 90s linear infinite !important;
  -o-animation: scroll-ticker 90s linear infinite !important;
}

/* Force animation to work - override any conflicting styles */
.news-ticker-content {
  animation: scroll-ticker 90s linear infinite !important;
  -webkit-animation: scroll-ticker 90s linear infinite !important;
  -moz-animation: scroll-ticker 90s linear infinite !important;
  -o-animation: scroll-ticker 90s linear infinite !important;
}

/* Debug styles - remove in production */
.news-ticker-content::before {
  content: "TICKER DEBUG: Animation should be running";
  position: absolute;
  top: -20px;
  left: 0;
  font-size: 10px;
  color: red;
  background: yellow;
  padding: 2px;
  z-index: 9999;
  display: none; /* Set to block for debugging */
}
