/* Base */
* { box-sizing: border-box; }
body { margin: 0; font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.6; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  width: 100%;
}

.nav__brand { display:flex; align-items:center; text-decoration:none; transition: transform 0.2s ease; flex-shrink: 0; }
.nav__brand:hover { transform: scale(1.02); }
.nav__brand img { height:45px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1)); }

/* ------------------ Desktop Navigation ------------------ */
.nav__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  row-gap: 6px;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: flex-end;
}

.nav__links li a {
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  transition: color 0.22s ease, transform 0.18s ease, background 0.18s ease;
  position: relative;
  overflow: visible;
  display: inline-block;
}

.nav__links li a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 0;
  height: 2px;
  background: #cc4d04;
  transform: translateX(-50%);
  transition: width 0.28s cubic-bezier(.2,.9,.2,1);
  border-radius: 2px;
}

.nav__links li a:hover {
  color: #cc4d04;
  transform: translateY(-1px);
  background: rgba(204,77,4,0.04);
}
.nav__links li a:hover::after { width: 64%; }
.nav__links li a.active { color: #cc4d04; }
.nav__links li a.active::after { width: 64%; }

.register-btn {
  background: rgba(204,77,4,0.08) !important;
  color: #cc4d04 !important;
  border: 1px solid rgba(204,77,4,0.16);
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  transition: background 0.18s ease, box-shadow 0.12s ease;
}
.register-btn:hover {
  background: rgba(204,77,4,0.14) !important;
  box-shadow: 0 6px 18px rgba(204,77,4,0.06);
}

.login-btn {
  background: linear-gradient(135deg,#cc4d04,#993a03) !important;
  color: #fff !important;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(153,58,3,0.08);
}
.login-btn:hover { filter: brightness(1.03); transform: translateY(-1px); }

.logout-btn {
  background: rgba(239,68,68,0.1) !important;
  color: #dc2626 !important;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
}
.logout-btn:hover {
  background: rgba(239,68,68,0.18) !important;
  color: #b91c1c !important;
}

.nav__links a:focus,
.nav__links a:focus-visible,
.register-btn:focus,
.login-btn:focus,
.logout-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(204,77,4,0.12);
  border-radius: 8px;
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav { padding: 0.75rem 1rem; }
}

/* ------------------ Mobile toggle ------------------ */
.nav__toggle {
  /* Fixed: explicit size prevents flexbox stretching it across the nav */
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-left: auto;       /* push to far right */
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;              /* no padding — size is controlled by width/height */
  display: none;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  border-radius: 8px;
  transition: background 0.18s ease;
}
.nav__toggle:hover  { background: rgba(0,0,0,0.05); }
.nav__toggle:active { transform: scale(0.96); }

@media (max-width: 768px) {
  .nav__toggle { display: flex; }
}

/* Overlay */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 998;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.overlay.show { opacity: 1; visibility: visible; }

/* Drawer */
.drawer {
  position: fixed; left: 0; right: 0; bottom: -100%;
  background: #ffffff; padding: 0;
  box-shadow: 0 -4px 25px rgba(0,0,0,0.15);
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  transition: bottom 0.4s cubic-bezier(0.4,0,0.2,1);
  z-index: 999;
  max-height: 70vh; overflow-y: auto;
}
.drawer.open { bottom: 0; animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1); }
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.drawer__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.drawer__header h3 { margin: 0; color: #1f2937; font-size: 1.15rem; font-weight: 600; }

.drawer__links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.drawer__links li { border-bottom: 1px solid rgba(0,0,0,0.05); }
.drawer__links li:last-child { border-bottom: none; }

.drawer__links li a {
  text-decoration: none; font-size: 1rem; color: #374151; font-weight: 500;
  padding: 1rem 1.5rem; display: flex; align-items: center; gap: 0.75rem;
  transition: all 0.22s ease; position: relative;
}
.drawer__links li a:hover {
  background: rgba(0,0,0,0.03);
  color: #0f172a;
  padding-left: 1.5rem;
}

.icon {
  width: 20px; height: 20px; flex: 0 0 20px;
  color: #6b7280; display: inline-block;
}

.register-link {
  display: inline-flex;
  background: rgba(204,77,4,0.08);
  color: #cc4d04 !important;
  margin: 0 1.5rem 1rem;
  border-radius: 12px;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(204,77,4,0.12);
  justify-content: center;
  font-weight: 700;
  text-align: center;
}

.login-link {
  display: inline-flex;
  background: linear-gradient(135deg,#cc4d04,#993a03);
  color: white !important;
  margin: 0 1.5rem 1rem;
  border-radius: 12px;
  padding: 0.6rem 1rem !important;
  justify-content: center;
  font-weight: 600;
}

.logout-link {
  background: none !important;
  color: #dc2626 !important;
  margin: 0;
  border-radius: 0;
  padding: 1rem 1.5rem;
  font-weight: 600;
}
.logout-link:hover {
  background: rgba(239,68,68,0.06) !important;
  color: #b91c1c !important;
  padding-left: 1.5rem;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .nav { padding: 0.5rem 1rem; }
  .nav__brand img { height: 40px; }

  /* toggle already has width/height set above — no override needed */

  .drawer { border-radius: 16px 16px 0 0; }
  .drawer__header { padding: 1rem 1rem 0.6rem; }
  .drawer__links li a { padding: 0.875rem 1.25rem; font-size: 0.95rem; }

  .register-link .icon,
  .login-link .icon { display: none; }

  .drawer__links li:first-child a,
  .drawer__links li:first-child a::before {
    border: none !important;
    box-shadow: none !important;
    background: none !important;
    padding-left: 1.25rem;
  }

  .auth-row {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .auth-row .register-link,
  .auth-row .login-link {
    width: 48%;
    min-width: 92px;
    margin: 0;
    padding: 0.5rem 0.6rem !important;
    border-radius: 10px;
  }

  .auth-row .register-link {
    background: rgba(204,77,4,0.08) !important;
    color: #cc4d04 !important;
    border: 1px solid rgba(204,77,4,0.12);
    font-weight: 700;
  }

  .auth-row .login-link {
    background: linear-gradient(135deg,#cc4d04,#993a03) !important;
    color: #fff !important;
    font-weight: 700;
  }

  .drawer__links { gap: 6px; }
}

/* Focus styles */
.nav__toggle:focus,
.nav__links a:focus,
.drawer__links a:focus {
  outline: 2px solid rgba(204,77,4,0.4);
  outline-offset: 2px;
}

.drawer.no-icons .icon { display: none; }
.drawer.no-icons .drawer__links li a { padding-left: 1.5rem; }