@import url("../roles/roles.css");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

nav,
nav#navbar,
.floating-nav {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

img {
  max-width: 100%;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

/* Navbar compartilhada */
.floating-nav,
nav,
nav#navbar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1180px;
  padding: 18px 32px;
  background: rgba(10, 14, 39, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  overflow: visible;
  z-index: 1000;
  transition: all 0.3s ease;
}

@supports not (backdrop-filter: blur(12px)) {
  .floating-nav,
  nav,
  nav#navbar {
    background: rgba(10, 14, 39, 0.92);
    border-color: rgba(255, 255, 255, 0.14);
  }
}

.floating-nav.scrolled,
nav.scrolled,
nav#navbar.scrolled {
  padding: 14px 50px;
  padding: 14px 32px;
  background: rgba(10, 14, 39, 0.82);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

:root[data-theme="light"] .floating-nav,
:root[data-theme="light"] nav,
:root[data-theme="light"] nav#navbar {
  background: rgba(217, 224, 234, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

:root[data-theme="light"] .floating-nav.scrolled,
:root[data-theme="light"] nav.scrolled,
:root[data-theme="light"] nav#navbar.scrolled {
  background: rgba(217, 224, 234, 0.92);
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.nav-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  flex-wrap: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  justify-content: center;
}

.logo {
  display: inline-flex;
  gap: 0;
  align-items: center;
  text-decoration: none;
}

.logo-icon {
  width: 68px;
  height: 68px;
  padding: 0;
  background: none;
  box-shadow: none;
  position: relative;
  overflow: visible;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.06));
}

.logo-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.03) 35%,
    rgba(255, 255, 255, 0) 70%
  );
  filter: blur(6px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.logo-word img {
  display: block;
  height: 68px;
  object-fit: contain;
  transform: translateY(3px);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.28));
}

.nav-links li {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-links a,
.questions-trigger-btn {
  position: relative;
  background: transparent;
  border: none;
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  padding: 8px 0;
  text-decoration: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

:root[data-theme="light"] .nav-links a,
:root[data-theme="light"] .questions-trigger-btn {
  color: #0f172a;
}

.nav-links a::before {
  display: none;
}

.nav-links a::after,
.questions-trigger-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #335bff, #1d3edb);
  box-shadow: 0 0 10px rgba(29, 62, 219, 0.35);
  opacity: 0;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition:
    transform 0.22s ease-out,
    opacity 0.22s ease-out,
    box-shadow 0.22s ease-out;
}

.nav-links a:hover::after,
.nav-links a.active::after,
.questions-trigger-btn:hover::after,
.questions-trigger-btn.active::after {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

.nav-links a:hover,
.nav-links a.active,
.questions-trigger-btn:hover,
.questions-trigger-btn.active {
  color: #ffffff;
  text-shadow: none;
}

:root[data-theme="light"] .nav-links a:hover,
:root[data-theme="light"] .nav-links a.active,
:root[data-theme="light"] .questions-trigger-btn:hover,
:root[data-theme="light"] .questions-trigger-btn.active {
  color: #0f172a;
}

.questions-trigger-btn .caret {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-left: 4px;
}

.nav-item-questions {
  position: relative;
}

.user-avatar {
  margin-left: 18px;
  display: flex;
  align-items: center;
  position: relative;
}

.user-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: #0a0e27;
}

:root[data-theme="light"] .user-avatar-btn {
  border-color: rgba(148, 163, 184, 0.45);
  background: #f8fafc;
}

.user-avatar img {
  height: 100%;
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: #0a0e27;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  backface-visibility: hidden;
}

:root[data-theme="light"] .user-avatar img {
  background: #f8fafc;
}

.user-avatar img:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  width: 260px;
  padding: 14px 18px 12px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
  transition:
    opacity 0.18s ease-out,
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out;
  z-index: 1200;
}

:root[data-theme="light"] .user-menu {
  background: rgba(248, 250, 252, 0.98);
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.user-menu.open {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.95);
}

.user-menu-header {
  text-align: center;
  margin-bottom: 10px;
}

.user-menu-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 3px;
}

:root[data-theme="light"] .user-menu-label {
  color: rgba(71, 85, 105, 0.85);
}

.user-menu-name {
  font-size: 17px;
  font-weight: 600;
  color: #f9fafb;
}

:root[data-theme="light"] .user-menu-name {
  color: #0f172a;
}

.user-menu-header .role-badge {
  margin-top: 8px;
  display: inline-flex;
}

.user-menu-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

:root[data-theme="light"] .user-menu-divider {
  border-top-color: rgba(148, 163, 184, 0.3);
}

.user-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-menu-link {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.profile-link {
  border-color: rgba(148, 163, 184, 0.35);
  background: linear-gradient(
    135deg,
    rgba(71, 85, 105, 0.25),
    rgba(30, 41, 59, 0.3)
  );
  color: #e5e7eb;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.25);
}

.profile-link:hover {
  border-color: rgba(148, 163, 184, 0.55);
  background: linear-gradient(
    135deg,
    rgba(71, 85, 105, 0.35),
    rgba(30, 41, 59, 0.4)
  );
  box-shadow: 0 0 16px rgba(148, 163, 184, 0.35);
  color: #f8fafc;
}

.user-menu-link:hover:not(.profile-link) {
  border-color: rgba(0, 247, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 247, 255, 0.35);
  color: #ffffff;
}

:root[data-theme="light"] .user-menu-link:hover:not(.profile-link) {
  color: #0f172a;
}

:root[data-theme="light"] .user-menu-link {
  border-color: #d7dde8;
  background: #f8fafc;
  color: #0f172a;
}

:root[data-theme="light"] .user-menu-link:hover:not(.profile-link) {
  border-color: #00e5ff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

:root[data-theme="light"] #logout-btn {
  color: #0f172a;
}

#logout-btn {
  border-color: rgba(255, 99, 132, 0.55);
  background: linear-gradient(
    135deg,
    rgba(255, 99, 132, 0.25),
    rgba(255, 77, 109, 0.18)
  );
  color: #ffeef2;
  box-shadow: 0 0 12px rgba(255, 99, 132, 0.35);
}

#logout-btn:hover {
  border-color: rgba(255, 99, 132, 0.8);
  box-shadow: 0 0 16px rgba(255, 99, 132, 0.55);
  background: linear-gradient(
    135deg,
    rgba(255, 99, 132, 0.35),
    rgba(255, 77, 109, 0.28)
  );
}

.questions-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  margin-top: 10px;
  background: rgba(20, 12, 14, 0.98);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
  z-index: 999;
  min-width: 220px;
  border: 1px solid rgba(255, 88, 104, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: top center;
  transition:
    opacity 0.18s ease-out,
    transform 0.2s ease-out,
    visibility 0.2s ease-out;
}

:root[data-theme="light"] .questions-menu {
  background: rgba(248, 250, 252, 0.98);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.questions-menu.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.questions-menu-btn {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 138, 138, 0.9);
  background: radial-gradient(
    circle at top left,
    rgba(255, 196, 196, 0.7),
    rgba(255, 138, 138, 0.95)
  );
  color: #4c0b0b;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
  transition:
    transform 0.08s ease,
    box-shadow 0.12s ease,
    background 0.15s ease;
}

.questions-menu-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
  background: radial-gradient(
    circle at top left,
    rgba(255, 210, 210, 0.82),
    rgba(255, 150, 150, 1)
  );
}

.questions-menu-btn:active {
  transform: translateY(1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.28);
}

.nav-links-mobile {
  display: none;
  list-style: none;
  margin: 10px 0 0;
  padding: 12px 16px 16px;
  background: rgba(10, 14, 39, 0.9);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  gap: 10px;
  flex-direction: column;
}

.nav-links-mobile.open {
  display: flex;
}

.nav-links-mobile a {
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  display: block;
  padding: 6px 0;
}

.nav-links-mobile-title {
  margin-top: 6px;
  padding: 10px 0 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.85);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  width: 32px;
  height: 24px;
  justify-content: center;
  align-items: center;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background: #ffffff;
  border-radius: 999px;
  transition: all 0.2s ease;
}

:root[data-theme="light"] .nav-links-mobile {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(148, 163, 184, 0.3);
}

:root[data-theme="light"] .nav-links-mobile a {
  color: #0f172a;
}

:root[data-theme="light"] .nav-links-mobile-title {
  color: rgba(71, 85, 105, 0.85);
}

:root[data-theme="light"] .hamburger span {
  background: #1e293b;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 1200px) and (min-width: 1101px) {
  .floating-nav,
  nav,
  nav#navbar {
    width: calc(100% - 40px);
    padding: 16px 26px;
  }

  .nav-container {
    gap: 22px;
  }

  .nav-links {
    gap: 18px;
  }

  .nav-links a,
  .questions-trigger-btn {
    font-size: 14px;
  }

  .logo-icon {
    width: 60px;
    height: 60px;
  }

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

  .user-avatar-btn {
    width: 46px;
    height: 46px;
  }

  body {
    padding: 160px 0 0 0 !important;
  }
}

@media (max-width: 1100px) {
  .floating-nav,
  nav,
  nav#navbar {
    width: calc(100% - 32px);
    padding: 14px 22px;
  }

  .nav-container {
    gap: 18px;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a,
  .questions-trigger-btn {
    font-size: 14px;
  }

  .logo-icon {
    width: 56px;
    height: 56px;
  }

  .logo-word img {
    height: 56px;
  }

  .user-avatar-btn {
    width: 44px;
    height: 44px;
  }

  body {
    padding: 150px 0 0 0 !important;
  }
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .questions-menu {
    left: 16px;
    right: 16px;
    transform: none;
    min-width: 0;
  }
}

body {
  margin: 0;
  padding: 170px 0 0 0 !important;
  box-sizing: border-box;
}

.app,
.container,
.top-nav {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.page-shell {
  max-width: 1280px;
  padding: 0 24px 24px 24px;
  margin: 0 auto;
  box-sizing: border-box;
  width: 100%;
}
