:root{
  --brand-1: #2e3384;
  --brand-2: #2d359c;
  --brand-3: #891117;
  --accent: #e51717;
  --bg: #ffffff;
  --text: #1f2937;
  --light: #ffffff;
  --international-blue: #2563eb;
  --light-blue: #60a5fa;
  --sunshine-yellow: #fbbf24;
  --bright-yellow: #fcd34d;
  --growth-green: #2df2b0;
  --fun-orange: #f97316;
  --soft-white: #f8fafc;
  --warm-gray: #64748b;
  --text-dark: #1e293b;
  --text-light: #ffffff;
  --radius-sm: 6px;
  --gap: 14px;
  --container: 1200px;
}

/* Basic resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: #f6f7fb;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* Top bar */
.site-topbar {
  background: linear-gradient(90deg, #bff3f3, #f3aeea);
  color: var(--text);
  font-weight: 600;
  padding: 8px 0;
}

.topbar-text {
  text-align: center;
  font-size: 0.92rem;
}

/* Header main */
.site-header-main {
  background: var(--brand-2); /* Fallback for Edge */
  background: linear-gradient(90deg, var(--brand-2), var(--brand-2));
  color: var(--light);
  position: -webkit-sticky; /* Safari */
  position: sticky;
  top: 0;
  z-index: 1200;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.header-inner {
  display: flex;
  display: -webkit-flex; /* Safari */
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
  position: relative;
}

/* Brand */
.brand {
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 1px;
  margin-top: 5px;
}

.logo-container {
  display: flex;
  display: -webkit-flex; /* Safari */
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-image-container {
  display: inline-block;
  width: 72px;
  height: 72px;
  background: var(--accent);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  transform: rotate(-2deg);
  -webkit-transform: rotate(-2deg); /* Safari */
  overflow: hidden;
  flex-shrink: 0;
}

.logo-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -o-object-fit: contain; /* Opera */
  display: block;
}

.logo-text {
  display: flex;
  display: -webkit-flex; /* Safari */
  flex-direction: column;
}

.logo-main {
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--light);
  line-height: 1;
}

.logo-subtitle {
  font-size: 1rem;
  color: var(--light);
  font-weight: 600;
}

.logo-tagline {
  font-size: 0.8rem;
  color: var(--light);
  font-style: italic;
  opacity: 0.9;
}

/* Header controls - Two Line Layout */
.header-controls {
  display: flex;
  display: -webkit-flex; /* Safari */
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* First line: Login & Language */
.header-top-line {
  display: flex;
  margin-top: 20px;
  display: -webkit-flex; /* Safari */
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

/* Second line: Search */
.header-bottom-line {
  display: flex;
  display: -webkit-flex; /* Safari */
  justify-content: flex-end;
}

/* Search Form */
.search-form {
  display: flex;
  display: -webkit-flex; /* Safari */
  align-items: center;
  background: rgba(255,255,255,0.12);
  border-radius: 25px;
  padding: 2px 2px;
  min-width: 250px;
}

.search-form input {
  background: transparent;
  border: none;
  color: var(--light);
  padding: 6px 8px;
  width: 100%;
  font-size: 0.95rem;
}

.search-form input::placeholder {
  color: rgba(255,255,255,0.72);
}

.search-form input::-ms-input-placeholder { /* Edge */
  color: rgba(255,255,255,0.72);
}

.search-form button {
  background: none;
  border: none;
  color: var(--light);
  padding: 2px 2px;
  cursor: pointer;
  font-size: 1rem;
}

/* Auth link */
.auth-link {
  display: flex;
  display: -webkit-flex; /* Safari */
  align-items: center;
  gap: 8px;
  color: var(--light);
  background: rgba(255,255,255,0.08);
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-link:hover {
  background: rgba(255,255,255,0.16);
}

/* Language Switch */
.language-switch a {
  display: flex;
  display: -webkit-flex; /* Safari */
  align-items: center;
  gap: 6px;
  color: var(--light);
  background: rgba(255,255,255,0.08);
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.language-switch a:hover {
  background: rgba(255,255,255,0.16);
}

/* Link text */
.link-text {
  display: inline-block;
}

/* Mobile toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--light);
  margin: 4px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
  -webkit-transition: all 0.3s ease; /* Safari */
}

/* Navigation */
.site-nav {
  background: var(--brand-1); /* Fallback for Edge */
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2));
}

.nav-inner {
  display: flex;
  display: -webkit-flex; /* Safari */
  justify-content: center;
}

.nav-list {
  display: flex;
  display: -webkit-flex; /* Safari */
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 10px 0;
}

.nav-item a {
  color: var(--light);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 700;
  display: block;
}

.nav-item a:hover,
.nav-item a:focus {
  background: rgba(255,255,255,0.12);
  color: #bff3f3;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown .dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  background: var(--brand-2); /* Fallback for Edge */
  background: linear-gradient(180deg, var(--brand-2), var(--brand-2));
  opacity: 0;
  visibility: hidden;
  padding: 8px;
  border-radius: 8px;
  margin-top: 8px;
  min-width: 220px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.14);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  -webkit-transition: opacity 0.3s ease, visibility 0.3s ease, -webkit-transform 0.3s ease; /* Safari */
  transform: translateY(-10px);
  -webkit-transform: translateY(-10px); /* Safari */
  margin-top: 15px;
}

.nav-dropdown:hover .dropdown {
  opacity: 0.7;
  visibility: visible;
  transform: translateY(0);
  -webkit-transform: translateY(0); /* Safari */
}

.dropdown li {
  list-style: none;
}

.dropdown a {
  display: block;
  padding: 8px 12px;
  color: var(--light);
  text-decoration: none;
  font-weight: 600;
}

.dropdown a:hover {
  background: rgba(255,255,255,0.06);
}

/* Mobile close button */
.mobile-close {
  display: none;
}

/* Mobile utilities */
.mobile-menu-utilities {
  display: none;
}

/* Responsive: mobile */
@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }
  
  .header-inner {
    align-items: center;
    padding: 15px;
    flex-wrap: wrap;
  }
  
  .brand {
    flex: 1;
    min-width: 0;
  }
  
  .logo-main {
    font-size: 1.5rem;
  }
  
  .logo-subtitle {
    font-size: 0.9rem;
  }
  
  .logo-tagline {
    font-size: 0.7rem;
  }
  
  .link-text {
    display: none;
  }
  
  /* Header Controls Mobile */
  .header-controls {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    position: relative;
  }
  
  .header-top-line {
    display: none;
  }
  
  .header-bottom-line {
    display: none;
  }
  
  .mobile-toggle {
    display: block;
    margin-left: 10px;
  }
  
  /* Mobile toggle animation */
  .mobile-toggle[aria-expanded="true"] .bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    -webkit-transform: rotate(45deg) translate(6px, 6px); /* Safari */
  }
  
  .mobile-toggle[aria-expanded="true"] .bar:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-toggle[aria-expanded="true"] .bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    -webkit-transform: rotate(-45deg) translate(6px, -6px); /* Safari */
  }
  
  /* Mobile Navigation */
  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--brand-1); /* Fallback for Edge */
    background: linear-gradient(180deg, var(--brand-1), var(--brand-2));
    transform: translateX(-100%);
    -webkit-transform: translateX(-100%); /* Safari */
    transition: transform 0.3s ease;
    -webkit-transition: transform 0.3s ease; /* Safari */
    z-index: 1100;
    overflow-y: auto;
    padding-top: 60px;
    width: 100%;
    height: 100%;
  }
  
  .site-nav.nav-open {
    transform: translateX(0);
    -webkit-transform: translateX(0); /* Safari */
  }
  
  .mobile-close {
    display: block;
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    z-index: 1200;
  }
  
  .nav-inner {
    display: block;
    padding: 20px;
    height: 100%;
    overflow-y: auto;
  }
  
  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin-bottom: 30px;
  }
  
  .nav-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .nav-item a {
    display: block;
    padding: 15px 20px;
    font-size: 1.1rem;
    border-radius: 0;
  }
  
  /* Mobile dropdown styles */
  .nav-dropdown .dropdown {
    position: static;
    display: none;
    background: rgba(0,0,0,0.2);
    padding: 0;
    margin: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    -webkit-transform: none; /* Safari */
  }
  
  .nav-dropdown.open .dropdown {
    display: block;
  }
  
  .dropdown a {
    padding: 12px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1rem;
  }
  
  /* Mobile utilities */
  .mobile-menu-utilities {
    display: block;
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
  }
  
  .mobile-menu-utilities .header-top-line {
    display: flex;
    display: -webkit-flex; /* Safari */
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
  }
  
  .mobile-menu-utilities .header-bottom-line {
    display: flex;
    display: -webkit-flex; /* Safari */
  }
  
  .mobile-menu-utilities .search-form {
    width: 100%;
  }
  
  .mobile-menu-utilities .auth-link,
  .mobile-menu-utilities .language-switch a {
    display: flex;
    display: -webkit-flex; /* Safari */
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 12px;
  }
}

/* Edge specific fixes */
@supports (-ms-ime-align:auto) {
  /* Edge 16+ */
  .header-controls {
    display: -ms-flexbox;
    -ms-flex-direction: column;
    -ms-flex-align: end;
  }
  
  .search-form {
    display: -ms-flexbox;
    -ms-flex-align: center;
  }
  
  .site-nav.nav-open {
    transform: translateX(0);
  }
}

/* Legacy Edge support */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  /* IE10+ CSS styles go here */
  .header-controls {
    display: -ms-flexbox;
    -ms-flex-direction: column;
  }
  
  .search-form {
    display: -ms-flexbox;
  }
  
  .nav-list {
    display: -ms-flexbox;
  }
  
  .site-nav {
    background: var(--brand-1);
  }
  
  .site-nav.nav-open {
    left: 0;
  }
}