/* Main Header with Name and Navigation */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  color: white;
  transition: all 0.3s ease;
}

/* Header Brand (Name) - Left */
.header-brand {
  flex: 0 0 auto;
}

.header-brand h1 {
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  color: white;
}

body.beige-theme .header-brand h1 {
  color: #5a5a5a;
}

/* Header Right Container */
.header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex: 0 0 auto;
  /* keep everything on a single line; nav will shrink or scroll if needed */
  flex-wrap: nowrap;
}

/* Header Navigation - Center */
.header-nav {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap; /* allow links to wrap on very narrow viewports */
  /* allow itself to shrink when container gets tight */
  flex: 1 1 auto;
  min-width: 0;
}


.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.5rem 0;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  position: relative;
/* keep links on one line; shrink or scroll horizontally if container is tight */
   white-space: nowrap;
   flex-shrink: 1;
}

body.beige-theme .nav-link {
  color: #5a5a5a;
}

.nav-link:hover,
.nav-link.active {
  border-bottom-color: white;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

body.beige-theme .nav-link:hover,
body.beige-theme .nav-link.active {
  border-bottom-color: #5a5a5a;
  color: #5a5a5a;
  background: rgba(0, 0, 0, 0.1);
}

body.beige-theme .nav-link.active:hover {
  background: rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

/* Theme Toggle Button */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  padding: 0;
  flex: 0 0 auto;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.theme-toggle:focus {
  outline: 2px solid rgba(255, 255, 255, 0.25);
}

/* Make theme toggle visible on light/beige theme */
body.beige-theme .theme-toggle {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

body.beige-theme .theme-toggle:hover {
  background: rgba(0, 0, 0, 0.12);
}

body.beige-theme .theme-toggle:focus {
  outline: 2px solid rgba(0, 0, 0, 0.12);
}

/* Language Toggle Button (styled pill with flag) */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  transition: transform 0.12s ease, background 0.12s ease;
  padding-left: 10px;
  font-size: 0.9rem;
}

.lang-toggle .flag {
  font-size: 18px;
  display: inline-block;
  line-height: 1;
}

.lang-toggle .label {
  display: inline-block;
  transform-origin: center;
}

.lang-toggle:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(255,255,255,0.12);
}

.lang-toggle:focus {
  outline: 2px solid rgba(255, 255, 255, 0.22);
}

body.beige-theme .lang-toggle {
  background: rgba(0,0,0,0.06);
  color: var(--text-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Adjust main content */
main {
  padding-top: 1rem;
}

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

/* Large Desktop (≥1200px) */
@media (max-width: 1200px) {
  .main-header {
    padding: 0.9rem 1.8rem;
  }

  .header-brand h1 {
    font-size: 1.5rem;
  }

  .header-nav {
    gap: 2rem;
  }

  .nav-link {
    font-size: 0.9rem;
  }
}

/* Tablet (≤1024px) */
@media (max-width: 1024px) {
  .main-header {
    padding: 0.8rem 1.5rem;
  }

  .header-brand h1 {
    font-size: 1.3rem;
    letter-spacing: 0.3px;
  }

  .header-nav {
    gap: 1.5rem;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 0.4rem 0;
  }

  .header-right {
    gap: 1.5rem;
  }
}

/* Small Tablet (≤768px) */
@media (max-width: 768px) {
  .main-header {
    padding: 0.7rem 1rem;
  }

  .header-brand h1 {
    font-size: 1.1rem;
    letter-spacing: 0.2px;
  }

  .header-nav {
    gap: 1.2rem;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 0.3rem 0;
  }

  .header-right {
    gap: 1rem;
  }
}

/* Large Mobile (≤640px) */
@media (max-width: 640px) {
  .main-header {
    padding: 0.6rem 0.8rem;
  }

  .header-brand h1 {
    font-size: 0.95rem;
    letter-spacing: 0.1px;
  }

  .header-nav {
    gap: 0.8rem;
  }

  .nav-link {
    font-size: 0.65rem;
    padding: 0.2rem 0;
    letter-spacing: 0.3px;
  }

  .header-right {
    gap: 0.8rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
  .main-header {
    padding: 0.5rem 0.6rem;
  }

  .header-brand h1 {
    font-size: 0.85rem;
    letter-spacing: 0;
  }

  .header-nav {
    gap: 0.6rem;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
  }

  .nav-link {
    font-size: 0.6rem;
    padding: 0.2rem 0;
    letter-spacing: 0.2px;
  }

  .header-right {
    gap: 0.6rem;
    flex-wrap: nowrap;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Extra Small Mobile (≤360px) */
@media (max-width: 360px) {
  .main-header {
    padding: 0.4rem 0.5rem;
  }

  .header-brand h1 {
    font-size: 0.75rem;
  }

  .header-nav {
    gap: 0.4rem;
  }

  .nav-link {
    font-size: 0.55rem;
    padding: 0.1rem 0;
  }

  .header-right {
    gap: 0.4rem;
  }
}

.profile-img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0px 0px 25px 2px rgba(236, 0, 4, 0.5),
    0 4px 24px 0 rgba(255, 78, 80, 0.25);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55),
    box-shadow 0.3s;
  background: rgba(255, 255, 255, 0.2);
}

.profile-img:hover {
  transform: scale(1.12) rotate(-6deg);
  box-shadow: 0 8px 32px 0 rgba(255, 78, 80, 0.45),
    0 0 0 8px rgba(255, 255, 255, 0.12);
}

.profile-info {
  text-align: left;
}

.profile-info h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.1px;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  line-height: 1.1;
}

.profile-info p {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.9;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}

.profile-bio {
  display: block;
  font-size: 0.95rem;
  color: #eee;
  font-weight: 400;
  margin-top: 0.4rem;
}

.profile-bio a {
  color: #fffce1;
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.profile-bio a:hover {
  color: #008cff;
  text-shadow: 0 2px 8px rgb(26, 19, 19);
}

.social-links {
  margin-top: 0.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.social-links a {
  color: white;
  font-size: 1.2rem;
  transition: var(--transition);
}

.social-links a:hover {
  color: rgba(255, 187, 0, 0.621);
  transform: translateY(-3px);
}
