/* Utility class for JS hide/show logic */
.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  transition: background-color 0.3s, color 0.3s;
}

:root {
  --theme-ease: 0.3s;
}

/* Force same ease time for ALL elements */
* {
  transition:
    background-color var(--theme-ease) ease,
    color var(--theme-ease) ease,
    border-color var(--theme-ease) ease,
    box-shadow var(--theme-ease) ease,
    text-shadow var(--theme-ease) ease;
}

/* Unified theme transition timing */
body,
.side-menu,
.payment-button,
#menu-button,
#close-menu,
.rules-title {
  transition:
    background-color var(--theme-ease) ease,
    color var(--theme-ease) ease,
    border-color var(--theme-ease) ease,
    box-shadow var(--theme-ease) ease,
    text-shadow var(--theme-ease) ease;
}

body.light-mode {
  background-color: #f5f5f5;
  color: #000;
}

body.dark-mode {
  background-color: #121212;
  color: #fff;
}

.top-bar {
  position: fixed;
  top: 10px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 10;
}

#toggle-theme {
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background-color: #ffcc00; /* sun color */
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode #toggle-theme {
  background-color: #222; /* moon color */
  box-shadow: inset 10px -10px 0 0 #fff; /* crescent effect */
  transform: rotate(-15deg);
}

/* Rules Title Styling */
.rules-title {
  text-align: center;
  margin-top: 40px;
  font-size: 3rem;
  font-weight: bold;
  color: #fff;
  text-shadow:
    0 0 1px #fff,
    0 0 1px #fff;
  transition: background-color 0.3s ease, color 0.3s ease, text-shadow 0.3s ease;
}

body.light-mode .rules-title {
  color: #000;
  text-shadow:
    0 0 1px #000,
    0 0 1px #000;
}

/* Introduction Title Styling (same as Rules) */
.intro-title {
  text-align: center;
  margin-top: 40px;
  font-size: 3rem;
  font-weight: bold;
  color: #fff;
  text-shadow:
    0 0 1px #fff,
    0 0 1px #fff;
}

body.light-mode .intro-title {
  color: #000;
  text-shadow:
    0 0 1px #000,
    0 0 1px #000;
}

/* Introduction Text Styling */
.intro-box {
  max-width: 760px;
  margin: 24px auto 10px;
  font-size: 1.35rem;
  line-height: 1.6;
  text-align: left;
  opacity: 0.9;
}

body.light-mode .intro-box {
  color: #000;
}

body.dark-mode .intro-box {
  color: #fff;
}

/* Improved Rule Item Styling */
.rule-item {
  position: relative;
  max-width: 760px;
  margin: 16px auto;
  padding-left: 3em;
  font-size: 1.35rem;
  line-height: 1.5;
  text-align: left;
  color: inherit;
  white-space: normal;
  word-wrap: break-word;
}

/* Sign-up text below rules */
.payment-text {
  margin-top: 40px;
  text-align: center;
  font-size: 1rem;
  opacity: 0.7;
}

/* Google Sign-up Button */
.payment-button {
  margin: 15px auto 0;
  width: 56px;
  height: 56px;
  background-color: #fff;
  border: 1px solid #6a6a6a;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.payment-button img {
  height: 28px;
  width: auto;
}

/* Hover / active feedback */
.payment-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

 .payment-button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Dark mode keeps button clean */
body.dark-mode .payment-button {
  background-color: #fff;
  border-color: #121212;
}

/* Pay Button */
.payment-button {
  margin: 30px auto 0;
  padding: 14px 32px;
  font-size: 1.3rem;
  font-weight: 600;
  border-radius: 999px;
  border: 2px solid #121212;
  background-color: #fff;
  color: #121212;
  cursor: pointer;
  display: block;
  min-width: 280px;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

/* Hover effect */
.payment-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Click / active effect */
.payment-button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Dark mode variant */
body.dark-mode .payment-button {
  background-color: #121212;
  color: #fff;
  border-color: #fff;
}

/* Dark mode hover */
body.dark-mode .payment-button:hover {
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.15);
}

/* Numbering before each rule */
.rule-item::before {
  counter-increment: rule-counter;
  content: counter(rule-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 1.6rem;
  font-weight: bold;
}

/* Initialize counter */
.rules-box {
  counter-reset: rule-counter;
}

body.light-mode .rule-item {
  color: #000;
}

body.dark-mode .rule-item {
  color: #fff;
}



/* Menu Button */
#menu-button {
  position: fixed;
  top: 10px;
  left: 20px;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background-color: #121212;
  color: #fff;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

#menu-button::before {
  content: "☰";
}

body.light-mode #menu-button {
  background-color: #f5f5f5;
  color: #000;
  box-shadow: none;
}

/* Back Button (same style & position as menu button) */
#back-button {
  position: fixed;
  top: 10px;
  left: 20px;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background-color: #121212;
  color: #fff;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

body.light-mode #back-button {
  background-color: #f5f5f5;
  color: #000;
  box-shadow: none;
}

/* Side Menu Container */
.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background-color: #121212;
  color: #fff;
  z-index: 20;
  padding: 20px;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
  transform: translateX(0);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

body.light-mode .side-menu {
  background-color: #fff;
  color: #000;
}

/* Hidden state */
.side-menu.hidden {
  transform: translateX(-100%);
}

/* Side menu header */
.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.side-menu-header h3 {
  margin: 10px 0 0;
  width: 100%;
  text-align: center;
}

#close-menu {
  position: fixed;
  top: 10px;
  left: 20px;
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 50%;
  background-color: #121212;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

body.light-mode #close-menu {
  background-color: #fff;
  color: #000;
}

/* Thread list */
.thread-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-left: -10px; /* shift threads slightly left */
}

.thread-list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

body.light-mode .thread-list li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
/* Chat Input Group */
.chat-group {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 640px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 30;
}

.chat-input {
  flex: 1;
  resize: none;
  padding: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background-color: #121212;
  color: #fff;
  outline: none;
  font-size: 1rem;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-send-button {
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid #fff;
  background-color: #121212;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light mode */
body.light-mode .chat-input {
  background-color: #f5f5f5;
  color: #000;
  border-color: rgba(0, 0, 0, 0.25);
}

body.light-mode .chat-input::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

body.light-mode .chat-send-button {
  background-color: #f5f5f5;
  color: #000;
  border-color: #121212;
}

/* Chat Messages Container */
.chat-container {
  position: fixed;
  top: 80px; /* below top bar */
  bottom: 140px; /* more space so last bubble never hides behind input */
  left: 0;
  right: 0;
  padding: 0 24px; /* vertical margins */
  overflow: hidden;
  z-index: 20;
  box-sizing: border-box;
}

.chat-messages {
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 20px 0; /* small breathing room at bottom */
  box-sizing: border-box;
}

/* Base bubble */
.chat-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 1rem;
  line-height: 1.4;
  word-wrap: break-word;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Left = admin / you */
.chat-left {
  align-self: flex-start;
  background-color: #1f1f1f;
  color: #fff;
  border-top-left-radius: 6px;
}

/* Right = user */
.chat-right {
  align-self: flex-end;
  background-color: #2b2b2b;
  color: #fff;
  border-top-right-radius: 6px;
}

/* Light mode bubbles */
body.light-mode .chat-left {
  background-color: #e5e5e5;
  color: #000;
}

body.light-mode .chat-right {
  background-color: #d5d5d5;
  color: #000;
}

/* Admin command payment text inside bubble */
.chat-admin-text {
  margin-bottom: 10px;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Pay button inside chat bubble */
.chat-pay-button {
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid #fff;
  background-color: #121212;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.chat-pay-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.chat-pay-button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Light mode variant */
body.light-mode .chat-pay-button {
  background-color: #f5f5f5;
  color: #000;
  border-color: #121212;
}

body.light-mode .chat-pay-button:hover {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}
/* Policy Popup Overlay */
.policy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.4s ease;
}

/* When hidden, fade out and fully disable */
.policy-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

/* Policy Modal */
.policy-modal {
  width: calc(100% - 40px);
  max-width: 720px;
  max-height: 80vh;
  background-color: #121212;
  color: #fff;
  border-radius: 14px;
  padding: 24px 22px;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(0);
  transition: transform 0.4s ease, background-color 0.3s ease, color 0.3s ease;
}

/* Light mode modal */
body.light-mode .policy-modal {
  background-color: #fff;
  color: #000;
}

/* Each policy block */
.policy-item {
  margin-bottom: 28px;
}

.policy-item h3 {
  text-align: center;
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.policy-item .policy-content {
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
}

/* Agree Button */
#policy-agree-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 14px 0;
  border-radius: 999px;
  border: 2px solid #fff;
  background-color: #121212;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

#policy-agree-btn:hover {
  transform: translateY(-2px);
}

body.light-mode #policy-agree-btn {
  background-color: #f5f5f5;
  color: #000;
  border-color: #121212;
}
@media (max-width: 768px) {
  .intro-box,
  .rules-box {
    padding-left: 10px;
    padding-right: 10px;
  }
}