/* ========== Base ========== */
body {
  margin: 0;
  background-color: #063d0f;
  color: white;
  font-family: 'Orbitron', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body, .top-bar, .main-nav, footer {
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

main {
  flex: 1;
  padding: 2rem;
  text-align: center;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

/* ========== Top Bar ========== */
.top-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none; /* transparent */
  padding: 1.2rem 2rem;
  border-top: 3px solid #38f86c;
}

.left-buttons {
  position: absolute;
  left: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.auth-buttons {
  position: absolute;
  right: 3rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.top-logo { text-align: center; }

.top-logo h1 {
  font-size: 2.7rem;
  margin: 0;
}

.logo-dark { color: black; }
.logo-light { color: #38f86c; }

/* ========== Buttons and Theme Toggle ========== */
.auth-buttons a {
  font-family: 'Orbitron';
  padding: 0.6rem 1.2rem;
  background: #111;
  color: #38f86c;
  border: 2px solid #38f86c;
  border-radius: 10px;
  font-weight: bold;
  text-decoration: none;
  font-size: 1rem;
  transition: 0.2s ease;
}
.auth-buttons a:hover {
  background: #1a1a1a;
  box-shadow: 0 0 12px #38f86c;
}

.theme-toggle {
  font-family: 'Orbitron';
  background: #38f86c;
  color: black;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 10px #38f86c;
  transition: 0.2s transform ease, 0.3s box-shadow ease;
  transform: scale(1);
}
.theme-toggle:active {
  transform: scale(0.92);
  box-shadow: 0 0 20px #38f86c;
}
.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px #38f86c;
}

/* ========== Main Navigation ========== */
.main-nav {
  background: #111;
  padding: 1.2rem 0;
  border-top: 2px solid #38f86c;
  border-bottom: 2px solid #38f86c;
  box-shadow: 0 4px 12px #38f86c80;
  position: relative;
  z-index: 50;
}

.main-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.main-nav > ul > li { position: relative; }

.main-nav a {
  position: relative;
  text-decoration: none;
  color: white;
  font-weight: bold;
  font-size: 1.5rem;
  transition: color 0.3s ease;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  background: #38f86c;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
  box-shadow: 0 0 8px #38f86c;
}
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a:hover { color: #38f86c; }
.main-nav a.active {
  color: #38f86c;
  text-shadow: 0 0 8px #38f86c;
}

/* ========== Dropdowns ========== */
.dropdown-icon {
  font-size: .8em;
  margin-left: .35rem;
  color: #38f86c;
  transition: transform .2s ease;
}
.main-nav li.dropdown:hover > a .dropdown-icon { transform: rotate(180deg); }

.dropdown-menu {
  list-style: none;
  margin: 0;
  padding: .35rem 0;
  display: none;
  position: absolute;
  top: calc(100% + 14px); /* sits below hover bridge */
  left: 0;
  min-width: 220px;
  background: #0a0a0a;
  border: 2px solid #38f86c;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(56,248,108,.25);
  z-index: 9999;
}
.dropdown-menu li { width: 100%; }
.dropdown-menu a {
  display: block;
  padding: .55rem .9rem;
  color: #38f86c;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 700;
  font-size: 1.05rem;
}
.dropdown-menu a:hover { background: #38f86c; color: #000; }

/* Hover bridge fix */
.main-nav > ul > li.dropdown { position: relative; }
.main-nav > ul > li.dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px; /* height of invisible bridge */
}
.main-nav li.dropdown:hover > .dropdown-menu,
.dropdown-menu:hover { display: block; }

/* Light mode variant */
.light .dropdown-menu {
  background: #fff;
  border-color: #0b2013;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.light .dropdown-menu a { color: #0b2013; }
.light .dropdown-menu a:hover { background: #dff6e7; color: #0b2013; }

/* ========== Footer ========== */
footer {
  background: #111;
  color: #38f86c;
  text-align: center;
  padding: 1rem;
  margin-top: auto;
  border-top: 2px solid #38f86c;
}

/* ========== Forms ========== */
input[type="text"], select {
  width: 100%;
  padding: 0.7rem;
  margin: 0.5rem 0 1.2rem;
  border-radius: 10px;
  border: none;
  background: #111;
  color: white;
  font-family: 'Orbitron', sans-serif;
}
input[type="text"]::placeholder { color: #38f86c; }
select { appearance: none; }

button, .glow-action-button {
  font-family: 'Orbitron', sans-serif;
  background-color: #38f86c;
  color: black;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: 12px;
  box-shadow: 0 0 15px #38f86c;
  cursor: pointer;
  transition: 0.3s ease;
}
button:hover, .glow-action-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px #38f86c;
}

/* ========== Light Theme Mode ========== */
html.light body,
body.light { background-color: #d0ffd0; color: #000; }

.light .top-bar,
.light .main-nav {
  background: #b8ffb8;
  border-top: 2px solid #38f86c;
  border-bottom: 2px solid #38f86c;
  box-shadow: 0 4px 12px #38f86c80;
}

.light footer {
  background: #d0ffd0;
  color: black !important;
  border-top: 2px solid black;
}

.light .auth-buttons a {
  background: #d0ffd0;
  color: black;
  border: 2px solid black;
}
.light .theme-toggle { background: black; color: #38f86c; }
.light .main-nav a { color: black; }
.light .main-nav a:hover { color: #38f86c; }
.light input[type="text"],
.light select { background: #ffffff; color: black; }

/* ========== Mobile Responsive ========== */
@media screen and (max-width: 768px) {
  .top-bar { flex-direction: column; align-items: center; }
  .auth-buttons { position: static; margin-bottom: 1rem; justify-content: center; flex-wrap: wrap; }
  .auth-buttons a { min-width: 120px; text-align: center; }
  .left-buttons { position: static; margin-bottom: 1rem; }
  .top-logo { margin-bottom: 1rem; }

  .main-nav > ul { flex-direction: column; align-items: center; gap: 1rem; padding: 0; }
  .main-nav a { font-size: 1.3rem; }

  .dropdown-menu {
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ========== Ripple effect ========== */
.ripple-button { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(56, 248, 108, 0.4);
  transform: scale(0);
  animation: ripple-effect 0.6s linear;
  pointer-events: none;
  box-shadow: 0 0 15px rgba(56, 248, 108, 0.6);
}
@keyframes ripple-effect { to { transform: scale(4); opacity: 0; } }

/* ========== Home page bits ========== */
.home-main { text-align: center; padding: 2rem 1rem; }
.hero h2 { font-size: 2.8rem; margin-bottom: 0.5rem; color: white; }
.hero p  { font-size: 1.6rem; margin-bottom: 2rem; color: white; }
.about-text {
  max-width: 800px;
  margin: 0 auto 2rem auto;
  font-size: 1.2rem;
  line-height: 1.6;
  text-align: center;
}
.video-container {
  position: relative;
  padding-bottom: 45%;
  height: 0;
  overflow: hidden;
  width: 100%;
  max-width: 800px;
  margin: 2rem auto 0 auto;
  border: 2px solid #38f86c;
  box-shadow: 0 0 15px #38f86c;
  border-radius: 12px;
  transition: all 0.4s ease;
}
.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

@media screen and (max-width: 768px) {
  .hero h2 { font-size: 2rem; }
  .hero p  { font-size: 1.2rem; }
  .about-text { font-size: 1rem; padding: 0 1rem; }
  .video-container { padding-bottom: 60%; width: 90%; max-width: 90%; margin: 1.5rem auto 0; }
}

@media screen and (min-width: 1024px) {
  .about-text { font-size: 1.4rem; margin-top: 2rem; margin-bottom: 3rem; }
  .video-container { margin-top: 2rem; }
}

.fade-in { opacity: 0; transform: translateY(20px); animation: fadeInAnimation 1s ease-out forwards; }
@keyframes fadeInAnimation { to { opacity: 1; transform: translateY(0); } }

/* compact dropdown sizing */
.dropdown-compact {
  min-width: 220px;
  max-width: 260px;
  padding: .25rem 0;
  border-radius: 10px;
  box-shadow: 0 10px 18px rgba(56,248,108,.18);
}
.dropdown-compact a {
  font-size: 1rem;
  padding: .5rem .85rem;
  line-height: 1.1;
}
.dropdown-sep {
  margin: .25rem .6rem;
  border: 0;
  border-top: 1px solid rgba(56,248,108,.35);
}
.light .dropdown-sep {
  border-top-color: rgba(11,32,19,.35);
}

/* ========== Portfolio Cards ========== */
.portfolio-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 3rem auto;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 260px;
  margin: 20px;
  background-color: #0d260d;
  border: 3px solid #38f86c;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(56, 248, 108, 0.7);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.portfolio-card:hover {
  transform: scale(1.08);
  box-shadow: 0 0 25px rgba(56, 248, 108, 1);
}

.portfolio-card img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid #38f86c;
  box-shadow: 0 0 12px rgba(56, 248, 108, 0.8);
  background-color: #000;
}

.portfolio-card span {
  margin-top: 12px;
  font-size: 1.2rem;
  color: #fff;
  text-shadow: 0 0 8px #38f86c;
}

/* ========== Admin Panel: Pills & Toggles (Roles + Page Access) ========== */

/* Pill appearance (used by both Roles and Page Access) */
.role-pill,
.page-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .22rem .6rem;
  margin: .18rem;
  white-space: nowrap;
  border-radius: 999px;
  background: #0b2013;
  border: 1px solid #38f86c;
  color: #fff;
  box-shadow: 0 0 6px rgba(56,248,108,.35);
  font-size: .92rem;
}

/* Circle toggle inside pills (Roles + Page Access) */
.role-pill input[type="checkbox"],
.role-pill input[type="radio"],
.page-pill input[type="checkbox"],
.page-pill input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #38f86c;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  cursor: pointer;
  background: transparent;
  vertical-align: middle;
  margin-right: 4px;
}

.role-pill input[type="checkbox"]:checked::after,
.role-pill input[type="radio"]:checked::after,
.page-pill input[type="checkbox"]:checked::after,
.page-pill input[type="radio"]:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background: #38f86c;
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* When a pill is 'active' you can optionally give it a glow */
.role-pill input:checked ~ span,
.page-pill input:checked ~ span { text-shadow: 0 0 8px #38f86c; }

/* Scrollable cells (keep pills inside) */
.page-access-cell {
  max-height: 150px;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  padding: .35rem .25rem;
  background: rgba(0,0,0,.2);
  border-radius: 8px;
}

/* ========== Neon Scrollbars (global) ========== */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #38f86c #0a2b13;
}

/* WebKit browsers (Chrome/Edge/Safari/Opera) */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
  background: #111;
}
::-webkit-scrollbar-track {
  background: #0a2b13;
  border: 1px solid #38f86c;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: #38f86c;
  border-radius: 10px;
  border: 2px solid #0a2b13;
}
::-webkit-scrollbar-thumb:hover { background: #2df57b; }
::-webkit-scrollbar-corner { background: #0a2b13; }

/* Up/Down (and Left/Right) arrow buttons */
::-webkit-scrollbar-button {
  width: 16px;
  height: 16px;
  background: #0a2b13;
  border: 1px solid #38f86c;
}

/* Up arrow */
::-webkit-scrollbar-button:vertical:decrement {
  background:
    #0a2b13
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><polygon points='8,4 12,10 4,10' fill='%2338f86c'/></svg>")
    no-repeat center;
  border-bottom: none;
}

/* Down arrow */
::-webkit-scrollbar-button:vertical:increment {
  background:
    #0a2b13
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><polygon points='4,6 12,6 8,12' fill='%2338f86c'/></svg>")
    no-repeat center;
  border-top: none;
}

/* Left arrow */
::-webkit-scrollbar-button:horizontal:decrement {
  background:
    #0a2b13
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><polygon points='6,8 12,4 12,12' fill='%2338f86c'/></svg>")
    no-repeat center;
  border-right: none;
}

/* Right arrow */
::-webkit-scrollbar-button:horizontal:increment {
  background:
    #0a2b13
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><polygon points='4,4 10,8 4,12' fill='%2338f86c'/></svg>")
    no-repeat center;
  border-left: none;
}
/* Hide the little up/down “scroll” arrows, if present */
.sb-arrow,
.sb-scroll-top,
.sb-scroll-bottom {
  display: none !important;
}

/* Comments container: vertical scroll only, never horizontal */
#comments {
  max-height: 42vh;
  overflow-y: auto;
  overflow-x: hidden;          /* <- stop left-right scrollbar */
  word-break: break-word;      /* wrap long words/URLs */
  overflow-wrap: anywhere;     /* modern wrap */
  white-space: normal;         /* ensure normal wrapping */
  padding-right: .25rem;       /* keep the look you had */
}

/* Ensure all comment lines/blocks wrap and never force horizontal scroll */
#comments * {
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Sidebar itself: never horizontal scroll */
.sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}

/* The title/description editors: never horizontal scroll either */
.field input,
.field textarea,
#lb-item-title,
#lb-item-desc {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* If any code added custom scroll-buttons inside the textarea/description area */
.desc-arrow,
.title-arrow {
  display: none !important;
}
/* 1) Kill the tiny scrollbar arrow buttons (WebKit/Blink) */
#comments::-webkit-scrollbar-button,
.sidebar::-webkit-scrollbar-button {
  height: 0;
  display: none;
}

/* If any custom arrow elements exist, hide them too */
.sb-arrow, .sb-scroll-top, .sb-scroll-bottom { display: none !important; }

/* 2) Comments: vertical scroll only, wrap long lines, no horizontal bar */
#comments {
  max-height: 42vh;
  overflow-y: auto;
  overflow-x: hidden;          /* no left/right scroll */
  white-space: normal;         /* allow wrapping */
  word-break: break-word;      /* break very long words/URLs */
  overflow-wrap: anywhere;     /* modern wrap */
  padding-right: .25rem;
}

/* Ensure all descendants wrap and never force horizontal scroll */
#comments * {
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Sidebar (general): never horizontal scroll */
.sidebar { overflow-x: hidden; }

/* Title / Description blocks also wrap (for viewers who aren’t editors) */
#lb-item-title, #lb-item-desc,
.field input, .field textarea {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 3) Bigger/wider comment box + put emoji button beside it */
.comment-form { position: relative; }
.comment-input-row {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: .5rem 0 .75rem;
}

/* Wider / taller textbox */
#commentText {
  flex: 1 1 auto;
  min-height: 140px;
  width: 100%;
  font-size: 0.98rem;
  padding: .6rem .7rem;
}

/* Emoji button next to the textarea */
.emoji-btn {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #38f86c; border-radius: 10px;
  background: rgba(0,0,0,.45);
  box-shadow: 0 0 10px #38f86c66;
  cursor: pointer;
}

/* Keep the rest of the row (Post Comment + “Posting as …”) below the input row */
.comment-form .row-actions { margin-top: .25rem; }

/* Firefox: make scrollbars consistent (optional) */
#comments { scrollbar-width: thin; scrollbar-color: #38f86c #0a2b13; }

/* ===== Emoji Picker (panel, categories, search, grid) ===== */
.emoji-panel {
  position: absolute;
  bottom: 68px;
  right: 12px;
  background: #061e10;
  border: 1px solid #38f86c;
  box-shadow: 0 0 18px rgba(56,248,108,.35);
  border-radius: 12px;
  padding: .5rem;
  display: none;
  max-height: 310px;
  overflow: hidden;
  z-index: 5;
  width: 320px;
}

.emoji-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.emoji-head {
  display: flex;
  gap: .4rem;
  align-items: center;
  margin-bottom: .4rem;
}

.emoji-head input {
  flex: 1;
  background: transparent;
  color: #fff;
  border: 1px solid #38f86c;
  border-radius: 10px;
  padding: .45rem .6rem;
  outline: none;
}

.emoji-cats {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}

.emoji-cat {
  font-size: .78rem;
  border: 1px solid #38f86c;
  color: #38f86c;
  background: #052a10;
  border-radius: 8px;
  padding: .25rem .45rem;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(56,248,108,.25);
}

.emoji-cat:hover { background: #0b3717; }
.emoji-cat.active { background: #0b3717; }

.emoji-scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding-right: .25rem;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 34px);
  gap: .35rem;
}

.emoji-item {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b2013;
  border: 1px solid #38f86c;
  cursor: pointer;
  transition: transform .08s ease;
}

.emoji-item:hover {
  background: #10301a;
  transform: translateY(-1px);
}

/* Twemoji images inside cells */
.emoji-item img { width: 22px; height: 22px; display: block; }

/* Light theme adjustments for emoji picker */
.light .emoji-panel {
  background: #ffffff;
  border-color: #0b2013;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.light .emoji-head input {
  color: #000;
  border-color: #0b2013;
}
.light .emoji-cat {
  color: #0b2013;
  border-color: #0b2013;
  background: #eef7f0;
}
.light .emoji-cat.active,
.light .emoji-cat:hover { background: #dff6e7; }
.light .emoji-item {
  background: #f6fff8;
  border-color: #0b2013;
}
.light .emoji-item:hover { background: #e9f7ee; }
