/* ============================================
   TREF TALK - Professional Modern Theme
   ============================================ */

/* Default LTR Direction */
html {
  height: 100%;
}

body {
  direction: ltr !important;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* RTL Support for Yiddish Language - Only when explicitly set */
html[lang='yi'],
html[lang='yi-YI'],
body[lang='yi'],
body[lang='yi-YI'] {
  direction: rtl !important;
}

html[lang='yi'] .content,
html[lang='yi-YI'] .content,
body[lang='yi'] .content,
body[lang='yi-YI'] .content {
  direction: rtl !important;
  text-align: right !important;
}

/* RTL for all form fields in Yiddish */
html[lang='yi'] input[type='text'],
html[lang='yi'] input[type='password'],
html[lang='yi'] input[type='email'],
html[lang='yi'] textarea,
html[lang='yi'] select,
html[lang='yi'] .inputbox,
html[lang='yi-YI'] input[type='text'],
html[lang='yi-YI'] input[type='password'],
html[lang='yi-YI'] input[type='email'],
html[lang='yi-YI'] textarea,
html[lang='yi-YI'] select,
html[lang='yi-YI'] .inputbox,
body[lang='yi'] input[type='text'],
body[lang='yi'] input[type='password'],
body[lang='yi'] input[type='email'],
body[lang='yi'] textarea,
body[lang='yi'] select,
body[lang='yi'] .inputbox,
body[lang='yi-YI'] input[type='text'],
body[lang='yi-YI'] input[type='password'],
body[lang='yi-YI'] input[type='email'],
body[lang='yi-YI'] textarea,
body[lang='yi-YI'] select,
body[lang='yi-YI'] .inputbox {
  direction: rtl !important;
  text-align: right !important;
}

/* RTL for all labels and field descriptions */
html[lang='yi'] label,
html[lang='yi'] dt,
html[lang='yi'] dd,
html[lang='yi-YI'] label,
html[lang='yi-YI'] dt,
html[lang='yi-YI'] dd,
body[lang='yi'] label,
body[lang='yi'] dt,
body[lang='yi'] dd,
body[lang='yi-YI'] label,
body[lang='yi-YI'] dt,
body[lang='yi-YI'] dd {
  text-align: right !important;
  direction: rtl !important;
}

/* RTL Forum Topic List */
html[lang='yi'] ul.topiclist dt,
html[lang='yi-YI'] ul.topiclist dt,
body[lang='yi'] ul.topiclist dt,
body[lang='yi-YI'] ul.topiclist dt {
  float: right !important;
  margin-right: 0 !important;
  margin-left: -440px !important;
  direction: rtl !important;
}

html[lang='yi'] ul.topiclist dt .list-inner,
html[lang='yi-YI'] ul.topiclist dt .list-inner,
body[lang='yi'] ul.topiclist dt .list-inner,
body[lang='yi-YI'] ul.topiclist dt .list-inner {
  margin-right: 0 !important;
  margin-left: 440px !important;
  padding-left: 5px !important;
  text-align: right !important;
}

html[lang='yi'] ul.topiclist dd,
html[lang='yi-YI'] ul.topiclist dd,
body[lang='yi'] ul.topiclist dd,
body[lang='yi-YI'] ul.topiclist dd {
  float: right !important;
  border-left: none !important;
  border-right: 1px solid transparent !important;
  text-align: right !important;
  direction: rtl !important;
}

html[lang='yi'] .forum-image,
html[lang='yi-YI'] .forum-image,
body[lang='yi'] .forum-image,
body[lang='yi-YI'] .forum-image {
  float: right !important;
  margin-right: 0 !important;
  margin-left: 5px !important;
}

html[lang='yi'] ul.topiclist .topic-title,
html[lang='yi-YI'] ul.topiclist .topic-title,
body[lang='yi'] ul.topiclist .topic-title,
body[lang='yi-YI'] ul.topiclist .topic-title {
  direction: rtl !important;
  text-align: right !important;
}

html[lang='yi'] ul.topiclist .topic-poster,
html[lang='yi-YI'] ul.topiclist .topic-poster,
body[lang='yi'] ul.topiclist .topic-poster,
body[lang='yi-YI'] ul.topiclist .topic-poster {
  direction: rtl !important;
  text-align: right !important;
}

html[lang='yi'] dd.lastpost,
html[lang='yi-YI'] dd.lastpost,
body[lang='yi'] dd.lastpost,
body[lang='yi-YI'] dd.lastpost {
  direction: rtl !important;
  text-align: right !important;
}

html[lang='yi'] dd.lastpost > span,
html[lang='yi-YI'] dd.lastpost > span,
body[lang='yi'] dd.lastpost > span,
body[lang='yi-YI'] dd.lastpost > span {
  padding-right: 5px !important;
  padding-left: 0 !important;
}

html[lang='yi'] ul.topiclist a,
html[lang='yi-YI'] ul.topiclist a,
body[lang='yi'] ul.topiclist a,
body[lang='yi-YI'] ul.topiclist a {
  direction: rtl !important;
}

/* Keep header and navigation LTR */
.tref-topbar,
.tref-topbar * {
  direction: ltr !important;
}

/* ===== USER CONTROL PANEL STYLING ===== */
.ucp-title {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

#tabs.tabs {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 8px;
  margin-bottom: 24px;
  direction: rtl;
}

#tabs.tabs ul {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  direction: rtl;
}

#tabs.tabs li.tab {
  flex: 0 0 auto;
}

#tabs.tabs li.tab a {
  display: block;
  padding: 12px 20px;
  font-weight: 500;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
  direction: rtl;
  text-align: center;
}

#tabs.tabs li.tab a:hover {
  background: linear-gradient(90deg, #0099cc 0%, #0066ff 100%);
  color: #ffffff !important;
}

#tabs.tabs li.activetab a {
  background: linear-gradient(90deg, #0099cc 0%, #0066ff 100%);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(0, 102, 255, 0.3);
}

.cp-menu {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 20px;
  direction: rtl;
}

.cp-menu .navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cp-menu .navigation li {
  margin-bottom: 4px;
}

.cp-menu .navigation li a {
  display: block;
  padding: 10px 16px;
  border-radius: 8px;
  color: #4b5563;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  direction: rtl;
  text-align: right;
}

.cp-menu .navigation li a:hover {
  background: linear-gradient(90deg, #0099cc 0%, #0066ff 100%);
  color: #ffffff;
}

.cp-menu .navigation li#active-subsection a,
.cp-menu .navigation li.active-subsection a {
  background: linear-gradient(90deg, #0099cc 0%, #0066ff 100%);
  color: #ffffff;
  font-weight: 600;
}

.cp-main .panel {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  direction: rtl;
}

.cp-main .panel .inner {
  padding: 24px;
}

.cp-main h3,
.cp-main h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
  text-align: right;
}

.cp-main .content {
  color: #374151;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
}

.cp-main .content p {
  margin-bottom: 12px;
}

.cp-main .content a {
  color: #0066ff;
  font-weight: 500;
}

.cp-main .content a:hover {
  color: #0099cc;
}

.page-body {
  margin-top: 61px !important;
  width: 90% !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  font-size: 14px;
}

/* CSS Variables for consistent theming */
:root {
  --tref-primary: #016dff;
  --tref-primary-hover: #0056cc;
  --tref-primary-light: rgba(1, 109, 255, 0.1);
  --tref-text-dark: #111827;
  --tref-text: #374151;
  --tref-text-muted: #6b7280;
  --tref-text-light: #9ca3af;
  --tref-bg: #f8fafc;
  --tref-bg-white: #ffffff;
  --tref-bg-hover: #f1f5f9;
  --tref-border: #e2e8f0;
  --tref-border-light: #f1f5f9;
  --tref-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --tref-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --tref-shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --tref-shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --tref-radius-sm: 6px;
  --tref-radius: 8px;
  --tref-radius-lg: 12px;
  --tref-radius-full: 9999px;
  --tref-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== GLOBAL RESET & BASE ===== */
body#phpbb {
  background: #ffffff !important;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif !important;
  color: var(--tref-text) !important;
  line-height: 1.6 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

/* ===== TREF.APP TOP NAVIGATION BAR ===== */
.tref-topbar {
  position: fixed;
  top: 0 !important;
  left: 0;
  right: 0;
  z-index: 1100 !important;
  background-color: var(--tref-bg-white);
  border-bottom: 1px solid var(--tref-border);
  box-shadow: var(--tref-shadow-sm);
  direction: ltr !important;
}

.tref-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: ltr !important;
  flex-direction: row !important;
  overflow: hidden;
}

.tref-topbar-logo {
  display: flex;
  align-items: center;
  padding: 8px 0;
  transition: opacity var(--tref-transition);
  overflow: hidden;
  flex-shrink: 0;
}

.tref-topbar-logo:hover {
  opacity: 0.8;
}

.tref-topbar-logo img {
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.tref-topbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr !important;
}

.tref-topbar-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--tref-text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--tref-radius);
  transition: all var(--tref-transition);
  direction: ltr !important;
}

.tref-topbar-link:hover {
  color: var(--tref-primary);
  background: var(--tref-primary-light);
  text-decoration: none !important;
}

.tref-topbar-link-bold {
  font-weight: 600;
  color: var(--tref-text-dark);
}

.tref-topbar-menu-btn {
  display: none;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: var(--tref-radius);
  cursor: pointer;
  color: var(--tref-text);
  transition: all var(--tref-transition);
}

.tref-topbar-menu-btn:hover {
  background: var(--tref-bg-hover);
}

.tref-topbar-mobile {
  display: none;
  padding: 16px 24px;
  background: var(--tref-bg-white);
  border-bottom: 1px solid var(--tref-border);
  box-shadow: var(--tref-shadow-md);
}

.tref-topbar-mobile.open {
  display: block;
}

.tref-topbar-mobile-link {
  display: block;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--tref-text-muted);
  text-decoration: none;
  border-radius: var(--tref-radius);
  transition: all var(--tref-transition);
}

.tref-topbar-mobile-link:hover {
  color: var(--tref-primary);
  background: var(--tref-primary-light);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .tref-topbar-inner {
    height: 56px;
    padding: 0 16px;
  }

  .tref-topbar-logo img {
    height: 36px;
    max-width: 120px;
  }

  .tref-topbar-nav {
    display: none;
  }

  .tref-topbar-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .tref-topbar-inner {
    height: 48px;
    padding: 0 12px;
  }

  .tref-topbar-logo img {
    height: 28px;
    max-width: 90px;
  }
}

@media (max-width: 360px) {
  .tref-topbar-logo img {
    height: 24px;
    max-width: 70px;
  }
}

/* ===== CONTENT SPACING ===== */
.wrap {
  margin-top: 64px !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 24px !important;
}

@media (max-width: 768px) {
  .wrap {
    margin-top: 56px !important;
    padding: 0 16px !important;
  }
}

@media (max-width: 480px) {
  .wrap {
    margin-top: 48px !important;
    padding: 0 12px !important;
  }
}

/* ===== HIDE PHPBB BLUE HEADER ===== */
#site-description {
  display: none !important;
}

/* ===== SEARCH BOX ===== */
.headerbar {
  display: block !important;
  background: #ffffff !important;
  border: none !important;
  padding: 24px 0 !important;
  border-bottom: 1px solid var(--tref-border);
}

.headerbar .inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: center;
}

#search-box,
.search-box,
.search-header {
  display: block !important;
  width: 50% !important;
  max-width: 50% !important;
  margin: 0 auto;
  padding: 0;
  box-shadow: none !important;
}

#search-box form,
.search-box form,
#search form,
.search-header form {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--tref-bg-white) !important;
  border: 1px solid var(--tref-border) !important;
  border-radius: 10px !important;
  padding: 2px 12px !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  width: 100% !important;
  height: 36px !important;
}

#search-box form:focus-within,
.search-box form:focus-within,
#search form:focus-within,
.search-header form:focus-within {
  border-color: var(--tref-border) !important;
  box-shadow: none !important;
  outline: none !important;
}

#search-box fieldset,
.search-box fieldset,
#search fieldset {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  outline: none !important;
}

#search-box input[type='search'],
.search-box input[type='search'],
#keywords,
.inputbox.search {
  flex: 1 !important;
  border: none !important;
  background: transparent !important;
  padding: 14px 20px !important;
  font-size: 16px !important;
  color: var(--tref-text-dark) !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100% !important;
  font-weight: 400 !important;
  text-align: center !important;
}

#search-box input[type='search']:focus,
.search-box input[type='search']:focus,
#keywords:focus,
.inputbox.search:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

#search-box input[type='search']::placeholder,
.search-box input[type='search']::placeholder,
#keywords::placeholder,
.inputbox.search::placeholder {
  color: #94a3b8 !important;
  font-weight: 400;
  text-align: center !important;
}

/* Hide all search buttons */
#search-box .button,
.search-box .button,
#search-box button,
.search-box button,
#search .button,
.button-search,
.button-search-end {
  display: none !important;
}

.button-search-end {
  display: none !important;
}

/* ===== FORUM HEADER BAR ===== */
.forum-header-bar {
  position: fixed;
  top: 64px !important;
  left: 0;
  right: 0;
  z-index: 1099 !important;
  background: linear-gradient(90deg, #0099cc 0%, #0066ff 100%);
  padding: 10px 0;
  direction: ltr;
}

@media (max-width: 768px) {
  .forum-header-bar {
    top: 56px !important;
  }
}

.forum-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0 !important;
}

/* Forum Header Search */
.forum-header-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 0 14px;
  height: 42px;
}

.forum-header-search i {
  color: #9ca3af;
  font-size: 15px;
  margin-right: 12px;
}

.forum-header-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #374151;
  outline: none;
}

.forum-header-search input::placeholder {
  color: #9ca3af;
}

/* Forum Header Home Button */
.forum-header-home-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: white !important;
  background: none !important;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.forum-header-home-btn:hover {
  background: none !important;
  color: white !important;
  text-decoration: none;
}

.forum-header-home-btn i.icon.fa-home.fa-fw {
  color: white !important;
  opacity: 1;
}

.forum-header-home-text {
  display: none;
}

/* Forum Header Auth Buttons */
.forum-header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.forum-header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.forum-header-login {
  color: #fff;
  background: transparent;
}

.forum-header-login:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.forum-header-register {
  color: #0088dd;
  background: #fff;
  border: 2px solid #fff;
}

.forum-header-register:hover {
  background: #f0f9ff;
  color: #0077cc;
  text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .forum-header-inner {
    padding: 0 16px;
    flex-wrap: wrap;
  }

  .forum-header-home-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .forum-header-home-text {
    display: none;
  }

  .forum-header-search {
    order: 2;
    flex: 1 0 100%;
    max-width: 100%;
    margin-top: 10px;
  }

  .forum-header-auth {
    order: 1;
    margin-left: auto;
  }

  .forum-header-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* ===== PAGE HEADER & NAVIGATION ===== */
#page-header {
  background: var(--tref-bg-white) !important;
  border-bottom: 1px solid var(--tref-border);
  position: sticky !important;
  top: 128px !important;
  z-index: 1000 !important;
  box-shadow: var(--tref-shadow-sm) !important;
}

@media (max-width: 768px) {
  #page-header {
    top: 120px !important;
  }
}

.navbar {
  background: var(--tref-bg-white) !important;
  border: none !important;
  box-shadow: none !important;
  padding: 8px 0 !important;
}

.navbar .inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navigation links */
.linklist {
  padding: 8px 0 !important;
  font-size: 14px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 12px !important;
  align-items: center;
}

.linklist li {
  margin: 0 4px !important;
}

.linklist a {
  color: var(--tref-text-dark) !important;
  text-decoration: none !important;
  /* padding: 10px 18px !important; */
  margin: 0 2px !important;
  /* border-radius: var(--tref-radius) !important; */
  transition: all var(--tref-transition) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  display: inline-flex;
  align-items: center;
  /* gap: 8px; */
  /* background: var(--tref-bg-white) !important; */
  /* border: 1px solid var(--tref-border) !important; */
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important; */
}

.linklist a:hover {
  color: var(--tref-bg-white) !important;
  background: var(--tref-primary) !important;
  border-color: var(--tref-primary) !important;
  text-decoration: none !important;
}

/* Active/current link */
.linklist .active a,
.linklist a.active {
  color: var(--tref-bg-white) !important;
  background: var(--tref-primary) !important;
  border-color: var(--tref-primary) !important;
}

/* Dropdown menus */
.dropdown-container .dropdown {
  background: var(--tref-bg-white) !important;
  border: 1px solid var(--tref-border) !important;
  border-radius: var(--tref-radius-lg) !important;
  box-shadow: var(--tref-shadow-lg) !important;
  padding: 8px !important;
  min-width: 200px;
}

.dropdown-container .dropdown li {
  margin: 0 !important;
}

.dropdown-container .dropdown a {
  padding: 10px 14px !important;
  border-radius: var(--tref-radius) !important;
  display: block;
}

.dropdown-container .dropdown .separator {
  border-color: var(--tref-border) !important;
  margin: 8px 0 !important;
}

/* Breadcrumbs */
ul#nav-breadcrumbs {
  display: none;
}

.nav-breadcrumbs {
  background: transparent !important;
  padding: 16px 0 !important;
  margin: 0 !important;
}

.nav-breadcrumbs .linklist {
  background: var(--tref-bg) !important;
  border-radius: var(--tref-radius-lg);
  padding: 12px 20px !important;
}

.nav-breadcrumbs .crumb::after {
  color: var(--tref-text-light) !important;
}

.nav-breadcrumbs .crumb a,
.nav-breadcrumbs .linklist a,
.breadcrumbs a {
  color: #1f2937 !important;
  font-weight: 500 !important;
}

.nav-breadcrumbs .crumb a:hover,
.nav-breadcrumbs .linklist a:hover,
.breadcrumbs a:hover {
  color: #3b82f6 !important;
}

/* ===== PANELS & CONTENT AREAS ===== */
.panel {
  background: var(--tref-bg-white) !important;
  border: 1px solid var(--tref-border) !important;
  border-radius: var(--tref-radius-lg) !important;
  box-shadow: var(--tref-shadow-sm) !important;
  overflow: hidden;
  margin-bottom: 20px !important;
}

.panel .inner {
  padding: 24px !important;
}

/* Forum/Topic list containers */
.forabg,
.forumbg {
  background: var(--tref-bg-white) !important;
  border: 1px solid var(--tref-border) !important;
  border-radius: var(--tref-radius-lg) !important;
  box-shadow: var(--tref-shadow-sm) !important;
  overflow: hidden;
  margin-bottom: 20px !important;
}

.forabg .header,
.forumbg .header {
  background: linear-gradient(to bottom, #f8fafc, #f1f5f9) !important;
  color: var(--tref-text-dark) !important;
  border-bottom: 1px solid var(--tref-border) !important;
  padding: 16px 20px !important;
  font-weight: 600 !important;
}

.forabg .header a,
.forumbg .header a {
  color: var(--tref-text-dark) !important;
  font-weight: 600 !important;
}

.forabg .header a:hover,
.forumbg .header a:hover {
  color: var(--tref-primary) !important;
}

/* Topic list rows */
.topiclist {
  background: var(--tref-bg-white) !important;
}

.topiclist li {
  border-bottom: 1px solid var(--tref-border-light) !important;
  transition: background var(--tref-transition);
}

.topiclist li:last-child {
  border-bottom: none !important;
}

.topiclist li:hover {
  background: var(--tref-bg-hover) !important;
}

.topiclist .row {
  padding: 16px 20px !important;
}

/* Topic titles */
.topiclist a.topictitle {
  color: var(--tref-text-dark) !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  text-decoration: none !important;
  transition: color var(--tref-transition);
}

.topiclist a.topictitle:hover {
  color: var(--tref-primary) !important;
}

/* Forum icons */
.list-inner .icon {
  opacity: 0.7;
}

/* Last post info */
.lastpost {
  color: var(--tref-text-muted) !important;
  font-size: 13px !important;
}

/* ===== BUTTONS ===== */
.button,
button,
input[type='submit'],
input[type='button'] {
  background: var(--tref-bg) !important;
  border: 1px solid var(--tref-border) !important;
  color: var(--tref-text) !important;
  padding: 10px 18px !important;
  border-radius: var(--tref-radius) !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  cursor: pointer;
  transition: all var(--tref-transition) !important;
}

.button:hover,
button:hover,
input[type='submit']:hover,
input[type='button']:hover {
  background: var(--tref-bg-hover) !important;
  border-color: var(--tref-text-light) !important;
}

/* Primary buttons */
.button1,
input[type='submit'].button1 {
  background: var(--tref-primary) !important;
  border-color: var(--tref-primary) !important;
  color: white !important;
}

.button1:hover,
input[type='submit'].button1:hover {
  background: var(--tref-primary-hover) !important;
  border-color: var(--tref-primary-hover) !important;
}

/* ===== FORMS ===== */
input[type='text'],
input[type='password'],
input[type='email'],
input[type='search'] {
  background: none !important;
  border: none !important;
  border-radius: var(--tref-radius) !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  color: var(--tref-text) !important;
  transition: all var(--tref-transition) !important;
}
textarea,
select {
  background: var(--tref-bg-white) !important;
  border: 1px solid var(--tref-border) !important;
  border-radius: var(--tref-radius) !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  color: var(--tref-text) !important;
  transition: all var(--tref-transition) !important;
}

input[type='text']:focus,
input[type='password']:focus,
input[type='email']:focus,
input[type='search']:focus,
textarea:focus,
select:focus {
  border-color: var(--tref-primary) !important;
  box-shadow: 0 0 0 3px var(--tref-primary-light) !important;
  outline: none !important;
}

/* ===== POSTS ===== */
.post {
  background: var(--tref-bg-white) !important;
  border: 1px solid var(--tref-border) !important;
  border-radius: var(--tref-radius-lg) !important;
  margin-bottom: 16px !important;
  box-shadow: var(--tref-shadow-sm) !important;
}

.post .inner {
  padding: 20px !important;
}

.postprofile {
  background: var(--tref-bg) !important;
  border-radius: var(--tref-radius-lg) 0 0 var(--tref-radius-lg) !important;
  padding: 20px !important;
}

.postbody {
  padding: 20px !important;
}

.postbody h3 a {
  color: var(--tref-text-dark) !important;
  font-weight: 600 !important;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination a,
.pagination span {
  padding: 8px 14px !important;
  border-radius: var(--tref-radius) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
}

.pagination a {
  color: var(--tref-text-muted) !important;
  background: var(--tref-bg) !important;
  border: 1px solid var(--tref-border) !important;
  transition: all var(--tref-transition);
}

.pagination a:hover {
  color: var(--tref-primary) !important;
  border-color: var(--tref-primary) !important;
  background: var(--tref-primary-light) !important;
}

.pagination .page-current {
  background: var(--tref-primary) !important;
  color: white !important;
  border: 1px solid var(--tref-primary) !important;
}

/* ===== FOOTER ===== */
#page-footer {
  background: var(--tref-bg-white) !important;
  border-top: 1px solid var(--tref-border) !important;
  margin-top: auto !important;
  padding: 24px 0 !important;
}

#page-footer .navbar {
  background: transparent !important;
}

.copyright {
  color: var(--tref-text-light) !important;
  font-size: 13px !important;
  text-align: center;
  padding: 16px 0 !important;
}

#page-footer a {
  text-decoration: none !important;
  color: var(--tref-primary) !important;
}

#page-footer a:hover {
  text-decoration: underline !important;
  color: #0066ff !important;
  background: none !important;
}

/* ===== ALERTS & NOTIFICATIONS ===== */
.rules,
.information {
  background: var(--tref-primary-light) !important;
  border: 1px solid var(--tref-primary) !important;
  border-radius: var(--tref-radius) !important;
  padding: 16px 20px !important;
  margin-bottom: 20px !important;
}

.error {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #dc2626 !important;
  border-radius: var(--tref-radius) !important;
  padding: 16px 20px !important;
}

.success,
.successbox {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #16a34a !important;
  border-radius: var(--tref-radius) !important;
  padding: 16px 20px !important;
}

/* ===== REGISTRATION CONFIRMATION MESSAGE ===== */
#message {
  max-width: 500px;
  margin: 120px auto 40px auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: none;
  overflow: hidden;
  animation: messageSlideIn 0.5s ease-out;
  position: relative;
}

/* Close button for message panel */
#message .close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 8px 16px;
  background: rgba(107, 114, 128, 0.1);
  border: none;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  z-index: 10;
  white-space: nowrap;
}

#message .close-button:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  transform: scale(1.1);
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#message .inner {
  padding: 50px 40px;
  text-align: center;
}

#message .message-title {
  display: none;
}

#message p {
  font-size: 16px;
  line-height: 1.8;
  color: #4b5563;
}

/* Registration success message styling */
.reg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  border-radius: 50%;
  font-size: 42px;
  color: white;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  }
  50% {
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.5);
  }
}

.reg-title {
  font-size: 26px;
  color: #111827;
}

.reg-subtitle {
  font-size: 17px;
  color: #6b7280;
}

.reg-info {
  display: inline-block;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 16px 24px;
  font-size: 15px;
  color: #0369a1;
  text-align: center;
}

.reg-info strong {
  color: #0c4a6e;
}

.reg-note {
  font-size: 14px;
  color: #9ca3af;
}

#message::before {
  display: none;
}

/* Custom registration success styling */
.registration-success {
  text-align: center;
}

.registration-success .success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px auto;
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  animation: successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  }
  50% {
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.5);
  }
}

.registration-success h3 {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px 0;
}

.registration-success .lead {
  font-size: 17px;
  color: #6b7280;
  margin-bottom: 28px;
}

.registration-success .info-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
  text-align: left;
}

.registration-success .info-box .info-icon {
  font-size: 24px;
  margin-bottom: 8px;
  display: block;
}

.registration-success .info-box p {
  margin: 0;
  font-size: 15px;
  color: #0369a1;
}

.registration-success .info-box p strong {
  display: block;
  font-size: 16px;
  color: #0c4a6e;
  margin-bottom: 6px;
}

.registration-success .note {
  font-size: 14px;
  color: #9ca3af;
  margin-top: 20px;
  font-style: italic;
}

/* Hide footer, navbar, header and ads when showing message panel (registration/login messages) */
body:has(#message) .tref-topbar,
body:has(#message) .forum-header-bar,
body:has(#message) .headerbar,
body:has(#message) header,
body:has(#message) h1,
body:has(#message) h2,
body:has(#message) .navbar,
body:has(#message) #page-header,
body:has(#message) #page-footer,
body:has(#message) .copyright,
body:has(#message) footer,
body:has(#message) .footer-icons,
body:has(#message) #nav-breadcrumbs,
body:has(#message) .breadcrumbs {
  display: none !important;
}

/* Hide all advertisement sections when showing message panel */
body:has(#message) div[style*='ADVERTISEMENTS SECTION'],
body:has(#message)
  div[style*='grid-template-columns']:has([id*='advertisement']),
body:has(#message) .advertisement,
body:has(#message) [class*='ad-'],
body:has(#message) [id*='advertisement'],
body:has(#message) [data-ad],
body:has(#message) .ad-container,
body:has(#message) .ads,
body:has(#message) #ads,
body:has(#message)
  div[style*='width:100%; margin:8px auto']:has(
    div[style*='grid-template-columns']
  ),
body:has(#message)
  div[style*='width:70%; margin:8px auto']:has(
    div[style*='grid-template-columns']
  ) {
  display: none !important;
}

/* Center the message on screen */
body:has(#message) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

body:has(#message) #wrap {
  flex: none;
  width: 100%;
}

/* Also style the "Return to index" link as a button */
#message .inner > a,
#message .inner > p > a {
  display: inline-block;
  margin-top: 24px;
  padding: 12px 28px;
  background: linear-gradient(135deg, #016dff 0%, #0056cc 100%);
  color: white !important;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(1, 109, 255, 0.25);
}

#message .inner > a:hover,
#message .inner > p > a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(1, 109, 255, 0.35);
}

/* ===== ICONS ===== */
.icon {
  opacity: 0.8;
}

/* ===== STATISTICS ===== */
.stat-block {
  background: var(--tref-bg-white) !important;
  border: 1px solid var(--tref-border) !important;
  border-radius: var(--tref-radius-lg) !important;
  padding: 20px !important;
  margin-bottom: 20px !important;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--tref-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--tref-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--tref-text-light);
}

/* ===== SELECTION ===== */
::selection {
  background: var(--tref-primary);
  color: white;
}

/* ===== LINKS ===== */
a {
  color: var(--tref-primary);
  text-decoration: none;
  transition: color var(--tref-transition);
}

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

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .panel .inner {
    padding: 16px !important;
  }

  .topiclist .row {
    padding: 12px 16px !important;
  }

  .forabg .header,
  .forumbg .header {
    padding: 12px 16px !important;
  }

  .postprofile {
    padding: 12px !important;
  }

  .postbody {
    padding: 12px !important;
  }
}

/* ===== TREF LOGIN PANEL ===== */
.tref-login-panel {
  max-width: 1200px;
  margin: 32px auto 0 auto;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.tref-login-panel .panel {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.08);
  border: none;
}

.tref-login-panel .panel .inner {
  padding: 32px;
}

.tref-login-panel .login-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 24px;
  text-align: center;
}

.tref-login-panel h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
  text-align: center;
}

.tref-login-panel .content p {
  text-align: center;
  color: #64748b;
  margin-bottom: 12px;
}

.tref-login-panel .button1,
.tref-login-panel .button2 {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tref-login-panel .button1 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border: none;
}

.tref-login-panel .button1:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
}

.tref-login-panel .button2 {
  background: #fff;
  color: #3b82f6;
  border: 2px solid #3b82f6;
}

.tref-login-panel .button2:hover {
  background: #3b82f6;
  color: #fff;
}

.tref-login-panel .inputbox {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.tref-login-panel .inputbox:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.tref-login-panel dl {
  margin-bottom: 16px;
}

.tref-login-panel dt label {
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
  display: block;
}

.tref-login-panel dd {
  margin-bottom: 8px;
}

.tref-login-panel dd a {
  color: #3b82f6;
  font-size: 0.9rem;
}

.tref-login-panel hr.dashed {
  border: none;
  border-top: 1px dashed #e2e8f0;
  margin: 20px 0;
}

@media (max-width: 768px) {
  .tref-login-panel {
    flex-direction: column;
    padding: 0 16px;
  }

  .tref-login-panel .panel {
    min-width: 100%;
  }
}

/* ===== UCP LOGIN/REGISTER PAGE STYLING ===== */
#login .panel:first-child,
#register .panel:first-child {
  margin-top: 40px;
}

#login .panel,
#register .panel {
  max-width: 800px;
  margin: 20px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
}

/* Agreement form styling */
form#agreement {
  max-width: 800px;
  margin: 20px auto;
}

#login .panel .inner,
#register .panel .inner {
  padding: 32px;
}

#login .login-title,
#register h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  margin-bottom: 24px;
}

#login .inputbox,
#register .inputbox,
#register input.inputbox.autowidth,
#register input[type='text'],
#register input[type='password'],
#register input[type='email'],
#register select,
#register textarea {
  width: 100% !important;
  padding: 12px 16px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  background: #fff !important;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
}

#login select,
#register select {
  width: 100% !important;
  padding: 12px 16px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  background: #fff !important;
  font-family:
    'Open Sans', 'Noto Sans Hebrew', 'Arial Hebrew', Arial, sans-serif !important;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  box-sizing: border-box;
  cursor: pointer;
}

#login select:hover,
#register select:hover {
  border-color: #3b82f6 !important;
}

#login select:focus,
#register select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none !important;
}

#login .inputbox:hover,
#register .inputbox:hover,
#register input[type='text']:hover,
#register input[type='password']:hover,
#register input[type='email']:hover {
  border-color: #3b82f6 !important;
}

#login .inputbox:focus,
#register .inputbox:focus,
#register input[type='text']:focus,
#register input[type='password']:focus,
#register input[type='email']:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none !important;
}

#login dl,
#register dl {
  margin-bottom: 16px;
}

#login dt,
#register dt {
  margin-bottom: 6px;
}

#login dt label,
#register dt label {
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

#login dd,
#register dd {
  margin-bottom: 8px;
}

#login dd a,
#register dd a {
  color: #3b82f6;
  font-size: 0.9rem;
  text-decoration: none;
}

#login dd a:hover,
#register dd a:hover {
  text-decoration: none;
}

#login .button1,
#register .button1 {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

#login .button1:hover,
#register .button1:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
}

#login .button2,
#register .button2 {
  display: inline-block;
  padding: 10px 24px;
  background: #fff;
  color: #3b82f6 !important;
  border: 2px solid #3b82f6;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s;
  width: 254px !important;
}

#login .button2:hover,
#register .button2:hover {
  background: #3b82f6;
  color: #fff !important;
}

#login fieldset,
#register fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

#login .panel h3,
#register .panel h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #111827;
  text-align: center;
  margin-bottom: 12px;
}

#login .panel .content p,
#register .panel .content p {
  text-align: center;
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

#login hr.dashed,
#register hr.dashed {
  border: none;
  border-top: 1px dashed #e5e7eb;
  margin: 20px 0;
}

/* ===== CAPTCHA PANEL STYLING ===== */
.captcha-panel {
  max-width: 800px;
  margin: 20px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.captcha-panel .inner {
  padding: 32px;
  text-align: center;
}

.captcha-panel h3,
.captcha-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.captcha-panel > .inner > p {
  text-align: center;
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 24px;
  direction: ltr;
}

.captcha-panel .captcha-image-wrapper {
  text-align: center;
  margin: 20px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

dd.captcha.captcha-image-wrapper {
  margin-right: 10rem !important;
}

.captcha-panel .captcha-img {
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  /* max-width: 200px; */
  width: 338px !important;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#login dt,
#register dt {
  top: 16px;
  position: relative;
}

.captcha-refresh-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  /* background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); */
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  /* box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); */
}

.captcha-refresh-btn:hover {
  /* background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); */
  transform: rotate(180deg);
  /* box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); */
}

.captcha-refresh-btn i {
  font-size: 1.1rem;
}

.captcha-panel .captcha-image {
  text-align: center;
  margin: 20px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.captcha-panel .captcha-image img {
  border-radius: 8px;
  border: 2px solid #e5e7eb;
  max-width: 100%;
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.captcha-panel dl {
  margin: 0 auto;
  max-width: 600px;
  text-align: center;
  /* display: flex; */
  flex-direction: column;
  align-items: center;
}

.captcha-panel dt {
  text-align: center;
  margin-bottom: 16px;
  width: 100%;
}

.captcha-panel dt label {
  font-weight: 600;
  color: #3b82f6;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 8px;
}

.captcha-panel dd {
  margin: 0 0 16px 0;
  text-align: center;
  display: block;
}

.captcha-panel .inputbox {
  width: 100% !important;
  max-width: 400px !important;
  padding: 14px 20px !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 8px !important;
  font-size: 1.5rem !important;
  font-family: 'Courier New', monospace;
  letter-spacing: 8px;
  text-align: center;
  background: #f9fafb !important;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  box-sizing: border-box;
  margin: 0 auto;
  display: block;
}

.captcha-panel .inputbox:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  background: #fff !important;
  outline: none !important;
}

.captcha-panel .button2,
#refresh_vc {
  /* margin: 16px auto 0 auto;
  display: inline-block;
  padding: 24px !important; */
  /* background: green !important; */
  color: green !important;
  border: none !important;
  background: none !important;
}

.captcha-panel .button2:hover,
#refresh_vc:hover {
  /* background: linear-gradient(135deg, #059669 0%, #047857 100%) !important; */
  transform: translateY(-1px);
  /* box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); */
}

.captcha-panel dd.captcha-explain {
  font-size: 0.9rem;
  color: #6b7280;
  font-style: normal;
  margin-top: 20px;
  padding: 12px 24px;
  background: #f3f4f6;
  border-radius: 8px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  display: inline-block;
}

dd.captcha-explain {
  width: 403px;
  margin-right: 11rem !important;
}

.captcha-panel fieldset {
  border: none;
  padding: 0;
  margin: 0;
  text-align: center !important;
}

/* General form submit buttons - always centered */
fieldset.submit-buttons {
  text-align: center !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

fieldset.submit-buttons input[type='submit'],
fieldset.submit-buttons input[type='button'],
fieldset.submit-buttons .button1,
fieldset.submit-buttons .button2 {
  margin: 5px !important;
  text-align: center !important;
}

/* All buttons center text */
input[type='submit'],
input[type='button'],
.button1,
.button2 {
  text-align: center !important;
}

/* ===== TREF COMMUNITY WELCOME CARD ===== */
.tref-welcome-card {
  max-width: 1200px;
  margin: 32px auto 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.08);
  padding: 48px 32px 40px 32px;
  text-align: center;
  position: relative;
}
.tref-welcome-logo {
  width: 120px;
  height: 120px;
  max-width: 100%;
  border-radius: 50%;
  margin-bottom: 24px;
  background: #f5f7fa;
  object-fit: contain;
}
.tref-welcome-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 18px;
  text-align: center;
}
.tref-welcome-subtitle {
  font-size: 20px;
  color: #6b7280;
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.tref-welcome-desc {
  font-size: 1.25rem;
  color: #64748b;
  margin-bottom: 32px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.tref-welcome-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  font-size: 1.1rem;
  color: #334155;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.tref-welcome-stats span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tref-welcome-stats i {
  color: #3b82f6;
  font-size: 1.2em;
}
.tref-welcome-links {
  margin-top: 12px;
}
.tref-welcome-link {
  color: #2563eb;
  font-weight: 500;
  margin: 0 12px;
  text-decoration: none;
  font-size: 1.05rem;
  transition: color 0.2s;
}
.tref-welcome-link:hover {
  color: #1d4ed8;
  text-decoration: none;
}
@media (max-width: 900px) {
  .tref-welcome-card {
    padding: 32px 8px 28px 8px;
  }
  .tref-welcome-title {
    font-size: 2rem;
  }
  .tref-welcome-desc {
    font-size: 1rem;
  }
  .tref-welcome-stats {
    gap: 18px;
    font-size: 1rem;
  }
}

/* ===== TREF CATEGORY CARDS ===== */
.tref-category-cards {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 18px;
  max-width: 1200px;
  margin: 24px auto 0 auto;
  padding: 0 8px;
}
.tref-category-card {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
  padding: 12px 32px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  background: #888;
  min-width: 160px;
  justify-content: center;
}
.tref-category-card:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 24px 0 rgba(0, 0, 0, 0.12);
  text-decoration: none !important;
}
.tref-category-card h3,
.tref-category-card h3 a,
.tref-category-card a {
  text-decoration: none !important;
}
.tref-category-card h3:hover,
.tref-category-card h3 a:hover,
.tref-category-card a:hover {
  text-decoration: none !important;
}
.tref-cat-tech {
  background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%);
}
.tref-cat-fashion {
  background: linear-gradient(90deg, #fb7185 0%, #f472b6 100%);
}
.tref-cat-home {
  background: linear-gradient(90deg, #34d399 0%, #06b6d4 100%);
}
.tref-cat-health {
  background: linear-gradient(90deg, #38bdf8 0%, #2563eb 100%);
}
.tref-cat-auto {
  background: linear-gradient(90deg, #fbbf24 0%, #f97316 100%);
}
.tref-category-card i {
  font-size: 1.3em;
}
@media (max-width: 900px) {
  .tref-category-cards {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
  }
  .tref-category-card {
    padding: 10px 18px;
    font-size: 1rem;
    min-width: 120px;
  }
}

/* ===== TREF POPULAR LISTINGS LAYOUT ===== */
.tref-listings-layout {
  display: flex;
  gap: 32px;
  max-width: 1300px;
  margin: 36px auto 0 auto;
  align-items: flex-start;
}
.tref-sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.tref-sidebar-block {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
  padding: 18px 18px 12px 18px;
}
.tref-sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 16px;
}
.tref-sidebar-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 1rem;
  padding: 8px 0;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
}
.tref-sidebar-cat:hover {
  background: #f1f5f9;
}
.tref-sidebar-cat .icon {
  font-size: 1.2em;
  min-width: 22px;
}
.tref-sidebar-cat.tref-cat-viewall {
  color: #2563eb;
  font-weight: 500;
  margin-top: 10px;
}
.tref-sidebar-post {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 0.98rem;
  padding: 7px 0;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
}
.tref-sidebar-post:hover {
  background: #f1f5f9;
}
.tref-listings-main {
  flex: 1;
  min-width: 0;
}
.tref-listings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.tref-listings-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #22223b;
}
.tref-listings-seeall {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tref-listing-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
  padding: 24px 24px 24px 180px;
  margin-bottom: 28px;
  position: relative;
  min-height: 120px;
}
.tref-listing-img {
  position: absolute;
  left: 24px;
  top: 24px;
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
}
.tref-listing-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.tref-listing-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  padding: 4px 14px;
  border-radius: 6px;
  background: #888;
}
.tref-listing-tag.tref-cat-tech {
  background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%);
}
.tref-listing-tag.tref-cat-fashion {
  background: linear-gradient(90deg, #fb7185 0%, #f472b6 100%);
}
.tref-listing-tag.tref-cat-home {
  background: linear-gradient(90deg, #34d399 0%, #06b6d4 100%);
}
.tref-listing-tag.tref-cat-health {
  background: linear-gradient(90deg, #38bdf8 0%, #2563eb 100%);
}
.tref-listing-tag.tref-cat-auto {
  background: linear-gradient(90deg, #fbbf24 0%, #f97316 100%);
}
.tref-listing-title {
  font-size: 1.18rem;
  font-weight: 600;
  color: #22223b;
  margin-bottom: 4px;
}
.tref-listing-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 6px;
}
.tref-listing-desc {
  font-size: 1rem;
  color: #64748b;
  margin-bottom: 10px;
}
.tref-listing-meta {
  display: flex;
  gap: 18px;
  font-size: 0.97rem;
  color: #64748b;
  align-items: center;
}
.tref-listing-meta .icon {
  color: #a5b4fc;
  font-size: 1.1em;
}
@media (max-width: 1100px) {
  .tref-listings-layout {
    flex-direction: column;
    gap: 0;
  }
  .tref-sidebar {
    width: 100%;
    flex-direction: row;
    gap: 18px;
    margin-bottom: 24px;
  }
  .tref-sidebar-block {
    flex: 1;
    min-width: 0;
  }
}
@media (max-width: 700px) {
  .tref-listings-layout {
    flex-direction: column;
    gap: 0;
  }
  .tref-sidebar {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }
  .tref-sidebar-block {
    min-width: 0;
    padding: 12px 8px 8px 8px;
  }
  .tref-listings-main {
    padding: 0 2px;
  }
  .tref-listing-card {
    padding: 16px 8px 16px 120px;
  }
  .tref-listing-img {
    left: 8px;
    top: 16px;
    width: 90px;
    height: 60px;
  }
}

/* ===== TREF CHOOSE PATH SECTION (YIDDISH) ===== */
.tref-path-section {
  max-width: 1200px;
  margin: 36px auto 0 auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 24px 0 rgba(0, 0, 0, 0.07);
  padding: 36px 24px 40px 24px;
  text-align: center;
  position: relative;
}
.tref-path-badge {
  display: inline-block;
  background: #e0edff;
  color: #2563eb;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 22px;
  font-size: 1.05rem;
  margin-bottom: 18px;
}
.tref-path-title {
  font-size: 2.6rem;
  font-weight: 700;
  color: #22223b;
  margin-bottom: 12px;
  letter-spacing: -1px;
}
.tref-path-desc {
  font-size: 1.18rem;
  color: #64748b;
  margin-bottom: 36px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.tref-path-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 18px;
}
.tref-path-grid > .tref-path-card:only-child {
  grid-column: 2 / 3;
}
.tref-path-grid > .tref-path-card:last-child:nth-child(odd):not(:only-child) {
  grid-column: 2 / 3;
}
.tref-path-card {
  background: #fff;
  border-radius: 18px;
  border: 1.5px solid #f0f4fa;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
  padding: 32px 18px 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 170px;
  transition:
    box-shadow 0.18s,
    transform 0.18s,
    border-color 0.18s;
  position: relative;
  border-bottom: 2px solid #e6f0ff;
  text-decoration: none !important;
  color: inherit !important;
}
.tref-path-card:hover {
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.13);
  transform: translateY(-4px) scale(1.03);
  border-color: #dbeafe;
}
.tref-path-card .tref-path-card-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 22px;
}
.tref-path-card .tref-path-card-arrow i {
  color: #2563eb;
  font-size: 1.6rem;
  transition: color 0.18s;
}
.tref-path-card:hover .tref-path-card-arrow i {
  color: #1746a2;
}
.tref-path-card-large {
  grid-column: span 2;
}
.tref-path-icon {
  background: transparent;
  color: #fff;
  border-radius: 16px;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.tref-path-icon img,
img.tref-path-icon-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 14px;
  display: block;
}
.tref-path-card-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #22223b;
  margin-bottom: 8px;
}
.tref-path-card-desc {
  font-size: 1.05rem;
  color: #64748b;
}
@media (max-width: 900px) {
  .tref-path-section {
    padding: 24px 4px 24px 4px;
  }
  .tref-path-title {
    font-size: 2rem;
  }
  .tref-path-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .tref-path-card-large {
    grid-column: span 1;
  }
}

/* Make all tref-path-card items equal width in tref-path-grid */
.tref-path-grid > .tref-path-card,
.tref-path-grid > .tref-path-card-large {
  grid-column: span 1 !important;
}
@media (max-width: 900px) {
  .tref-path-grid > .tref-path-card,
  .tref-path-grid > .tref-path-card-large {
    grid-column: span 1;
  }
}

/* ===== TREF FOOTER DUAL-BANNER SECTION ===== */
.tref-footer-banner-row {
  display: flex;
  gap: 18px;
  max-width: 1200px;
  margin: 36px auto 0 auto;
  padding: 0 8px 0 8px;
}
.tref-footer-banner {
  flex: 1 1 0;
  border-radius: 10px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tref-footer-banner-left {
  background: #232b3a;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tref-footer-banner-left-text {
  color: #ffb347;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -1px;
  font-family: inherit;
  text-align: center;
  width: 100%;
}
.tref-footer-banner-right {
  background: linear-gradient(90deg, #6a82fb 0%, #fc5c7d 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tref-footer-banner-right-content {
  text-align: right;
  width: 100%;
  padding: 12px 18px 12px 18px;
}
.tref-footer-banner-right-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: #fff;
}
.tref-footer-banner-right-desc {
  font-size: 1.05rem;
  color: #e0e7ef;
  margin-bottom: 8px;
}
.tref-footer-banner-right-icons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.tref-footer-banner-icon {
  background: rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
@media (max-width: 800px) {
  .tref-footer-banner-row {
    flex-direction: column;
    gap: 12px;
    padding: 0 2px 0 2px;
  }
  .tref-footer-banner-left-text {
    font-size: 1.3rem;
  }
  .tref-footer-banner-right-title {
    font-size: 1.1rem;
  }
  .tref-footer-banner-right-desc {
    font-size: 0.95rem;
  }
}

/* Main content wrapper - ensure visibility */
#wrap,
.wrap {
  display: block !important;
  margin-top: 130px !important;
}

.reddit-feed {
  display: none !important;
}

.welcome-section {
  display: none !important;
}

.tref-path-section {
  background: none !important;
  box-shadow: none !important;
}
/* Hide breadcrumbs on UCP pages (registration, login, etc.) */
.section-ucp #nav-breadcrumbs {
  display: none !important;
}

form#agreement {
  margin-top: 40px;
}

/* RTL Mobile Support */
@media (max-width: 768px) {
  /* Default LTR for mobile */
  html,
  body {
    direction: ltr !important;
  }

  /* RTL only for Yiddish language */
  html[lang='yi'],
  html[lang='yi-YI'],
  body[lang='yi'],
  body[lang='yi-YI'] {
    direction: rtl !important;
  }

  html[lang='yi'] .content,
  html[lang='yi-YI'] .content,
  body[lang='yi'] .content,
  body[lang='yi-YI'] .content {
    direction: rtl !important;
    text-align: right !important;
  }
}

/* Mobile Responsive Styles for Forms */
@media (max-width: 768px) {
  /* General form adjustments */
  .panel {
    margin: 10px 5px !important;
    padding: 10px !important;
  }

  .panel .inner {
    padding: 15px 10px !important;
  }

  /* Registration and Login forms */
  #login dt,
  #register dt {
    top: 0;
    position: relative;
    font-size: 0.9rem;
  }

  /* All form dl/dt/dd elements */
  .content dl dt,
  fieldset dl dt {
    width: 100% !important;
    float: none !important;
    text-align: left !important;
    margin-bottom: 5px !important;
  }

  .content dl dd,
  fieldset dl dd {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* All input fields and textareas */
  fieldset.fields1 dl dd input,
  fieldset.fields2 dl dd input,
  fieldset.fields1 dl dd select,
  fieldset.fields2 dl dd select,
  fieldset.fields1 dl dd textarea,
  fieldset.fields2 dl dd textarea,
  .inputbox {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* CAPTCHA panel mobile */
  .captcha-panel {
    padding: 15px 10px !important;
  }

  .captcha-panel h2 {
    font-size: 1.1rem !important;
    margin-bottom: 12px !important;
  }

  .captcha-panel > .inner > p {
    font-size: 0.85rem !important;
    margin-bottom: 15px !important;
  }

  /* CAPTCHA image wrapper */
  dd.captcha.captcha-image-wrapper {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  dd.captcha-explain {
    width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .captcha-panel .captcha-image-wrapper {
    flex-direction: column;
    gap: 15px;
    margin: 15px auto;
  }

  .captcha-panel .captcha-img {
    width: 100% !important;
    max-width: 280px !important;
    height: auto !important;
  }

  .captcha-refresh-btn {
    width: 45px !important;
    height: 45px !important;
  }

  /* CAPTCHA input field */
  .captcha-panel .inputbox {
    width: 100% !important;
    max-width: 280px !important;
    padding: 12px 15px !important;
    font-size: 1.2rem !important;
    letter-spacing: 6px !important;
  }

  /* CAPTCHA buttons */
  .captcha-panel .button2,
  #refresh_vc {
    width: 100% !important;
    max-width: 280px !important;
    padding: 12px 20px !important;
    font-size: 0.9rem !important;
    margin: 10px auto !important;
    display: block !important;
  }

  .captcha-panel dd.captcha-explain {
    font-size: 0.8rem !important;
    padding: 10px 15px !important;
    max-width: 90% !important;
  }

  /* Agreement form */
  form#agreement {
    margin-top: 20px !important;
  }

  form#agreement .panel {
    margin: 10px 5px !important;
  }

  form#agreement .content {
    padding: 15px 10px !important;
  }

  form#agreement .agreement {
    font-size: 0.85rem !important;
    padding: 10px !important;
  }

  /* Submit buttons */
  fieldset.submit-buttons {
    padding: 10px !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  fieldset.submit-buttons input[type='submit'],
  input[type='submit'],
  input[type='button'],
  .button1,
  .button2 {
    width: 100% !important;
    max-width: 400px !important;
    margin: 5px auto !important;
    padding: 12px 20px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box;
    display: block !important;
  }

  /* UCP registration form specific */
  #ucp_register fieldset {
    padding: 10px !important;
  }

  #ucp_register .panel {
    margin: 10px 5px !important;
  }

  /* Header and navigation mobile */
  .wrap {
    padding: 0 10px !important;
  }

  /* Content area */
  .content {
    padding: 15px 10px !important;
  }

  /* Tables responsive */
  table {
    display: block !important;
    overflow-x: auto !important;
    width: 100% !important;
  }

  /* Forum list mobile */
  .forumbg {
    margin: 10px 5px !important;
  }

  .forumbg .inner {
    padding: 10px !important;
  }

  /* Topic list mobile */
  .topiclist dt,
  .topiclist dd {
    float: none !important;
    width: 100% !important;
  }

  /* Post mobile */
  .post {
    margin: 10px 5px !important;
  }

  .postbody {
    width: 100% !important;
  }

  /* Profile fields mobile */
  .column1,
  .column2 {
    width: 100% !important;
    float: none !important;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .panel {
    margin: 5px 0 !important;
  }

  .panel .inner {
    padding: 10px 5px !important;
  }

  .captcha-panel h2 {
    font-size: 1rem !important;
  }

  .captcha-panel .captcha-img {
    max-width: 240px !important;
  }

  .captcha-panel .inputbox {
    max-width: 240px !important;
    font-size: 1rem !important;
    letter-spacing: 4px !important;
  }

  .captcha-panel .button2,
  #refresh_vc {
    max-width: 240px !important;
    padding: 10px 15px !important;
    font-size: 0.85rem !important;
  }

  form#agreement .agreement {
    font-size: 0.8rem !important;
  }

  fieldset.submit-buttons input[type='submit'],
  input[type='submit'],
  input[type='button'],
  .button1,
  .button2 {
    padding: 10px 15px !important;
    font-size: 0.85rem !important;
  }

  /* Smaller font sizes */
  h2 {
    font-size: 1.2rem !important;
  }

  h3 {
    font-size: 1.1rem !important;
  }

  .content {
    padding: 10px 5px !important;
  }
}

/* Posting form styling */
.postingbox {
  padding: 5px !important;
  margin: 5px 0 !important;
}

.post-form fieldset {
  padding: 8px !important;
  margin: 5px 0 !important;
}

.sceditor-container {
  margin: 5px 0 !important;
  height: 300px !important;
}

.sceditor-container textarea {
  height: 280px !important;
}

input#subject {
  padding: 5px !important;
  margin: 5px 0 !important;
  height: 28px !important;
  font-size: 14px !important;
  border: 1px solid black !important;
}

.sceditor-toolbar {
  padding: 5px !important;
  min-height: auto !important;
}

.sceditor-toolbar button {
  padding: 3px 5px !important;
  margin: 2px 1px !important;
  font-size: 12px !important;
}

.posting-form .form-group {
  margin-bottom: 8px !important;
  padding: 5px !important;
}

.post-buttons {
  margin-top: 8px !important;
  padding: 5px !important;
}

.post-buttons button {
  padding: 6px 15px !important;
  margin: 3px 5px 3px 0 !important;
}

/* Post form inputs styling */
form#postform input {
  border: 1px solid gray !important;
}

/* ============================================
   FIX POST HEADER - Icons and Title Overlap
   ============================================ */
.post .postbody h3 {
  display: block !important;
  clear: both !important;
  margin-bottom: 10px !important;
  padding-top: 5px !important;
}

.post .postbody .author {
  display: block !important;
  clear: both !important;
  margin-bottom: 15px !important;
}

/* Post action buttons - position properly */
.post .postbody ul.profile-icons,
.post .postbody .post-buttons {
  position: relative !important;
  float: none !important;
  display: inline-flex !important;
  gap: 5px !important;
  margin-bottom: 10px !important;
}

.post .postbody ul.profile-icons li {
  display: inline-block !important;
  float: none !important;
}

/* Topic title in post header */
.postbody h3 {
  display: block !important;
  width: 100% !important;
  clear: both !important;
}

/* Ensure content doesn't overlap */
.post .content {
  clear: both !important;
  display: block !important;
  margin-top: 10px !important;
}

/* Hide misplaced floating labels */
#postingbox::after,
#postingbox::before,
.fields1::after,
.fields1::before {
  content: none !important;
  display: none !important;
}

/* Fix posting form layout */
#postingbox .inner {
  position: relative !important;
}

#postingbox dl {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  margin-bottom: 10px !important;
}

#postingbox dt {
  flex: 0 0 auto !important;
  margin-left: 0 !important;
  float: none !important;
}

#postingbox dd {
  flex: 1 !important;
  margin-right: auto !important;
  float: none !important;
}

/* ============================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ============================================ */

/* ----- Mobile Menu Improvements ----- */
@media (max-width: 992px) {
  .tref-topbar-nav {
    display: none;
  }

  .tref-topbar-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}

/* ----- Page Body Mobile Width Fix ----- */
@media (max-width: 1024px) {
  .page-body {
    width: 90% !important;
  }
}

@media (max-width: 768px) {
  .page-body {
    width: 100% !important;
    margin-top: 120px !important;
    padding: 0 10px !important;
    font-size: 14px !important;
  }

  #wrap,
  .wrap {
    margin-top: 110px !important;
    padding: 0 8px !important;
  }
}

@media (max-width: 480px) {
  .page-body {
    margin-top: 100px !important;
    padding: 0 5px !important;
    font-size: 13px !important;
  }

  #wrap,
  .wrap {
    margin-top: 100px !important;
    padding: 0 5px !important;
  }
}

/* ----- Forum Header Bar Mobile ----- */
@media (max-width: 768px) {
  .forum-header-bar {
    padding: 8px 0 !important;
  }

  .forum-header-inner {
    flex-direction: column !important;
    gap: 10px !important;
    padding: 0 10px !important;
  }

  .forum-header-search {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .forum-header-auth {
    order: 1 !important;
    width: 100% !important;
    justify-content: center !important;
    gap: 8px !important;
  }

  .forum-header-btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
}

@media (max-width: 480px) {
  .forum-header-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .forum-header-btn i {
    display: none !important;
  }
}

/* ----- Tref Welcome Card Mobile ----- */
@media (max-width: 768px) {
  .tref-welcome-card {
    margin: 20px 10px 0 10px !important;
    padding: 24px 16px 24px 16px !important;
    border-radius: 12px !important;
  }

  .tref-welcome-logo {
    width: 80px !important;
    height: 80px !important;
    margin-bottom: 16px !important;
  }

  .tref-welcome-title {
    font-size: 1.8rem !important;
    margin-bottom: 12px !important;
  }

  .tref-welcome-subtitle {
    font-size: 16px !important;
    margin-bottom: 10px !important;
  }

  .tref-welcome-desc {
    font-size: 1rem !important;
    margin-bottom: 20px !important;
  }

  .tref-welcome-stats {
    gap: 16px !important;
    font-size: 0.95rem !important;
  }
}

@media (max-width: 480px) {
  .tref-welcome-card {
    margin: 15px 5px 0 5px !important;
    padding: 20px 12px 20px 12px !important;
  }

  .tref-welcome-logo {
    width: 60px !important;
    height: 60px !important;
  }

  .tref-welcome-title {
    font-size: 1.5rem !important;
  }

  .tref-welcome-subtitle {
    font-size: 14px !important;
  }

  .tref-welcome-desc {
    font-size: 0.9rem !important;
  }

  .tref-welcome-stats {
    flex-direction: column !important;
    gap: 8px !important;
    font-size: 0.9rem !important;
  }
}

/* ----- Tref Path Section (Forum Cards) Mobile ----- */
@media (max-width: 768px) {
  .tref-path-section {
    margin: 24px 10px 0 10px !important;
    padding: 24px 12px 28px 12px !important;
    border-radius: 12px !important;
  }

  .tref-path-badge {
    font-size: 0.95rem !important;
    padding: 5px 16px !important;
    margin-bottom: 12px !important;
  }

  .tref-path-title {
    font-size: 1.8rem !important;
    margin-bottom: 10px !important;
  }

  .tref-path-desc {
    font-size: 1rem !important;
    margin-bottom: 24px !important;
  }

  .tref-path-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .tref-path-card {
    padding: 20px 12px 18px 12px !important;
    min-height: 140px !important;
    border-radius: 12px !important;
  }

  .tref-path-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.5rem !important;
    margin-bottom: 12px !important;
    border-radius: 12px !important;
  }

  .tref-path-card-title {
    font-size: 1.1rem !important;
    margin-bottom: 6px !important;
  }

  .tref-path-card-desc {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
  }
}

@media (max-width: 480px) {
  .tref-path-section {
    margin: 15px 5px 0 5px !important;
    padding: 20px 8px 24px 8px !important;
  }

  .tref-path-title {
    font-size: 1.5rem !important;
  }

  .tref-path-desc {
    font-size: 0.9rem !important;
  }

  .tref-path-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .tref-path-card {
    padding: 16px 10px 14px 10px !important;
    min-height: 120px !important;
    flex-direction: row !important;
    gap: 12px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: right !important;
  }

  .tref-path-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.4rem !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  .tref-path-card > div:not(.tref-path-icon) {
    flex: 1 !important;
  }

  .tref-path-card-title {
    font-size: 1.05rem !important;
    text-align: right !important;
  }

  .tref-path-card-desc {
    font-size: 0.8rem !important;
    text-align: right !important;
  }
}

/* ----- Topic List Mobile ----- */
@media (max-width: 768px) {
  .topiclist .row {
    padding: 10px 12px !important;
  }

  .topiclist a.topictitle {
    font-size: 14px !important;
    display: block !important;
    word-wrap: break-word !important;
  }

  .topiclist dt .list-inner {
    padding: 8px !important;
  }

  ul.topiclist.forums dt,
  ul.topiclist.topics dt {
    margin-right: 0 !important;
  }

  ul.topiclist dd {
    display: none !important;
  }

  ul.topiclist dd.mark {
    display: block !important;
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
  }

  .forabg,
  .forumbg {
    margin: 10px 0 !important;
    border-radius: 10px !important;
  }

  .forabg .header,
  .forumbg .header {
    padding: 12px 14px !important;
    font-size: 14px !important;
  }
}

/* ----- Posts Mobile ----- */
@media (max-width: 768px) {
  .post {
    margin: 10px 0 !important;
    border-radius: 10px !important;
  }

  .post .inner {
    padding: 12px !important;
  }

  .postprofile {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    border-radius: 10px 10px 0 0 !important;
    min-height: auto !important;
  }

  .postprofile .avatar img {
    max-width: 40px !important;
    max-height: 40px !important;
  }

  .postbody {
    padding: 12px !important;
  }

  .postbody h3 {
    font-size: 15px !important;
  }

  .postbody .content {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }

  .post-buttons {
    flex-wrap: wrap !important;
    gap: 5px !important;
  }
}

/* ----- Navbar Mobile ----- */
@media (max-width: 768px) {
  .navbar {
    padding: 5px 0 !important;
  }

  .navbar .inner {
    padding: 0 10px !important;
  }

  .linklist {
    padding: 5px 0 !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .linklist li {
    margin: 2px !important;
  }

  .linklist a {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .dropdown-container .dropdown {
    min-width: 150px !important;
    max-width: calc(100vw - 20px) !important;
  }
}

/* ----- Panels Mobile ----- */
@media (max-width: 768px) {
  .panel {
    margin: 10px 0 !important;
    border-radius: 10px !important;
  }

  .panel .inner {
    padding: 16px 12px !important;
  }

  .panel h2,
  .panel h3 {
    font-size: 1.2rem !important;
    margin-bottom: 12px !important;
  }
}

/* ----- Advertisements Mobile ----- */
@media (max-width: 768px) {
  #page-body > div[style*='grid-template-columns'] {
    grid-template-columns: 1fr !important;
  }

  .ad-container,
  [class*='advertisement'] {
    max-width: 100% !important;
    margin: 5px auto !important;
  }
}

/* ----- Pagination Mobile ----- */
@media (max-width: 768px) {
  .pagination {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 4px !important;
  }

  .pagination a,
  .pagination span {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .pagination .ellipsis {
    display: none !important;
  }
}

/* ----- Search Box Mobile ----- */
@media (max-width: 768px) {
  #search-box,
  .search-box,
  .search-header {
    width: 100% !important;
    max-width: 100% !important;
  }

  #search-box form,
  .search-box form {
    width: 100% !important;
  }

  .headerbar {
    padding: 16px 10px !important;
  }

  .headerbar .inner {
    padding: 0 10px !important;
  }
}

/* ----- Login Panel Mobile ----- */
@media (max-width: 768px) {
  .tref-login-panel {
    margin: 20px 10px !important;
    flex-direction: column !important;
    gap: 15px !important;
  }

  .tref-login-panel .panel {
    min-width: 100% !important;
    border-radius: 12px !important;
  }

  .tref-login-panel .panel .inner {
    padding: 20px 16px !important;
  }

  .tref-login-panel .login-title,
  .tref-login-panel h3 {
    font-size: 1.3rem !important;
  }

  #login .panel,
  #register .panel {
    max-width: 100% !important;
    margin: 15px 10px !important;
  }

  #login .panel .inner,
  #register .panel .inner {
    padding: 20px 16px !important;
  }
}

/* ----- UCP Menu Mobile ----- */
@media (max-width: 768px) {
  .cp-menu {
    padding: 12px !important;
    margin-bottom: 15px !important;
  }

  .cp-menu .navigation li a {
    padding: 8px 12px !important;
    font-size: 14px !important;
  }

  .cp-main .panel .inner {
    padding: 16px 12px !important;
  }

  .cp-main h2,
  .cp-main h3 {
    font-size: 1.2rem !important;
  }

  #tabs.tabs {
    padding: 6px !important;
  }

  #tabs.tabs ul {
    gap: 4px !important;
    justify-content: center !important;
  }

  #tabs.tabs li.tab a {
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
}

/* ----- Footer Mobile ----- */
@media (max-width: 768px) {
  #page-footer {
    padding: 16px 10px !important;
  }

  .copyright {
    font-size: 12px !important;
    padding: 10px 0 !important;
  }

  .tref-footer-banner-row {
    flex-direction: column !important;
    gap: 10px !important;
    margin: 20px 10px 0 10px !important;
    padding: 0 !important;
  }

  .tref-footer-banner {
    border-radius: 8px !important;
    min-height: 50px !important;
  }

  .tref-footer-banner-left-text {
    font-size: 1.2rem !important;
  }

  .tref-footer-banner-right-title {
    font-size: 1rem !important;
  }

  .tref-footer-banner-right-desc {
    font-size: 0.85rem !important;
  }
}

/* ----- Message Panel Mobile ----- */
@media (max-width: 768px) {
  #message {
    max-width: calc(100% - 20px) !important;
    margin: 80px 10px 30px 10px !important;
    border-radius: 16px !important;
  }

  #message .inner {
    padding: 30px 20px !important;
  }

  .reg-icon {
    width: 60px !important;
    height: 60px !important;
    font-size: 32px !important;
  }

  .reg-title {
    font-size: 20px !important;
  }

  .reg-subtitle {
    font-size: 14px !important;
  }

  .reg-info {
    padding: 12px 16px !important;
    font-size: 13px !important;
  }
}

/* ----- Touch-Friendly Improvements ----- */
@media (max-width: 768px) {
  /* Increase touch target sizes */
  a,
  button,
  .button,
  input[type='submit'],
  input[type='button'],
  .tref-path-card,
  .tref-category-card,
  .linklist a {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  /* Ensure adequate spacing between clickable elements */
  .linklist li + li {
    margin-left: 4px !important;
  }

  /* Prevent text from being too small to read */
  body,
  p,
  .content,
  .postbody .content {
    font-size: 14px !important;
    line-height: 1.5 !important;
  }
}

/* ----- Prevent Horizontal Scroll ----- */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  img,
  video,
  iframe,
  embed,
  object {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Preserve logo dimensions - override the generic img rule */
  .tref-topbar-logo img {
    max-width: 120px !important;
    height: 36px !important;
    width: auto !important;
  }

  .tref-welcome-logo {
    max-width: 80px !important;
    height: 80px !important;
    width: 80px !important;
  }

  pre,
  code {
    overflow-x: auto !important;
    word-wrap: break-word !important;
    white-space: pre-wrap !important;
  }

  table {
    display: block !important;
    overflow-x: auto !important;
    max-width: 100% !important;
  }
}

/* ----- Logo overrides for smaller screens ----- */
@media (max-width: 480px) {
  .tref-topbar-logo img {
    max-width: 90px !important;
    height: 28px !important;
    width: auto !important;
  }

  .tref-welcome-logo {
    max-width: 60px !important;
    height: 60px !important;
    width: 60px !important;
  }
}

@media (max-width: 360px) {
  .tref-topbar-logo img {
    max-width: 70px !important;
    height: 24px !important;
    width: auto !important;
  }
}

/* ----- RTL Mobile Adjustments ----- */
@media (max-width: 768px) {
  html[lang='yi'] .tref-path-card,
  html[lang='yi-YI'] .tref-path-card,
  body[lang='yi'] .tref-path-card,
  body[lang='yi-YI'] .tref-path-card {
    flex-direction: row-reverse !important;
    text-align: right !important;
  }

  html[lang='yi'] .linklist,
  html[lang='yi-YI'] .linklist,
  body[lang='yi'] .linklist,
  body[lang='yi-YI'] .linklist {
    justify-content: flex-end !important;
  }
}

/* ===== POSTING EDITOR LAYOUT - TEXTAREA BESIDE SMILEYS ===== */
.posting-editor-wrapper {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.posting-editor-wrapper #message-box {
  flex: 3 1 auto;
  min-width: 0;
}

#message {
  margin: 0 !important;
}

.posting-editor-wrapper #message-box textarea {
  width: 100%;
  height: 311px !important;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.posting-editor-wrapper > div:not(#message-box) {
  /* display: flex; */
  /* flex-direction: column; */
  /* gap: 15px; */
}

.posting-editor-wrapper #smiley-box {
  width: 250px;
  height: 311px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px;
  /* overflow-y: auto; */
  /* overflow-x: hidden; */
  /* display: flex; */
  flex-direction: column;
}

.posting-editor-wrapper .smiley-header {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.posting-editor-wrapper .smiley-header strong {
  display: block;
  color: #333;
  font-size: 14px;
}

.posting-editor-wrapper .smiley-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: flex-start;
}

.posting-editor-wrapper #smiley-box strong {
  display: block;
  margin-bottom: 10px;
  color: #333;
  font-size: 14px;
  white-space: normal;
}

.posting-editor-wrapper #smiley-box img {
  margin: 3px;
  cursor: pointer;
  transition: transform 0.2s;
}

.posting-editor-wrapper #smiley-box img:hover {
  transform: scale(1.2);
}

.posting-editor-wrapper #smiley-box a {
  display: inline-block;
  white-space: nowrap;
}

.posting-editor-wrapper #upload-button-box {
  width: 250px;
  text-align: center;
}

.posting-editor-wrapper #upload-button-box .button2 {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #0078d4;
  background-color: #0078d4;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.posting-editor-wrapper #upload-button-box .button2:hover {
  background-color: #005a9e;
}

.posting-editor-wrapper .bbcode-status {
  /* margin-top: 15px; */
  /* padding-top: 15px; */
  border-top: 1px solid #ddd;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}

.posting-editor-wrapper .bbcode-status hr {
  margin: 8px 0;
  border: none;
  border-top: 1px solid #ddd;
}

/* Mobile responsive - stack vertically */
@media (max-width: 1024px) {
  .posting-editor-wrapper {
    flex-direction: column;
  }

  .posting-editor-wrapper #smiley-box {
    flex: 1 0 auto;
    max-height: none;
  }
}

/* ===== FORMATTING BUTTONS WITH LABELS ===== */
.format-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 15px;
}

.format-buttons .button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  color: #333;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.format-buttons .button:hover {
  background: #e8e8e8;
  border-color: #0099cc;
  color: #0099cc;
}

.format-buttons .button i {
  font-size: 14px;
}

.format-buttons .button span {
  display: inline-block;
}

.format-buttons .bbcode-size {
  padding: 8px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  background: #f5f5f5;
  color: #333;
  cursor: pointer;
}

.format-buttons .bbcode-size:hover {
  background: #e8e8e8;
  border-color: #0099cc;
}

/* Mobile responsive - hide text labels on small screens */
@media (max-width: 768px) {
  .format-buttons .button span {
    display: none;
  }

  .format-buttons .button {
    padding: 8px 10px;
  }
}

/* Upload Photo Button Styles */
.upload-photo-container {
  margin-top: 10px;
}

.attach-upload-section {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

.attach-upload-section p {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 13px;
}

#attach-panel {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  margin-top: 15px;
  clear: both;
}

#attach-panel .inner {
  padding: 20px;
}

#postingbox #attach-panel,
.fields1 #attach-panel {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.upload-photo-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #fff;
  color: #1a73e8;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}

button.upload-photo-btn {
  font-family: inherit;
}

.upload-photo-btn:hover {
  background: #f8f9fa;
  border-color: #1a73e8;
}

.hidden-file-input {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
}
