/* ============================================================
   XENFORO STYLE ROLEPLAY FORUM ENGINE — CUSTOM STYLE SYSTEM
   Features: Light/Dark Theme, XenForo 2.x look, BBCode Parsers,
             Staff Badges, Discord-like PM, Glassmorphic ACP.
   ============================================================ */

:root {
  /* Common variables */
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --display: 'Oswald', sans-serif;
  --body: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: all 0.2s ease;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg: #141518;
  --panel: #1C1D21;
  --panel-2: #24252B;
  --border: #2C2E35;
  --border-strong: #3A3D46;
  --text: #E6E8EA;
  --text-muted: #9598A1;
  --text-faint: #5E6169;
  --accent: #E3A73C;
  --accent-text: #2A1D05;
  --danger: #EF4444;
  --success: #10B981;
  --info: #3B82F6;
  --warning: #F59E0B;
  --shadow: rgba(0, 0, 0, 0.4);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg: #F0F2F5;
  --panel: #FFFFFF;
  --panel-2: #F7F9FB;
  --border: #DDE1E6;
  --border-strong: #C1C7CD;
  --text: #212529;
  --text-muted: #69707A;
  --text-faint: #A2A9B4;
  --accent: #C98A17;
  --accent-text: #FFFFFF;
  --danger: #DC3545;
  --success: #198754;
  --info: #0D6EFD;
  --warning: #FFC107;
  --shadow: rgba(0, 0, 0, 0.08);
}

/* Core Settings */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

/* Cursor Glow Follower */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(227,167,60,0.06) 0%, rgba(227,167,60,0) 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease;
}
@media (pointer: coarse) {
  .cursor-glow { display: none; }
}

/* Top Utility Bar */
.top-bar {
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  padding: 8px 0;
  color: var(--text-muted);
}
.top-bar-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-bar-left a:hover {
  color: var(--accent);
}
.divider {
  color: var(--border-strong);
}
.status-online {
  color: var(--success);
  font-weight: 600;
}
.theme-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.theme-toggle-btn:hover {
  color: var(--accent);
}

/* Header & Nav */
.xf-header {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  overflow: hidden;
}
.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.logo-fallback {
  display: none;
  font-family: var(--display);
  color: var(--accent);
  font-weight: 700;
}
.logo-text h2 {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: 0.05em;
  font-weight: 600;
  line-height: 1.1;
}
.logo-text p {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
}
.xf-nav .nav-links {
  display: flex;
  list-style: none;
  gap: 24px;
}
.nav-item {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  padding: 8px 0;
}
.nav-item:hover, .nav-item.active {
  color: var(--text);
}
.nav-item.active::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.badge-count {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  vertical-align: top;
}

/* User Panel */
.user-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-info-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.user-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-muted);
}
.user-info-text {
  font-size: 13px;
}
.user-info-text strong {
  color: var(--accent);
}
.user-info-text span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* Sub-nav & Breadcrumb */
.sub-nav {
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.sub-nav-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb .chevron {
  color: var(--text-faint);
}
.notification-trigger-area {
  position: relative;
}
.notification-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  position: relative;
}

/* Notifications Dropdown */
.notifications-dropdown {
  position: absolute;
  top: 32px; right: 0;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px var(--shadow);
  z-index: 1000;
  display: none;
}
.notifications-dropdown.active {
  display: block;
}
.noti-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.noti-header h3 {
  font-size: 14px;
}
.noti-header button {
  background: transparent;
  border: none;
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
}
.noti-list {
  max-height: 280px;
  overflow-y: auto;
}
.noti-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.noti-item:hover {
  background: var(--panel-2);
}
.noti-item.unread {
  background: rgba(227,167,60,0.04);
}
.noti-item .time {
  font-size: 10px;
  color: var(--text-faint);
}
.noti-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* SPA Views Layout */
.main-wrapper {
  padding-top: 24px;
  padding-bottom: 60px;
  min-height: calc(100vh - 240px);
}
.spa-view {
  display: none;
}
.spa-view.active {
  display: block;
}

/* Forum Grid Layout */
.forum-grid-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
}

/* Category Block */
.category-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow);
}
.category-header {
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
}
.category-header h2 {
  font-family: var(--display);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.forum-row {
  display: grid;
  grid-template-columns: 48px 1fr 140px 220px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.01);
  transition: var(--transition);
}
.forum-row:last-child {
  border-bottom: none;
}
.forum-row:hover {
  background: var(--panel-2);
}
.forum-icon {
  font-size: 20px;
  color: var(--text-faint);
}
.forum-info h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 2px;
}
.forum-info h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.forum-info p {
  font-size: 12px;
  color: var(--text-muted);
}
.forum-stats {
  font-size: 12px;
  color: var(--text-muted);
}
.forum-stats span {
  display: block;
}
.forum-last-post {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.forum-last-post strong {
  display: block;
  color: var(--text);
}

/* Sidebar Styling */
.forums-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sidebar-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.sidebar-block h3 {
  font-family: var(--display);
  font-size: 13.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
}
.stat-row strong {
  font-family: var(--mono);
}
.staff-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.staff-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.staff-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-strong);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.staff-details span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* Threads List View */
.section-title {
  margin-bottom: 20px;
}
.section-title h2 {
  font-family: var(--display);
  font-size: 22px;
  text-transform: uppercase;
}
.section-title p {
  font-size: 13px;
  color: var(--text-muted);
}
.threads-table-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.threads-header-row {
  display: grid;
  grid-template-columns: 1fr 140px 220px;
  background: var(--panel-2);
  padding: 10px 18px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}
.threads-list-body .thread-row-item {
  display: grid;
  grid-template-columns: 1fr 140px 220px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.01);
  transition: var(--transition);
}
.threads-list-body .thread-row-item:hover {
  background: var(--panel-2);
}
.thread-row-item .title-block h4 {
  font-size: 14px;
  font-weight: 600;
}
.thread-row-item .title-block h4 a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.thread-row-item .title-block p {
  font-size: 11.5px;
  color: var(--text-muted);
}
.thread-row-item .stats-block {
  font-size: 12px;
  color: var(--text-muted);
}
.thread-row-item .last-reply-block {
  font-size: 12px;
  color: var(--text-muted);
}

/* Post Container (XenForo Thread Detail) */
.posts-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.post-block {
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 12px var(--shadow);
}
.post-author-panel {
  background: var(--panel-2);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.post-avatar-large {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-strong);
  overflow: hidden;
  margin-bottom: 12px;
}
.post-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-author-name {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 4px;
}
.post-author-name:hover {
  color: var(--accent);
}
.post-author-title {
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Staff Ribbons */
.staff-ribbon {
  font-size: 9.5px;
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
  margin-bottom: 8px;
  width: 100%;
  text-align: center;
}

/* Ribbon Color Database */
.ribbon-founder { background: rgba(239, 68, 68, 0.1); color: #EF4444; border-color: rgba(239, 68, 68, 0.3); }
.ribbon-developer { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; border-color: rgba(139, 92, 246, 0.3); }
.ribbon-admin { background: rgba(245, 158, 11, 0.1); color: #F59E0B; border-color: rgba(245, 158, 11, 0.3); }
.ribbon-moderator { background: rgba(59, 130, 246, 0.1); color: #3B82F6; border-color: rgba(59, 130, 246, 0.3); }
.ribbon-vip { background: rgba(236, 72, 153, 0.1); color: #EC4899; border-color: rgba(236, 72, 153, 0.3); }

/* User Details list */
.author-details-list {
  width: 100%;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.author-details-list div {
  display: flex;
  justify-content: space-between;
}
.author-details-list strong {
  color: var(--text);
}

/* Post Message Panel */
.post-message-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 260px;
}
.post-body-content {
  font-size: 14.5px;
  line-height: 1.7;
}

/* Reactions Bar */
.post-reactions-bar {
  border-top: 1px solid rgba(255,255,255,0.02);
  margin-top: 20px;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reaction-scores {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.reaction-buttons-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.reaction-trigger-btn {
  font-size: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}
.reaction-trigger-btn:hover {
  color: var(--accent);
}
.reaction-selector-popover {
  position: absolute;
  bottom: 24px; right: 0;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  gap: 8px;
  box-shadow: 0 8px 24px var(--shadow);
  display: none;
}
.reaction-selector-popover button {
  font-size: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.reaction-selector-popover button:hover {
  transform: scale(1.3);
}

/* Signature */
.post-signature {
  border-top: 1px dashed var(--border);
  margin-top: 20px;
  padding-top: 10px;
  font-size: 11.5px;
  color: var(--text-faint);
}

/* WYSIWYG Editor */
.wysiwyg-editor {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--panel-2);
  overflow: hidden;
  margin-bottom: 12px;
}
.editor-toolbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border-strong);
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.editor-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}
.editor-toolbar button:hover {
  background: var(--panel-2);
  border-color: var(--border-strong);
}
.toolbar-divider {
  color: var(--border-strong);
}
.wysiwyg-editor textarea {
  width: 100%;
  min-height: 140px;
  padding: 16px;
  background: transparent;
  border: none;
  resize: vertical;
  font-size: 13.5px;
  outline: none;
  color: var(--text);
}
.editor-preview {
  padding: 16px;
  background: rgba(0,0,0,0.1);
  font-size: 13.5px;
  min-height: 140px;
}

/* BBCODE PARSER BOXES */
.bb-box {
  border-left: 3px solid;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 12px 0;
  background: rgba(255,255,255,0.01);
}
.bb-warning { border-color: var(--danger); background: rgba(239, 68, 68, 0.03); color: var(--danger); }
.bb-info { border-color: var(--info); background: rgba(59, 130, 246, 0.03); color: var(--info); }
.bb-success { border-color: var(--success); background: rgba(16, 185, 129, 0.03); color: var(--success); }

/* BBCode Custom RP tags */
.bb-me {
  color: #c482ff;
  font-weight: 500;
  font-family: var(--mono);
}
.bb-do {
  color: #ffde82;
  font-weight: 500;
  font-family: var(--mono);
}
.bb-try-success {
  color: var(--success);
  font-family: var(--mono);
}
.bb-try-fail {
  color: var(--danger);
  font-family: var(--mono);
}
.bb-radio {
  background: #111e16;
  border: 1px solid #1c3d28;
  color: #4ef080;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--mono);
  margin: 10px 0;
}
.bb-phone {
  background: #151821;
  border: 1px solid #283754;
  color: #8ab4f8;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--mono);
  margin: 10px 0;
}
.bb-spoiler-box {
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 10px 0;
}
.bb-spoiler-header {
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  color: var(--accent);
}
.bb-spoiler-content {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* User Profile Page */
.profile-banner {
  height: 240px;
  background: var(--panel-2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.profile-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-meta-header {
  display: flex;
  gap: 24px;
  padding: 0 32px;
  margin-top: -60px;
  position: relative;
  z-index: 10;
  margin-bottom: 24px;
}
.profile-avatar-xl {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  border: 4px solid var(--panel);
  background: var(--border-strong);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.profile-avatar-xl img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-title-area {
  margin-top: 64px;
}
.profile-title-area h2 {
  font-family: var(--display);
  font-size: 24px;
}
.profile-tabs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}
.profile-tab-content-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* Profile left panel soft banner fade */
.profile-left-banner-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.profile-left-banner-bg {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.18;
  transform: scale(1.05);
  filter: blur(0.5px);
  animation: profileLeftBannerFade 6s ease-in-out infinite;
  pointer-events: none;
}

.profile-left-banner-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20,21,24,0.9) 0%, rgba(20,21,24,0.55) 45%, rgba(20,21,24,0.25) 100%);
}

[data-theme="light"] .profile-left-banner-bg::after {
  background: linear-gradient(90deg, rgba(240,242,245,0.92) 0%, rgba(240,242,245,0.6) 45%, rgba(240,242,245,0.25) 100%);
}

@keyframes profileLeftBannerFade {
  0%, 100% { opacity: 0.14; }
  50% { opacity: 0.24; }
}

.profile-left-banner-content {
  position: relative;
  z-index: 1;
}


/* PM (DM) Layout */
.dm-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 560px;
  overflow: hidden;
}
.dm-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.dm-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dm-sidebar-header h3 {
  font-size: 15px;
}
.dm-conversations-list {
  flex: 1;
  overflow-y: auto;
}
.dm-conv-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.01);
  cursor: pointer;
  transition: var(--transition);
}
.dm-conv-item:hover, .dm-conv-item.active {
  background: var(--panel-2);
}
.dm-chat-area {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.dm-no-active-chat {
  margin: auto;
  text-align: center;
  color: var(--text-faint);
}
.dm-chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dm-messages-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.5;
}
.chat-msg-bubble.received {
  align-self: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.chat-msg-bubble.sent {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-text);
}
.dm-chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}
.dm-chat-input-area input {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 13.5px;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal.open {
  opacity: 1;
  visibility: visible;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
.modal-container {
  position: relative;
  z-index: 2010;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  box-shadow: 0 15px 40px var(--shadow);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.modal.open .modal-container {
  transform: translateY(0);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-faint);
}
.modal-close:hover {
  color: var(--text);
}
.modal-body {
  padding: 20px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover {
  background: #f0b54d;
}
.btn-ghost {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--panel-2);
  color: var(--text);
}
.btn-reject {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }

/* ACP Layout */
.acp-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 500px;
  overflow: hidden;
}
.acp-sidebar {
  background: var(--panel-2);
  border-right: 1px solid var(--border);
  padding: 20px 0;
}
.acp-sidebar h3 {
  font-family: var(--display);
  font-size: 14px;
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  text-transform: uppercase;
}
.acp-sidebar ul {
  list-style: none;
  margin-top: 12px;
}
.acp-menu-item {
  display: block;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-muted);
}
.acp-menu-item:hover, .acp-menu-item.active {
  background: var(--panel);
  color: var(--text);
  border-left: 3px solid var(--accent);
}
.acp-content {
  padding: 24px;
}

/* Footer styling */
.xf-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 60px;
}
.footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-left p {
  font-size: 13px;
}
.footer-left small {
  color: var(--text-faint);
  font-family: var(--mono);
}
.footer-right {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-right a:hover {
  color: var(--accent);
}

/* -------------------------------------------------------
   ACTIVE USERS BAR (XenForo Style, Text Format)
------------------------------------------------------- */
.active-users-bar {
  margin-top: 28px;
  padding: 12px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
}
.active-users-bar strong {
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 6px;
}
.active-user-name {
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
.active-user-name.is-admin   { color: #EF4444; }
.active-user-name.is-mod     { color: #3B82F6; }
.active-user-name.is-dev     { color: #8B5CF6; }
.active-user-name.is-vip     { color: #F59E0B; }
.active-user-name.is-regular { color: var(--text); }
.active-user-name:hover      { text-decoration: underline; cursor: pointer; }
.active-users-count          { color: var(--text-muted); font-style: italic; }

/* -------------------------------------------------------
   AVATAR UPLOAD OVERLAY (Profile Page)
------------------------------------------------------- */
.avatar-upload-wrapper {
  position: relative;
  display: inline-block;
}
.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}
.avatar-upload-wrapper:hover .avatar-upload-overlay {
  opacity: 1;
}
.avatar-upload-overlay span {
  font-size: 22px;
  color: white;
  pointer-events: none;
}

/* BANNER UPLOAD BUTTON (Profile Page) */
.banner-edit-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.2s ease;
  backdrop-filter: blur(4px);
  z-index: 200;
}
.banner-edit-btn:hover {
  background: rgba(0,0,0,0.75);
}


/* -------------------------------------------------------
   BADGE IMAGES STYLES
------------------------------------------------------- */
/* Badge displays in post user panel */
.post-badges-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 8px;
  max-width: 100%;
}
.post-badge-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  padding: 2px;
  border: 1px solid var(--border);
  transition: transform 0.15s ease;
}
.post-badge-icon:hover {
  transform: scale(1.2);
}
.post-badge-text-tiny {
  font-size: 9px;
  font-family: var(--mono);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-muted);
}

/* Badge displays in Profile Page */
.profile-badge-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-right: 6px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  padding: 3px;
  border: 1px solid var(--border-strong);
  vertical-align: middle;
}

/* ACP Badge Grid */
.badge-acp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.badge-acp-card {
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 160px;
}
.badge-acp-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  padding: 4px;
}
.badge-acp-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.badge-acp-name {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

