/* Stackverse Global Style Sheet */
/* Theme: Bold, Modern, Minimal - Dark Mode First */

:root {
  --color-bg: #121212;
  --color-surface: #1E1E1E;
  --color-text: #FFFFFF;
  --color-muted: #AAAAAA;

  --color-primary: #00CFFF;   /* Light Blue */
  --color-accent-1: #FF5C3B;  /* Coral Red */
  --color-accent-2: #FFB300;  /* Orange Gold */

  --radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  --transition: 0.2s ease all;

  --font-main: 'Inter', 'Segoe UI', sans-serif;
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  text-decoration: underline;
}

/* Layout Containers */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.section {
  margin-bottom: 40px;
}

/* Section Headings */
.section-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 0.25em;
}

/* Buttons */
.button-primary {
  background-color: #00CFFF;
  color: #1A1A1A;
  border: none;
  border-radius: var(--radius);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.button-primary:hover {
  background-color: #00CFFF;
}

.button-accent-1 {
  background-color: var(--color-accent-1);
  color: var(--color-text);
}

.button-accent-2 {
  background-color: var(--color-accent-2);
  color: var(--color-bg);
}

.primary-button {
  background-color: var(--color-primary);
  color: #1A1A1A;
  border: none;
  border-radius: 6px;
  padding: 0.5em 1.2em;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.primary-button:hover {
  background-color: #00b5e0;
}

.danger-button {
  background-color: rgb(73, 73, 73);
  color: white;
  border: none;
  padding: 0.5em 1.2em;
  font-size: 1em;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}
.danger-button:hover {
  background-color: #a00;
}

/* Cards */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* Inputs & Textareas */
.input,
textarea.input {
  background-color: #1A1A1A;
  border: 1px solid #444;
  border-radius: var(--radius);
  padding: 12px;
  color: var(--color-text);
  width: 100%;
  font-family: var(--font-main);
  font-size: 1em;
  line-height: 1.6;
  transition: var(--transition);
  margin-bottom: 1em;
}

.input:focus,
textarea.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 207, 255, 0.3);
}

input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* File Input */
input[type="file"] {
  background-color: #1A1A1A;
  color: var(--color-muted);
  border: 1px solid #333;
  border-radius: var(--radius);
  padding: 8px;
  font-size: 0.9em;
  margin-bottom: 1em;
}

/* Labels */
label {
  color: var(--color-muted);
  font-weight: 500;
  font-size: 0.95em;
  margin-bottom: 0.4em;
  display: block;
}

/* Tags & Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--color-surface);
  color: var(--color-muted);
}

/* Shadows & Transitions */
.shadow {
  box-shadow: var(--shadow);
}

.transition {
  transition: var(--transition);
}


.threads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.thread-card {
  background-color: #1e1e1e;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: background 0.2s ease;
}

.thread-card:hover {
  background-color: #2a2a2a;
}

.thread-subject {
  font-size: 1.2rem;
  color: #00bfff;
  text-decoration: none;
}

.thread-meta {
  font-size: 0.9rem;
  color: #ccc;
  margin-top: 0.5rem;
}

.sort-dropdown {
  background-color: #2b2b2b;
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #444;
}


.sort-dropdown {
  background-color: #1a1a1a;
  color: #ffffff;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.5em 1em;
  font-size: 1em;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.sort-dropdown:focus {
  outline: none;
  border-color: #00CFFF;
}

@media (max-width: 600px) {
  .sort-dropdown {
    font-size: 1.1em;
    width: 100%;
  }
}


/* === Active Message Thread Styles === */

#message-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

#thread-subject {
  font-size: 1.3em;
  font-weight: 600;
  margin-bottom: 0.3em;
  color: var(--color-primary);
}

#thread-meta {
  font-size: 0.9em;
  color: var(--color-muted);
  margin-bottom: 1em;
  line-height: 1.4;
}

#messages-list {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1em;
  background-color: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid #333;
  margin-bottom: 1em;
}

#messages-scroll {
  flex: 1;
  overflow-y: auto;
  background: #1e1e1e;
  border-radius: 6px;
  color: white;
  padding: 1em;
  margin-bottom: 1em;
  min-height: 0; /* ✅ Enables proper flex scroll */
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#messages-scroll::-webkit-scrollbar {
  width: 8px;               /* Chrome, Safari */
}

#messages-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  border: 2px solid transparent; /* padding effect */
  background-clip: content-box;
}

#messages-scroll::-webkit-scrollbar-track {
  background: transparent;
}

#messages-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.35);
}



.message {
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #333;
}

.message:last-child {
  border-bottom: none;
}

.message-author {
  font-weight: 600;
  color: var(--color-primary);
}

.message-time {
  font-size: 0.8em;
  color: var(--color-muted);
  margin-top: 2px;
  margin-bottom: 5px;
}

.message-text {
  color: var(--color-text);
  white-space: pre-wrap;
}

#newMessageInput {
  flex: 1;
  resize: none;
  padding: 0.6em 0.75em;
  font-size: 1em;
  line-height: 1.4;
  background: #2a2a2a;
  color: white;
  border: none;
  border-radius: 8px;
  max-height: 120px;
  overflow-y: auto;
}


#toast {
  visibility: hidden;
  min-width: 200px;
  background: #222;
  color: #fff;
  text-align: center;
  border-radius: var(--radius);
  padding: 10px;
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  transition: opacity 0.5s;
  box-shadow: var(--shadow);
}


.fullscreen-chat {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #121212;
  border-radius: 0;
  box-shadow: none;
}


.fullscreen-chat-wrapper {
  background-color: #121212;
  color: #ffffff;
  width: 100%;
  height: 100%;
  padding: 0px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.chat-panel {
  background-color: #1e1e1e;
  border: 1px solid #2c2c2c;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.toggle-btn {
  background: #222;
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.participants-wrapper {
  margin-bottom: 1em;
  background: #1e1e1e;
  border-radius: 6px;
  padding: 0.5em;
  color: white;
}

.participants-toggle {
  background: none;
  border: none;
  color: #ffffff;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  text-align: left;
  padding: 0.5em 0;
  font-size: 1em;
}

.participants-list {
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 500px; /* open state */
}

.participants-list.collapsed {
  max-height: 0;
}


.participants-wrapper.closed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.participants-wrapper.open {
  max-height: 1000px; /* or whatever fits */
  opacity: 1;
}

.fullscreen-chat-wrapper {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #121212;
  display: flex;
  flex-direction: column;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 1em;
  background-color: #1e1e1e;
  padding: 0.75em 1em;
  margin-bottom: 0.75em;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
  color: #ffffff;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2em;
  color: #fff;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details {
  display: flex;
  flex-direction: column;
}

.details .name {
  font-weight: 600;
  font-size: 1em;
  color: #f0f0f0;
}

.details .email {
  font-size: 0.85em;
  color: #bbbbbb;
  word-break: break-all;
}


.form-step {
  display: none;
}
.form-step.active {
  display: block;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2em;
}
.wizard-nav button {
  padding: 10px 20px;
  font-size: 1em;
}


.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid #444;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  width: 40px;
  height: 40px;
  background-color: #666;
  color: #fff;
  border-radius: 50%;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-details {
  display: flex;
  flex-direction: column;
}




/* Dark mode input/textarea styles */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.6em 0.8em;
  margin-top: 0.3em;
  margin-bottom: 1.2em;
  border: 1px solid #444;
  border-radius: 6px;
  background-color: #1c1c1c;
  color: #fff;
  font-size: 1em;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #00bcd4;
  box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.3);
  outline: none;
}

/* Checkbox grid layout */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6em;
  margin-bottom: 1.5em;
}

.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1c1c1c;
  padding: 0.5em 1em;
  border-radius: 8px;
  margin-bottom: 0.75em;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 1em;
}

.chat-toolbar.unified-toolbar {
  display: flex;
  gap: 1em;
  background: #1e1e1e;
  padding: 0.75em 1em;
  border-radius: 6px 6px 0 0;
  align-items: center;
  justify-content: flex-start; /* <-- this is key */
  flex-wrap: wrap;             /* optional, allows wrapping on small screens */
}


.toolbar-item {
  background: transparent;
  border: none;
  color: #e0e0e0;
  font-weight: 500;
  font-size: 1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25em;
}

.toolbar-item:hover {
  color: #66ccff;
}

.toolbar-panel {
  background: #1a1a1a;
  border-radius: 6px;
  padding: 1em;
  margin-bottom: 0.75em;
  color: #ffffff;
}

.toolbar-item .chevron {
  fill: #bbbbbb;
  transition: transform 0.2s ease;
}

.toolbar-item.open .chevron {
  transform: rotate(180deg);
}

.hidden {
  display: none !important;
}


#emojiPanel::-webkit-scrollbar {
  width: 8px;
}

#emojiPanel::-webkit-scrollbar-track {
  background: #1e1e1e; /* match panel background */
}

#emojiPanel::-webkit-scrollbar-thumb {
  background-color: #444;  /* dark gray thumb */
  border-radius: 4px;
  border: 2px solid #1e1e1e;
}

#emojiPanel::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}

.emoji-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.emoji-btn {
  background: none;
  border: none;
  font-size: 1.5em;
  padding: 0em 0.4em;
  cursor: pointer;
  line-height: 1;
}

.emoji-btn:hover {
  background: #3a3a3a;
}

#emojiBtn {
  font-size: 1.5em;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  width: 50px;
  cursor: pointer;
}

#emojiBtn:hover {
  color: #fff;
}


/* Firefox */
#emojiPanel {
  position: absolute;
  bottom: 60px;
  left: 0;
  background: #1e1e1e;
  border-top: 1px solid #333;
  width: 100%;
  padding: 0.5em;
  max-height: 200px;
  overflow-y: auto;
  z-index: 20;
}

.admin-tab-btn {
  background: #2a2a2a;
  color: white;
  border: 1px solid #555;
  padding: 0.5em 1em;
  border-radius: 4px;
  cursor: pointer;
}
.admin-tab-btn:hover {
  background: #3a3a3a;
}

#chatInputWrapper {
  display: flex;
  align-items: center !important;
  gap: 0.5em;
  background: #1e1e1e;
  border-top: 1px solid #333;
  padding: 0.3em 0.75em; /* tighter padding */
}


#chatInputWrapper textarea {
  flex: 1;
  resize: none;
  background: #1e1e1e;
  color: white;
  border: 1px solid #2c2c2c;
  border-radius: 6px;
  padding: 0.3em 0.7em;
  font-size: 1em;
  line-height: 1.4;
  min-height: 50px;
  max-height: 120px;
  overflow-y: auto;
  transition: all 0.2s ease;
}

#chatInputWrapper.collapsed textarea {
  max-height: 36px;
  overflow: hidden;
}

#chatInputWrapper button#sendButton {
  background: #00CFFF;
  color: black;
  border: none;
  padding: 0.2em 1em;
  font-weight: bold;
  font-size: 1em;
  border-radius: 6px;
  cursor: pointer;
  min-width: 60px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}



.popup-btn {
  display: block;
  width: 100%;
  background: #333;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5em 1em;
  margin: 0.3em 0;
  cursor: pointer;
  font-size: 0.9em;
  text-align: left;
  transition: background 0.2s;
}

.popup-btn:hover {
  background: #00cfff;
  color: #000;
}

.group-tab {
  background: #333;
  border: 1px solid #555;
  padding: 0.5em 1em;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-size: 0.9em;
}
.group-tab:hover {
  background-color: #00cfff;
  color: #000;
}
.group-tab.active {
  background-color: #00cfff;
  color: #000;
  font-weight: bold;
}


.chat-message-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1em;
  max-width: 90%;
}

.chat-message-row.your-message {
  justify-content: flex-end;
  align-self: flex-end;
  margin-left: auto;
}

.chat-message-row.other-message {
  justify-content: flex-start;
}

.chat-message-bubble {
  background-color: #222;
  padding: 0.75em 1em;
  border-radius: 1em;
  max-width: 100%;
  word-break: break-word;
}

.your-message .chat-message-bubble {
  background-color: var(--color-primary);
  color: #000;
  border-top-right-radius: 0;
}

.other-message .chat-message-bubble {
  background-color: #333;
  color: white;
  border-top-left-radius: 0;
  margin-left: 0.5em;
}

.chat-meta {
  font-size: 0.75em;
  color: var(--color-muted);
  margin-bottom: 0.25em;
}

.chat-text {
  font-size: 1em;
  white-space: pre-wrap;
}

.avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-right: 0.5em;
  object-fit: cover;
}


.color-picker {
  display: flex;
  align-items: center;
  gap: 1em;
  margin-bottom: 1em;
}

.color-picker input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  appearance: none;
}

.color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker input[type="color"]::-webkit-color-swatch {
  border: 2px solid #666;
  border-radius: 6px;
}
.color-picker input[type="color"]::-moz-color-swatch {
  border: 2px solid #666;
  border-radius: 6px;
}


.message-preview-bubble {
  margin: 1em 0;
  padding: 0.75em 1em;
  border-radius: 1em;
  max-width: 300px;
  color: white;
  font-size: 1em;
  background-color: #4f86f7;
  transition: all 0.2s ease;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-preview-bubble .chat-meta {
  font-size: 0.75em;
  color: #ddd;
  margin-bottom: 0.25em;
}


.message-preview-bubble.others-view {
  background-color: #1e1e1e; /* charcoal/dark base */
  border: 1px solid #333;
  color: #00cfff; /* fallback identity color */
}






@media (max-width: 768px) {
  .fullscreen-chat-wrapper {
    padding: 0 !important;
  }

  #message-inner {
    padding: 0 !important;
  }

  #messages-scroll,
  #chatInputWrapper,
  .chat-toolbar,
  .toolbar-panel,
  .participants-wrapper {
    border-radius: 0 !important;
    padding-left: 0.5em;
    padding-right: 0.5em;
  }

  #chatInputWrapper {
    padding-left: 0.75em !important;
    padding-right: 0.75em !important;
  }

  #adminPanelModal {
    width: 96vw !important;
    left: 2vw !important;
    transform: none !important;
  }
}



@media (max-width: 768px) {
  #messages-scroll {
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
}


.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #00cfff; /* or white, depending on theme */
  font-weight: bold;
  font-family: 'Segoe UI', sans-serif; /* or custom font */
  font-size: 1.4em;
  gap: 0.5em;
}

.logo-icon {
  height: 36px;
  width: auto;
  object-fit: contain;
  transition: height 0.2s ease;
}

.logo-text {
  margin-left: 0.5em;
  font-size: 1.2em;
  font-weight: bold;
  transition: font-size 0.2s ease, opacity 0.2s ease;
}

/* Shrink on smaller screens */
@media (max-width: 700px) {
  .logo-icon {
    height: 28px;
  }

  .logo-text {
    font-size: 1em;
  }
}


.stack-part {
  color: white;
}

.verse-part {
  color: var(--color-primary); /* stays brand blue (#00CFFF) */
}



/* Hide text on very small screens */
@media (max-width: 450px) {
  .logo-text {
    display: none;
  }
}



.nav-color-block {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.15);
}

/* Brand color blocks */
.nav-color-block.blue    { background-color: #00CFFF; }  /* primary */
.nav-color-block.orange  { background-color: #FF5C3B; }  /* accent 1 */
.nav-color-block.yellow  { background-color: #FFB300; }  /* accent 2 */
.nav-color-block.green   { background-color: #00FF99; }  /* bonus neon */
.nav-color-block.magenta { background-color: #FF00FF; }  /* retro pop */
.nav-color-block.red     { background-color: #FF4444; }  /* danger / logout */
.nav-color-block.purple  { background-color: #9966FF; }  /* alternate */



.section-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 1.5em;
  margin-bottom: 2em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 100%;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

.accent-blue {
  background: #00CFFF;
}

.accent-purple {
  background: #7f5af0;
}

.accent-red     { background: #FF4A2F; }  
.accent-yellow  { background: #FFB300; } 
.accent-orange  { background: #FF5C3B; } 


.accent-green {
  background-color: #00FF99; /* Neon minty green */
}

.accent-magenta {
  background-color: #FF00FF; /* Pure magenta */
}





.section-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 1em;
  color: #fff;
}

.contact-subtext {
  color: #aaa;
  margin-bottom: 1.5em;
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1em;
}

.input-row input,
.input-row select {
  padding: 0.6em 1em;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #fff;
  max-width: 300px;
}

.input-row select {
  min-width: 160px;
}

.input-row button {
  padding: 0.6em 1.2em;
  border-radius: 8px;
  font-weight: 600;
  background: #00CFFF;
  color: #000;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.input-row button:hover {
  background: #00b8e6;
}

#contact-toast {
  visibility: hidden;
  min-width: 200px;
  background: #333;
  color: #fff;
  text-align: center;
  border-radius: 4px;
  padding: 10px;
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  transition: opacity 0.5s ease;
}


.mention-highlight {
  outline: 2px solid #ffd700;
  animation: pulse 0.8s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.handle-row {
  display: flex;
  align-items: center;
  gap: 6px; /* spacing between @ and input */
  margin-bottom: 1em;
}

.handle-at {
  font-size: 1.1em;
  line-height: 1.4em;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #00CFFF;
}

input:checked + .slider:before {
  transform: translateX(22px);
}



.link-button {
  background: none;
  color: gray;
  font-size: 0.9em;
  border: none;
  padding: 0;
  margin-top: 0.5em;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover {
  color: #ccc;
}


/* === Community Card Upgrades === */

.community-card {
  background-color: var(--color-surface);
  border: 1px solid #2c2c2c;
  border-radius: var(--radius);
  padding: 1.2em 1.4em;
  margin-bottom: 1.2em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: border-color 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}

.community-card:hover {
  background-color: #1f1f1f;
  border-color: var(--color-primary);
}

.community-name {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5em;
}

.community-meta {
  font-size: 0.92em;
  color: var(--color-muted);
  margin-bottom: 0.5em;
  line-height: 1.5;
}

.pill {
  display: inline-block;
  background: #2a2a2a;
  color: #ccc;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  font-size: 0.75em;
  margin: 0.2em 0.4em 0 0;
  border: 1px solid #3a3a3a;
  transition: background 0.2s ease;
}

.pill:hover {
  background-color: var(--color-primary);
  color: #000;
  border-color: var(--color-primary);
}

.pill.pinned {
  background-color: #004c5f;
  color: var(--color-primary);
  font-weight: bold;
}

.fav-toggle {
  font-size: 0.75em;
  padding: 0.3em 0.7em;
  border-radius: 6px;
  background: #2a2a2a;
  color: #ccc;
  border: 1px solid #444;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.fav-toggle:hover {
  background-color: var(--color-primary);
  color: #000;
  border-color: var(--color-primary);
}



.group-widget {
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 0.8em 1.2em;
  margin-right: 0.5em;
  margin-bottom: 0.5em;
  display: inline-block; /* use inline-block instead of flex for drag compatibility */
  cursor: grab;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: background 0.2s, border 0.2s;
}

.group-widget:hover {
  border-color: var(--color-primary);
  background-color: #252525;
}

.group-widget:active {
  cursor: grabbing;
  opacity: 0.7;
  transform: scale(0.98);
}

.group-widget.selected {
  background-color: var(--color-primary);
  color: #000;
  font-weight: bold;
  border-color: var(--color-primary);
  
}

.group-widget.dragging {
  opacity: 0.7;
  transform: scale(0.95);
  cursor: grabbing;
}

.group-widget .rename-icon {
  font-size: 0.85em;
  color: #bbb;
  margin-left: auto;
  cursor: pointer;
}
.group-widget .rename-icon:hover {
  color: #000;
}


.secondary-button {
  background-color: #2a2a2a;
  color: white;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.5em 1.2em;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.secondary-button:hover {
  background-color: #3a3a3a;
  border-color: #00CFFF;
  color: #00CFFF;
}


<!-- more below --->

.thread-card {
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 1em;
  margin-bottom: 1em;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.thread-card:hover {
  border-color: #00CFFF;
  background-color: #222;
  transform: scale(1.01);
  box-shadow: 0 2px 10px rgba(0, 207, 255, 0.15);
}
.thread-title {
  color: #00CFFF;
  font-weight: bold;
  font-size: 1.3em;
  margin-bottom: 0.4em;
}
.thread-meta {
  color: #bbb;
  font-size: 0.9em;
  margin-top: 0.4em;
}
.thread-date {
  font-size: 0.85em;
  color: #888;
}




.ql-toolbar.ql-snow {
  background: #1e1e1e;
  border: none;
  border-top: 1px solid #333;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  color: #ccc;
}

.ql-toolbar button svg {
  filter: invert(1);
}


.ql-toolbar.ql-snow .ql-picker {
  color: #ccc;
}

.ql-toolbar.ql-snow .ql-stroke {
  stroke: #ccc;
}
.ql-toolbar.ql-snow .ql-fill {
  fill: #ccc;
}
.ql-toolbar.ql-snow .ql-picker-options {
  background: #1e1e1e;
  border: 1px solid #333;
}

.ql-toolbar.ql-snow .ql-picker-item:hover,
.ql-toolbar.ql-snow .ql-picker-label:hover {
  color: #0a84ff;
}

.ql-container.ql-snow {
  background: #1a1a1a;
  color: white;
  border: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border: none !important;
}

.ql-editor {
  border: none;
  background: #1a1a1a;
  color: white;
  padding: 1em;
}
.ql-editor::placeholder {
  color: #777;
}

#topmenu-container img {
  filter: brightness(1.4) contrast(1.2);
}


.ql-toolbar.ql-snow button:hover {
  box-shadow: none !important;
  background-color: #2a2a2a;
  border: none !important;
  border-top: 1px solid #333;
  border-radius: 4px;
}

.ql-container.ql-snow:focus-within {
    border: none !important;
  border-radius: 6px;
  background: #1a1a1a;
}

.ql-editor {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: none !important;
}

.ql-editor:focus {
  outline: none;
  box-shadow: 0 0 0 1px #0a84ff;
}



.reply-footer {
  background: #1e1e1e;
  padding: 0.5em;
  text-align: right;
  border-top: 1px solid #333;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}


#editor {
  min-height: 150px;
  background: #1a1a1a;
  color: white;
  border-radius: 6px;
  padding: 0.75em;
}






#sendBtn {
  padding: 0.5em 1.5em;
  font-weight: bold;
  background: #0a84ff;
  border-radius: 6px;
  border: none;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}
#sendBtn:hover {
  background: #006be1;
}


.reply-box {
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  padding: 1em;
  gap: 1em;
}

.messages-scrollable {
  max-height: calc(100vh - 260px); /* adjust based on reply panel size */
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.messages-scrollable::-webkit-scrollbar {
  width: 8px;
}
.messages-scrollable::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.2);
  border-radius: 4px;
}

.reply-button-container {
  padding: 1em;
  background: #222; /* Match reply panel */
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #333;
}

.reply-send-btn {
  align-self: flex-end;
  margin-top: 0.5em;
  padding: 0.4em 1.2em;
  font-weight: 500;
  font-size: 0.95em;
}



.quick-reply {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1e1e1e;
  border-top: 1px solid #333;
  padding: 0 0.75em;
  height: 40px; /* match collapsed height */
  gap: 0.5em;
  box-sizing: border-box;
}

.quick-reply input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  color: white;
  padding: 0.3em 0.6em;
  font-size: 0.9em;
  height: 28px;
  line-height: 1.2;
}

.quick-reply button {
  background: #0a84ff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.3em 0.9em;
  height: 28px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
}
.quick-reply button:hover {
  background: #006be1;
}


#replyPanel[data-state="collapsed"] .quick-reply {
  display: flex;
}



#replyPanel[data-state="collapsed"] #editorContainer {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
}

#replyPanel[data-state="collapsed"] .reply-box {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
}

#replyPanel[data-state="collapsed"] {
  margin: 0 !important;
}


#quickReplyBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75em;
  height: 40px;
  background: #1e1e1e;
  border-top: 1px solid #333;
  box-sizing: border-box;
}


#quickReplyBar input {
  flex: 1;
  padding: 0.4em 0.6em;
  border-radius: 4px;
  border: none;
  background: #333;
  color: white;
  max-width: 300px;
}

#quickReplySendBtn {
  background: #0a84ff;
  color: white;
  border: none;
  padding: 0.4em 0.8em;
  border-radius: 4px;
  cursor: pointer;
}

#quickReplySendBtn:hover {
  background: #006be1;
}

#replyPanel[data-state="collapsed"] #editorContainer {
  display: none;
}

#replyPanel[data-state="collapsed"] #quickReplyBar {
  display: flex;
}

#replyPanel:not([data-state="collapsed"]) #quickReplyBar {
  display: none;
}


.editor-scroll-wrapper {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5em;
  padding-bottom: 1em;
}


.sender-name {
  font-weight: 600;
  font-size: 1em;
  color: #fff;
}

.timestamp {
  font-size: 0.85em;
  color: #aaa;
}


.subject-line {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #0af;
  border-radius: 50%;
}


.snippet {
  font-size: 0.9em;
  color: #aaa;
  margin-top: 4px;
}


.inbox-tabs {
  margin-top: 1em;
}

.inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1em;
}

.row-controls select,
.row-controls button {
  width: auto;
  min-width: 160px;
  flex-shrink: 0;
}

/* Reduce space between all controls */
.inbox-controls,
.bulk-controls {
  margin: 0.5em 0;
  padding: 0;
  gap: 0.4em;
  flex-wrap: wrap;
  display: flex;
  align-items: center;
}

/* Standardize compact appearance */
.inbox-controls input,
.inbox-controls select,
.bulk-controls button,
.inbox-controls button {
  padding: 0.35em 0.75em;
  font-size: 0.85em;
  line-height: 1.2em;
  min-height: 32px;
}

/* Make search field grow while others stay fixed */
.inbox-controls input#pmSearch {
  flex: 1;
  min-width: 200px;
  padding: 0.4em 0.75em;
  border-radius: 4px;
  background: #1e1e1e;
  color: white;
  border: none;
}


/* Tighten the Clear button */
.inbox-controls button {
  white-space: nowrap;
}

/* Compact action buttons */
.bulk-controls button {
  padding: 0.4em 1em;
  font-size: 0.85em;
  min-width: 100px;
  white-space: nowrap;
}



.new-pm-btn {
  background: #00CFFF;
  color: black;
  font-weight: bold;
  padding: 0.5em 1em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.new-pm-btn:hover {
   transform: scale(1.06);
   background-color: #00CFFF; /* Keep same color to avoid darkening */
}



.tab-buttons {
  display: flex;
  gap: 0.5em;
  margin-bottom: 0.5em;
}

.tab-button {
  padding: 0.4em 1em;
  background: #1e1e1e;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab-button:hover {
  background: #2a2a2a;
}

.tab-button.active {
  background: #00CFFF;
  color: black;
  border-color: #00CFFF;
}

.delete-all-button {
  background: #660000;
  color: white;
  border: none;
  padding: 0.4em 1em;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.delete-all-button:hover {
  background: #990000;
}



.thread-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #00CFFF;
  border-radius: 4px;
  background-color: #121212;
  cursor: pointer;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  margin-top: 6px;
  transition: all 0.2s ease;
}

.thread-checkbox:checked {
  background-color: #00CFFF;
  box-shadow: 0 0 0 2px #00CFFF66;
}

.thread-checkbox:checked::after {
  content: "✔";
  color: black;
  font-size: 14px;
  position: absolute;
  top: 0;
  left: 4px;
  font-weight: bold;
}

.thread-checkbox:focus {
  transform: scale(1.1);
}

/* Shared flex cleanup */
.compact-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  align-items: center;
  margin-top: 1em;
}

.compact-controls select,
.compact-controls input,
.compact-controls button {
  padding: 0.4em 0.75em;
  border-radius: 4px;
  background: #1e1e1e;
  color: white;
  border: none;
  min-width: 150px;
}


@media (max-width: 600px) {
  .inbox-controls,
  .bulk-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
    justify-content: space-between;
  }

  .inbox-controls input[type="text"] {
    flex: 1 1 100%;
  }

  .inbox-controls select {
    flex: 1 1 calc(50% - 0.5em);
    min-width: 140px;
  }

  .bulk-controls button {
    flex: 1 1 calc(33% - 0.5em);
    min-width: 100px;
    white-space: nowrap;
  }

  .bulk-controls {
    margin-top: 0.5em;
  }
}

.scrollable-dark {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  overflow-y: auto;
}

.scrollable-dark::-webkit-scrollbar {
  width: 8px;
}

.scrollable-dark::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.scrollable-dark::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

.scrollable-dark::-webkit-scrollbar-track {
  background: transparent;
}
