/* ===================
   1. Global Styles
=================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: white;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 2.38rem;
  padding-top: 100px;
}

h2 {
  font-size: 2rem;
  font-weight: bold;
  margin: 1.2rem 0 0.8rem 0;
}

/* ===================
   2. Navigation Bar
=================== */

.navbar {
  height: auto;
  min-height: 8rem;
  background: white !important;
  /* Add signature arc to left and right bottom */
  border-bottom-left-radius: 2.5rem;
  border-bottom-right-radius: 2.5rem;
  /* border-radius: none; */
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.navbar-brand {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0; /* Remove extra space */
  /* Remove underline */
  /* border-bottom: 1px solid rgba(0, 0, 0, 0.1); */
  position: relative; /* Ensure children can be absolutely positioned */
}

.navbar-brand img {
  height: 4rem;
  width: auto;
}

.navbar-brand h1 {
  font-size: 2rem;
  text-align: center;
  flex-grow: 1;
  font-weight: bold;
  margin: 0 1rem;
}

#darkModeToggle {
  margin-left: 1rem;
  background: #fff;
  border: 2px solid #eee;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  width: 2.7rem;
  height: 2.7rem;
  min-width: 2.7rem;
  min-height: 2.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.2s, border 0.2s;
  z-index: 1200;
}
#darkModeToggle:hover {
  background: #f5f5f5;
  border-color: #3273dc;
}
#darkModeIcon {
  color: #222;
  font-size: 1.1rem;
  transition: color 0.2s;
}
body.dark-mode #darkModeToggle {
  background: #23272a;
  border: 2px solid #444;
}
body.dark-mode #darkModeIcon {
  color: #ffe066;
  text-shadow: 0 0 8px #23272a;
}

.navbar-menu {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.menu-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
}

.menu-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  height: 2.5rem;
  padding: 0 1.2rem;
  background: linear-gradient(90deg, #171717 60%, #020202 100%);
  color: #fff;
  border: none;
  border-radius: .5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(50,115,220,0.07);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: pointer;
  outline: none;
  margin: 0;
  position: relative;
  z-index: 1;
}

.menu-link:hover, .menu-link:focus {
  background: linear-gradient(90deg, #00d1b2 0%, #3273dc 100%);
  color: #fff;
  box-shadow: 0 0 12px #00d1b2, 0 2px 8px rgba(50,115,220,0.13);
  transform: translateY(-2px) scale(1.07);
  text-decoration: none;
}

.menu-link.active,
.menu-link[aria-current="page"] {
  background: #23272a;
  color: #ffe066;
  font-weight: 600;
  box-shadow: 0 0 0 2px #ffe066;
}

.navbar-burger {
  display: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
  margin-left: auto;
  z-index: 100;
  /* Remove margin-left:auto for mobile, handled below */
}
.navbar-burger span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: #333;
  margin: 6px 0;
  transition: all 0.3s ease-in-out;
  position: relative;
}
.navbar-burger.is-active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.navbar-burger.is-active span:nth-child(2) {
  opacity: 0;
}
.navbar-burger.is-active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media screen and (max-width: 900px) {
  .navbar {
    min-height: 3.2rem;
    padding: 0.1rem 0.2rem;
    z-index: 10000;
    /* Keep arc on mobile but smaller */
    border-bottom-left-radius: 1.2rem;
    border-bottom-right-radius: 1.2rem;
  }
  .navbar-brand {
    width: 100vw !important;
    max-width: 100vw;
    flex-wrap: wrap;
    overflow: hidden;
  }
  .navbar-brand img {
    height: 2.2rem;
    max-width: 22vw;
  }
  .navbar-brand h1 {
    font-size: 1.1rem;
    margin: 0 0.3rem;
    flex-shrink: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #darkModeToggle {
    margin-left: 0.5rem;
    width: 2.2rem;
    height: 2.2rem;
    min-width: 2.2rem;
    min-height: 2.2rem;
    font-size: 1rem;
  }
  .navbar-burger {
    display: block !important;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    z-index: 1201;
  }
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
  }
}

/* ===================
   3. Footer Styles
=================== */
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  padding-bottom: 0.5rem;
}

.footer-logo {
  order: 1;
  grid-column: 1;
  grid-row: 1;
  padding: 1rem 0.5rem;
  margin: 0;
}
.footer-menu {
  order: 2;
  grid-column: 2;
  grid-row: 1;
  padding: 1rem 0.5rem;
  margin: 0;
}
.footer-important-links {
  order: 3;
  grid-column: 3;
  grid-row: 1;
  padding: 1rem 0.5rem;
  margin: 0;
}
.footer-contact {
  order: 4;
  grid-column: 4;
  grid-row: 1;
  padding: 1rem 0.5rem;
  margin: 0;
}
.page-counter {
  order: 5;
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0.7rem auto 0;
  padding: 0.4rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: fit-content;
}

.footer {
  background-color: #ffffff;
  padding: 3rem 1.5rem;
  width: 100%;
  margin-top: 2rem;
  position: relative;
  box-shadow: 0 -5px 15px rgba(74, 74, 74, 0.05);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3273dc, #00d1b2);
  box-shadow: 0 -2px 10px rgba(50, 115, 220, 0.3);
}

.footer-logo, 
.footer-menu, 
.footer-contact,
.footer-important-links {
  padding: 1.5rem;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: none;
}

.footer-logo:hover, 
.footer-menu:hover, 
.footer-contact:hover,
.footer-important-links:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
}

.footer-menu ul,
.footer-important-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-menu a,
.footer-important-links a {
  color: #4a4a4a;
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
  font-size: 1rem;
  position: relative;
  padding: 0.2rem 0;
}

.footer-menu a:hover,
.footer-important-links a:hover {
  color: #3273dc;
  text-decoration: underline;
}

.footer h4 {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #3273dc, #00d1b2);
  border-radius: 2px;
}

@media screen and (max-width: 1024px) {
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-logo { order: 1; grid-column: 1; grid-row: 1; }
  .footer-menu { order: 2; grid-column: 2; grid-row: 1; }
  .footer-important-links { order: 3; grid-column: 1; grid-row: 2; }
  .footer-contact { order: 4; grid-column: 2; grid-row: 2; }
  .page-counter { order: 5; grid-column: 1 / -1; grid-row: 3; }
}

@media screen and (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
  }
  .footer-logo { order: 1; grid-column: 1; grid-row: 1; }
  .footer-menu { order: 2; grid-column: 1; grid-row: 2; }
  .footer-important-links { order: 3; grid-column: 1; grid-row: 3; }
  .footer-contact { order: 4; grid-column: 1; grid-row: 4; }
  .page-counter { order: 5; grid-column: 1; grid-row: 5; }
  .footer-logo,
  .footer-menu,
  .footer-contact,
  .footer-important-links {
    /* Keep left align for mobile */
    align-items: flex-start !important;
    text-align: left !important;
  }
}

/* ===================
   4. Member Card Styles
=================== */
.member-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin: 1rem auto;
  max-width: 800px;
  display: flex;
  gap: 2rem;
  align-items: start;
}

.member-image {
  flex: 0 0 300px;
}

.member-info {
  flex: 1;
}

@media screen and (max-width: 768px) {
  .member-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .member-image {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 1rem auto;
    flex: none;
  }
  .member-info {
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
  }
}

/* ===================
   5. Responsive Styles
=================== */
@media screen and (max-width: 768px) {
  .member-card {
    flex-direction: column;
    padding: 1rem;
  }

  .member-image {
    flex: 0 0 auto;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .navbar-burger {
    display: block;
  }

  .navbar-menu {
    display: none;
  }

  .navbar-menu.is-active {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background: rgba(20, 20, 20, 0.25);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-radius: 18px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    z-index: 2000;
    border: 1px solid rgba(255,255,255,0.3);
  }

  .menu-buttons {
    flex-direction: column;
  }

  .footer-container {
    grid-template-columns: 1fr;
  }
}

/* Off-canvas Menu - FIXED */
.off-canvas-menu {
    position: fixed;
    top: 0;
    right: -300px; /* Start hidden off-screen */
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    z-index: 1001; /* Higher than your navbar's z-index: 1000 */
    transition: right 0.4s ease;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.off-canvas-menu.active {
    right: 0; /* Slide in when active */
}

/* Overlay - FIXED */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}

/* Move Up Button Styles */
#moveUpBtn {
  display: none;
  position: fixed;
  bottom: 2.2rem;
  right: 2.2rem;
  z-index: 1200;
  background: #3273dc;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 3.2rem;
  height: 3.2rem;
  box-shadow: 0 4px 16px rgba(50,115,220,0.25);
  font-size: 1.7rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
#moveUpBtn:hover {
  background: #00d1b2;
  box-shadow: 0 0 24px #00d1b2, 0 4px 16px rgba(50,115,220,0.25);
  transform: scale(1.12);
}

/* Page counter styles */
.page-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.2rem;
  font-size: 1.05rem;
  color: #3273dc;
  background: rgba(50, 115, 220, 0.07);
  border-radius: 1.2rem;
  padding: 0.4rem 1.2rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(50,115,220,0.07);
  gap: 0.7rem;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  transition: background 0.2s, color 0.2s;
  flex-wrap: wrap;
}
.page-counter i {
  color: #00d1b2;
  font-size: 1.2rem;
  margin-right: 0.4rem;
  justify-content: center;
  text-align: center;
}
.online-users {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.05rem;
  color: #3273dc;
  margin-left: 1.2rem;
  background: rgba(0, 209, 178, 0.08);
  border-radius: 1.2rem;
  padding: 0.3rem 0.9rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.online-users i {
  color: #00d1b2;
  font-size: 1.1rem;
  margin-right: 0.2rem;
}
.mini-worldmap {
  width: 48px;
  height: 28px;
  margin-left: 0.5rem;
  vertical-align: middle;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(50,115,220,0.09);
  object-fit: cover;
  background: #eaf6fa;
}

/* Footer grid items left align across all devices */
.footer-logo,
.footer-menu,
.footer-contact,
.footer-important-links {
  text-align: left !important;
  align-items: flex-start !important;
}

/* Utility classes for responsive visibility */
.desktop-only { display: inline-flex !important; }
.mobile-only { display: none !important; }

@media screen and (max-width: 900px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
}

/* Another bar styles */
.another-bar {
  width: 100%;
  box-sizing: border-box; /* Ensure padding doesn't overflow */
  width: 100vw;
  max-width: 100vw;
  position: fixed;
  top: 8.5rem; /* Place below navbar (navbar min-height is 8rem on desktop, adjust for mobile if needed) */
  left: 0;
  z-index: 1; /* Higher than navbar but lower than off-canvas menu */
  /* background: linear-gradient(90deg, #23272a 50%, #181a1b 100%); */
  background-color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 0.35rem 1.1rem 0.35rem 0.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border-bottom-left-radius: 1.2rem;
  border-bottom-right-radius: 1.2rem;
}
.another-bar.mobile-only {
  display: flex !important;
}
.another-bar button {
  background: #23272a;
  color: #ffe066;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  cursor: pointer;
  margin: 0;
}
.another-bar button:hover {
  background: #00d1b2;
  color: #fff;
  box-shadow: 0 0 12px #00d1b2, 0 2px 8px rgba(50,115,220,0.13);
}
.another-bar .navbar-burger span {
  background: #ffe066;
}
@media screen and (max-width: 900px) {
  .another-bar {
    top: 3.2rem; /* Place below mobile navbar (navbar min-height is 3.2rem on mobile) */
  }
}
