/* === Base Styles === */
html, body {
  height: 100%;
  overflow: visible !important;
  position: relative;
}

/* === Top Navigation Bar === */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1e1a42;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #2d274f;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  height: 80px;
}

/* === Logo === */
.nav-left {
  display: flex;
  align-items: center;
  flex: 1;
}
.logo {
  width: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-img {
  width: 220px;
  height: auto;
  display: block;
}

/* === Nav Links === */
.nav-links {
  display: flex;
  align-items: center;
}
.nav-link {
  color: #fff;
  text-decoration: none;
  margin: 0 1rem;
  font-weight: 500;
  transition: color 0.3s;
}
.nav-link:hover {
  color: #8e75ff;
}
.nav-link.active {
  color: #8e75ff;
  font-weight: 600;
}

/* === Upgrade Button === */
.upgrade-link {
  background-color: #8e75ff;
  color: white !important;
  padding: 6px 14px;
  border-radius: 8px;
  margin-left: 1rem;
  font-weight: bold;
  animation: pulseGlow 2s infinite;
  box-shadow: 0 0 10px #8e75ff88;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px #8e75ff; }
  50% { box-shadow: 0 0 15px #a18cff; }
}

/* === Refer Button === */
.referral-nav-btn {
  margin-left: 1rem;
  background-color: transparent;
  color: #8e75ff;
  border: 1px solid #8e75ff;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.referral-nav-btn:hover {
  background-color: #8e75ff;
  color: white;
}

/* === Referral Modal === */
.referral-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
.referral-modal.hidden {
  display: none;
}
.referral-modal-content {
  background-color: #1e1a42;
  padding: 2.5rem;
  border-radius: 12px;
  max-width: 450px;
  width: 90%;
  text-align: center;
  color: white;
  box-shadow: 0 0 25px rgba(142, 117, 255, 0.3);
}
.referral-modal-content input {
  width: 100%;
  margin: 1rem 0;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 6px;
  border: none;
  text-align: center;
  background-color: #2b255a;
  color: #fff;
}

.close-ref-btn {
  padding: 10px 24px;
  background-color: #8e75ff;
  border: none;
  color: white;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

/* === Auth Modal === */
.auth-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9995;
}
.auth-modal.hidden {
  display: none;
}
.auth-modal-content {
  background-color: #1e1a42;
  padding: 4rem 2.5rem 2rem;
  border-radius: 16px;
  width: 95%;
  max-width: 480px;
  box-shadow: 0 0 30px rgba(142, 117, 255, 0.35);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.auth-input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  background: #2a2652;
  border: none;
  color: #fff;
  font-size: 1rem;
}
.auth-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: #8e75ff;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  color: white;
  cursor: pointer;
}
.auth-btn:hover {
  background-color: #7b65e0;
}
.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  color: #fff;
  font-size: 1.4rem;
  border: none;
  cursor: pointer;
}
.auth-tabs {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.auth-tab {
  flex: 1;
  padding: 0.5rem;
  background: #2b255a;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 6px 6px 0 0;
  transition: background 0.3s;
}
.auth-tab.active {
  background: #8e75ff;
}
.auth-view.hidden {
  display: none;
}

.auth-message {
  margin-bottom: 10px;
  font-size: 14px;
  text-align: center;
  display: none;
  color: white;
  font-weight: 500;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 6px;
}

.auth-message.success {
  background-color: #28a745;
}

.auth-message.error {
  background-color: #dc3545;
}


/* === Creator Button === */
.creator-btn {
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  width: 100%;
  background: #3bffb5;
  color: #161336;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.creator-btn:hover {
  background: #31e2a1;
}

/* === Nav Button (Login/Signup) === */
.nav-btn {
  background-color: #2a2652;
  padding: 6px 12px;
  border-radius: 6px;
  color: white;
  border: 1px solid #8e75ff;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Segoe UI', sans-serif;
  transition: background 0.3s;
}
.nav-btn:hover {
  background-color: #3b3566;
  color: #8e75ff;
}

/* === Hide / Show Nav Buttons Based on State === */
#openAuthModal,
#openAuthModalMobile,
#accountBtn,
#accountBtnMobile,
#creatorPortalBtn,
#creatorPortalBtnMobile {
  display: none;
}

/* === Right Nav Section === */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
}

/* === Hamburger Icon === */
.nav-toggle {
  display: none;
  font-size: 28px;
  cursor: pointer;
  color: white;
}

/* === Mobile Dropdown Nav Menu === */
.nav-menu {
  display: none;
  flex-direction: column;
  background-color: #1e1a42;
  width: 100%;
  position: absolute;
  top: 80px;
  left: 0;
  padding: 1rem;
  border-top: 1px solid #2d274f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.nav-menu.open {
  display: flex;
}
.nav-menu .nav-link,
.nav-menu .nav-btn,
.nav-menu .referral-nav-btn {
  margin: 0.5rem 1rem;
}

/* === Media Queries === */
@media (max-width: 1080px) {
  .top-nav .nav-links,
  .top-nav .nav-btn.desktop-only,
  .top-nav .nav-link.desktop-only {
    display: none !important;
  }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu .nav-links,
  .nav-menu .nav-auth {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.75rem;
    padding: 0 1.5rem;
  }
}


@media (min-width: 1081px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 1080px) {
  .desktop-only {
    display: none !important;
  }
}


/* === Creator Modal === */
.creator-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9998; /* Above auth modal */
}
.creator-modal.hidden {
  display: none;
}

.creator-modal-content {
  background-color: #1e1a42;
  color: white;
  padding: 2.5rem;
  border-radius: 16px;
  width: 95%;
  max-width: 1040px;
  text-align: center;
  box-shadow: 0 0 30px rgba(142, 117, 255, 0.35);
  
   max-height: 90vh;
  overflow-y: auto;

  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE 10+ */
}

.creator-modal-content::-webkit-scrollbar {
  display: none;               /* Chrome, Safari, Edge */
}


.creator-modal-content input,
.creator-modal-content textarea {
  width: 100%;
  padding: 0.75rem;
  margin: 0.75rem 0;
  border-radius: 6px;
  border: none;
  background-color: #2b255a;
  color: #fff;
  font-size: 1rem;
}

.creator-modal-content button.auth-btn {
  background-color: #8e75ff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 1rem;
  width: 100%;
}
.creator-modal-content button.auth-btn:hover {
  background-color: #7b65e0;
}

.creator-modal-content .close-btn {
  margin-top: 0.75rem;
  background-color: transparent;
  border: 1px solid #8e75ff;
  color: #8e75ff;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}
.creator-modal-content .close-btn:hover {
  background-color: #8e75ff;
  color: white;
}

.creator-label {
  display: block;
  text-align: left;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  color: #cfcaff;
  font-size: 0.95rem;
}

.creator-subtext {
  font-size: 0.9rem;
  color: #aaa6d5;
  margin-bottom: 1rem;
}

.file-input {
  background-color: #2b255a;
  padding: 0.6rem;
  border: 1px solid #444;
  cursor: pointer;
}
.file-input::file-selector-button {
  background: #8e75ff;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  margin-right: 1rem;
}
.file-input::file-selector-button:hover {
  background: #7b65e0;
}

.input-note {
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 10px;
  margin-bottom: 10px; /* increased from 10px to 20px */
  text-align: left;
}


.creator-subnote {
  font-size: 0.9rem;
  color: #ccc;
  margin-top: 1rem;
  text-align: center;
}

.creator-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.creator-form-col {
  flex: 1;
  min-width: 300px;
}

#navbar-placeholder::before {
  content: "";
  display: block;
  height: 100%;
  background-color: #1e1a42; /* Same as navbar background */
}

#navbar-placeholder {
  min-height: 80px; /* or whatever your navbar height is */
}

.char-counter {
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
  text-align: right;
}

.creator-cta-note {
  color: #cfcaff;
  font-size: 1rem;
  margin-top: 0.8rem;
  text-align: center;
}

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 30, 30, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  border: 5px solid #ccc;
  border-top: 5px solid #8e75ff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden {
  display: none;
}


.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  border: none;
  background: none;
  color: #aaa;
  cursor: pointer;
}
.close-btn:hover {
  color: #555;
}

.auth-link-btn {
  display: block;
  margin: 10px auto 0 auto; /* top margin + auto horizontal center */
  background: none;
  border: none;
  color: #888;
  text-decoration: underline;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: center;
}

.auth-link-btn:hover {
  color: #555;
}


/* === Creator Tag Picker (Improved) === */
.tag-dropdown-wrapper {
  position: relative;
  margin-top: 10px;
}

.tag-dropdown-toggle {
  width: 100%;
  padding: 10px 14px;
  background: #2a2652;
  color: #fff;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.3s;
}
.tag-dropdown-toggle:hover {
  background: #322c5e;
}

.tag-dropdown {
  position: absolute;
  background: #1e1a42;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  width: 100%;
  margin-top: 6px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.tag-dropdown.hidden {
  display: none;
}

.tag-option {
  background: #302b63;
  color: #ccc;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: 0.2s ease;
  border: 1px solid transparent;
}
.tag-option:hover {
  background: #3c3681;
}
.tag-option.selected {
  background: #8e75ff;
  color: white;
  font-weight: 600;
  border: 1px solid #a994ff;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 20px; /* 👈 Add this line */
}


.selected-tag {
  background: #8e75ff;
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 8px rgba(142, 117, 255, 0.3);
}
.selected-tag .remove-tag {
  cursor: pointer;
  font-weight: bold;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}
.selected-tag .remove-tag:hover {
  color: #ffe2ff;
}
