/*
 * Modern theme overrides for Vibeforge default theme
 * Keep this file loaded after style.min.css for consistent overrides.
 */

:root {
  --vf-accent: #4c6fff;
  --vf-accent-strong: #2f4dff;
  --vf-accent-soft: rgba(76, 111, 255, 0.14);
  --vf-accent-2: #f97316;
  --vf-accent-2-soft: rgba(249, 115, 22, 0.16);
  --vf-success: #10b981;
  --vf-warning: #f59e0b;
  --vf-danger: #ef4444;
  --vf-surface: #ffffff;
  --vf-surface-alt: #f5f7fb;
  --vf-border: rgba(15, 23, 42, 0.08);
  --vf-border-strong: rgba(15, 23, 42, 0.16);
  --vf-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 10px 20px rgba(15, 23, 42, 0.08);
  --vf-shadow-md: 0 18px 40px rgba(15, 23, 42, 0.12);
  --vf-radius-sm: 10px;
  --vf-radius-md: 14px;
  --vf-radius-lg: 20px;
  --vf-radius-xl: 26px;
  --vf-ring: 0 0 0 4px rgba(76, 111, 255, 0.2);
  --vf-modal-header-bg: var(--vf-accent);
  --vf-space-1: 4px;
  --vf-space-2: 8px;
  --vf-space-3: 12px;
  --vf-space-4: 16px;
  --vf-space-5: 20px;
  --vf-space-6: 24px;
  --vf-space-7: 32px;
  --vf-space-8: 40px;
  --vf-avatar-sm: 32px;
  --vf-avatar-md: 40px;
  --vf-avatar-lg: 56px;

  --body-bg-color: #f5f7fb;
  --body-bg-color-dark: #0b1119;
  --body-color: #0f172a;
  --body-color-dark: #e2e8f0;
  --link-color: var(--vf-accent);
  --header-bg-color: rgba(255, 255, 255, 0.9);
  --header-bg-color-dark: rgba(12, 18, 28, 0.92);
  --card-dark-color: #111827;
  --card-dark-divider: rgba(148, 163, 184, 0.18);
  --card-dark-hover: rgba(30, 41, 59, 0.65);
  --card-dark-input: #0f172a;
  --card-dark-input-color: #e2e8f0;
  --plyr-color-main: var(--vf-accent);
}

body {
  color: var(--body-color);
  background-color: var(--body-bg-color);
  background-image:
    radial-gradient(1200px circle at 20% -10%, rgba(76, 111, 255, 0.18), transparent 45%),
    radial-gradient(900px circle at 85% 10%, rgba(16, 185, 129, 0.12), transparent 45%);
  background-attachment: fixed;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

body.night-mode {
  color: var(--body-color-dark);
  background-color: var(--body-bg-color-dark);
  background-image:
    radial-gradient(1000px circle at 18% -10%, rgba(76, 111, 255, 0.12), transparent 45%),
    radial-gradient(900px circle at 85% 10%, rgba(16, 185, 129, 0.08), transparent 45%);
}

::selection {
  background: rgba(76, 111, 255, 0.24);
}

a {
  color: var(--link-color);
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--vf-accent-strong);
}

hr {
  border-top: 1px solid var(--vf-border);
  opacity: 1;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  letter-spacing: -0.02em;
}

h1,
.h1 {
  font-size: clamp(1.9rem, 2.5vw, 2.6rem);
  line-height: 1.15;
}

h2,
.h2 {
  font-size: clamp(1.5rem, 2vw, 2rem);
  line-height: 1.2;
}

h3,
.h3 {
  font-size: clamp(1.25rem, 1.6vw, 1.6rem);
  line-height: 1.25;
}

h4,
.h4 {
  font-size: 1.1rem;
  line-height: 1.3;
}

h5,
.h5 {
  font-size: 1rem;
  line-height: 1.35;
}

h6,
.h6 {
  font-size: 0.95rem;
  line-height: 1.35;
}

@keyframes vf-page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body {
  animation: vf-page-in 0.5s ease both;
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}

/* Surfaces */
.card,
.panel,
.post,
.publisher,
.x_announcement,
.x_notification,
.page-content,
.main-side-nav-card,
.dropdown-menu,
.modal-content,
.offcanvas,
.x-form {
  border-radius: var(--vf-radius-lg);
  border: 1px solid var(--vf-border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  background: var(--vf-surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.night-mode .card,
body.night-mode .panel,
body.night-mode .post,
body.night-mode .publisher,
body.night-mode .x_announcement,
body.night-mode .x_notification,
body.night-mode .page-content,
body.night-mode .main-side-nav-card,
body.night-mode .dropdown-menu,
body.night-mode .modal-content,
body.night-mode .offcanvas,
body.night-mode .x-form {
  background: var(--card-dark-color);
  border-color: var(--card-dark-divider);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}

body.night-mode .dropdown-menu {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card-body,
.modal-body,
.offcanvas-body {
  padding: var(--vf-space-4);
}

body.night-mode .sg-offcanvas-sidebar .card-body {
  background: var(--card-dark-color);
  color: var(--body-color-dark);
}

.card-header,
.card-footer,
.panel-heading {
  background: linear-gradient(135deg, rgba(76, 111, 255, 0.12), rgba(16, 185, 129, 0.1));
  border-color: var(--vf-border);
  border-top-left-radius: calc(var(--vf-radius-lg) - 2px);
  border-top-right-radius: calc(var(--vf-radius-lg) - 2px);
  padding: var(--vf-space-3) var(--vf-space-4);
}

body.night-mode .card-header,
body.night-mode .card-footer,
body.night-mode .panel-heading {
  border-color: var(--card-dark-divider);
  background: linear-gradient(135deg, rgba(76, 111, 255, 0.2), rgba(16, 185, 129, 0.16));
}

.card-title,
.panel-title,
.section-title,
.widget-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}

body.night-mode .card-title,
body.night-mode .panel-title,
body.night-mode .section-title,
body.night-mode .widget-title {
  color: #f8fafc;
}

.card:hover,
.panel:hover,
.post:hover,
.publisher:hover,
.x_announcement:hover,
.x_notification:hover,
.main-side-nav-card:hover,
.page-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  border-color: var(--vf-border-strong);
}

body.night-mode .card:hover,
body.night-mode .panel:hover,
body.night-mode .post:hover,
body.night-mode .publisher:hover,
body.night-mode .x_announcement:hover,
body.night-mode .x_notification:hover,
body.night-mode .main-side-nav-card:hover,
body.night-mode .page-content:hover {
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.45);
}

/* Header */
.main-header {
  background: var(--header-bg-color);
  border-bottom: 1px solid var(--vf-border);
  backdrop-filter: blur(22px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
}

body.night-mode .main-header {
  background: var(--header-bg-color-dark);
  border-bottom-color: var(--card-dark-divider);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--vf-space-3);
}

.header-right .navbar-wrapper {
  flex: 0 0 auto;
}

.header-right .navbar-wrapper>ul {
  justify-content: flex-end;
}

.header-right .navbar-wrapper>ul>li {
  flex: 0 0 auto;
}

.header-meta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  pointer-events: none;
  z-index: 1002;
  flex-direction: row;
  text-align: left;
}


body.night-mode .header-meta {
  color: #ffffff;
}

.main-wrapper .header-meta {
  color: #ffffff;
}

body.night-mode .main-wrapper .header-meta {
  color: #ffffff;
}

.header-meta.no-weather .header-meta-sep,
.header-meta.no-weather .header-meta-weather {
  display: none;
}

.header-meta-weather {
  padding-right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-meta-sep {
  display: none;
}

.header-meta-weather i {
  font-size: 12px;
  opacity: 0.9;
  line-height: 1;
}

.header-meta-weather-text {
  display: inline-block;
}

@media (max-width: 1024px), (max-width: 769px) {
  .header-meta {
    display: none;
  }
}

@media (hover: none) and (pointer: coarse) {
  .header-meta {
    display: none;
  }
}

@media (max-width: 1357px) {
  .header-meta {
    display: none;
  }
}

.main-header .menu-icon {
  background: var(--vf-accent);
  color: #fff;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.main-header .menu-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(76, 111, 255, 0.35);
}

.main-header .search-wrapper .form-control {
  border-radius: 999px;
  border: 1px solid var(--vf-border);
  background: var(--vf-surface-alt);
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.main-header .search-wrapper .form-control:focus {
  border-color: var(--vf-accent);
  box-shadow: var(--vf-ring);
}

body.night-mode .main-header .search-wrapper .form-control {
  background: var(--card-dark-input);
  border-color: var(--card-dark-divider);
  color: var(--card-dark-input-color);
}

/* Navigation */
.main-side-nav,
.side-nav,
.footer-bottom-bar,
.main-header .dropdown-widget,
.footer-bottom-bar .dropdown-widget {
  background: var(--vf-surface);
  border: 1px solid var(--vf-border);
  border-radius: var(--vf-radius-lg);
}

body.night-mode .main-side-nav,
body.night-mode .side-nav,
body.night-mode .footer-bottom-bar,
body.night-mode .main-header .dropdown-widget,
body.night-mode .footer-bottom-bar .dropdown-widget {
  background: var(--card-dark-color);
  border-color: var(--card-dark-divider);
}

body.night-mode .main-header .navbar-wrapper .dropdown-menu,
body.night-mode .main-header .navbar-wrapper .dropdown-menu-end,
body.night-mode .main-header .dropdown-widget {
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.night-mode .navbar-wrapper .d-md-block .dropdown-menu-end {
  background-color: #111827 !important;
}

.main-side-nav>li>a,
.side-nav>li>a {
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.main-side-nav>li>a:hover,
.side-nav>li>a:hover {
  background: var(--vf-accent-soft);
  transform: translateX(2px);
}

.main-side-nav>li.active>a,
.side-nav>li.active>a,
.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--vf-accent), var(--vf-accent-strong));
  color: #fff !important;
  box-shadow: 0 10px 20px rgba(76, 111, 255, 0.3);
}

/* Keep sidebar icon color consistent across SVG and Font Awesome entries */
.main-side-nav a i,
.main-side-nav a i::before,
.side-nav a i,
.side-nav a i::before,
.main-side-nav a svg,
.main-side-nav a svg *,
.side-nav a svg,
.side-nav a svg * {
  color: #5e72e4 !important;
  fill: #5e72e4 !important;
}

.main-side-nav li.active > a i,
.main-side-nav li.active > a i::before,
.side-nav li.active > a i,
.side-nav li.active > a i::before,
.main-side-nav li.active > a svg,
.main-side-nav li.active > a svg *,
.side-nav li.active > a svg,
.side-nav li.active > a svg * {
  color: #fff !important;
  fill: #fff !important;
}

/* Static-page sidebar icons are image files, so tint them to match */
.main-side-nav > li > a > img.mr10,
.side-nav > li > a > img.mr10 {
  filter: invert(40%) sepia(36%) saturate(2033%) hue-rotate(210deg) brightness(90%) contrast(90%);
}

.main-side-nav > li.active > a > img.mr10,
.side-nav > li.active > a > img.mr10 {
  filter: brightness(0) invert(1);
}

/* Buttons */
.btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.55rem 1.2rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--vf-accent), var(--vf-accent-strong));
  border-color: transparent;
  box-shadow: 0 10px 18px rgba(76, 111, 255, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 14px 28px rgba(76, 111, 255, 0.35);
}

.btn-outline-primary {
  border-color: var(--vf-accent);
  color: var(--vf-accent);
}

.btn-outline-primary:hover {
  background: var(--vf-accent);
  color: #fff;
}

.btn-secondary,
.btn-secondary:focus {
  background: #eef2ff;
  border-color: transparent;
  color: #1e293b;
}

body.night-mode .btn-secondary,
body.night-mode .btn-secondary:focus {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: #e0e7ff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--vf-accent);
}

.btn-ghost:hover {
  background: var(--vf-accent-soft);
}

/* Forms */
.form-control,
.form-select,
.custom-file-label,
.custom-select {
  border-radius: var(--vf-radius-md);
  border: 1px solid var(--vf-border);
  background: var(--vf-surface-alt);
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--vf-accent);
  box-shadow: var(--vf-ring);
  background: #fff;
}

body.night-mode .form-control,
body.night-mode .form-select,
body.night-mode .custom-file-label,
body.night-mode .custom-select {
  background: var(--card-dark-input);
  border-color: var(--card-dark-divider);
  color: var(--card-dark-input-color);
}

body.night-mode .form-control:focus,
body.night-mode .form-select:focus {
  background: #0b1220;
}

.input-group-text {
  border-radius: var(--vf-radius-md);
  border-color: var(--vf-border);
  background: var(--vf-surface-alt);
}

.form-check-input:focus {
  box-shadow: var(--vf-ring);
}

.form-check-input:checked {
  background-color: var(--vf-accent);
  border-color: var(--vf-accent);
}

/* Tables & lists */
.table {
  border-color: var(--vf-border);
}

.table thead th {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #64748b;
}

body.night-mode .table thead th {
  color: #94a3b8;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: rgba(76, 111, 255, 0.04);
}

.list-group-item {
  border-color: var(--vf-border);
  border-radius: var(--vf-radius-md);
  padding: var(--vf-space-3) var(--vf-space-4);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.list-group-item:hover {
  background: var(--vf-accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

body.night-mode .list-group-item {
  border-color: var(--card-dark-divider);
}

body.night-mode .list-group-item:hover {
  background: rgba(76, 111, 255, 0.18);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.3);
}

/* Badges */
.badge,
.badge-lg {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge.bg-primary,
.badge.text-bg-primary {
  background: var(--vf-accent) !important;
}

.badge.bg-secondary,
.badge.text-bg-secondary {
  background: var(--vf-accent-2) !important;
  color: #fff !important;
}

/* Dropdowns & modals */
.dropdown-menu {
  padding: var(--vf-space-2);
}

.dropdown-item {
  border-radius: 10px;
  padding: var(--vf-space-2) var(--vf-space-3);
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

.dropdown-item:hover {
  background: var(--vf-accent-soft);
  transform: translateX(2px);
}

.modal-content {
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--vf-modal-header-bg) !important;
  color: #fff;
}

body.night-mode .modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.modal-header .modal-title,
.modal-header h1,
.modal-header h2,
.modal-header h3,
.modal-header h4,
.modal-header h5,
.modal-header h6 {
  color: #fff;
}

/* Page header / hero */
.page-header,
.main-wrapper .page-header,
.vf-shared-hero.page-header,
.vf-events-hero.page-header {
  background: linear-gradient(135deg, #1d4ed8 0%, #6366f1 50%, #22d3ee 100%) !important;
  color: #f8fafc;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  border-radius: 0 0 32px 32px;
}

.page-header a {
  color: #f8fafc;
}

/* Section separators */
.section-title:not([class*="bg-"]) {
  border-bottom: 1px solid var(--vf-border);
  padding-bottom: var(--vf-space-2);
  margin-bottom: var(--vf-space-3);
}

body.night-mode .section-title:not([class*="bg-"]) {
  border-bottom-color: var(--card-dark-divider);
}

/* Footer */
.footer-bottom-bar {
  box-shadow: var(--vf-shadow-sm);
}

/* Chat */
.chat-sidebar {
  border-radius: 22px;
  border: 1px solid var(--vf-border);
  background: var(--vf-surface);
  box-shadow: var(--vf-shadow-sm);
  overflow: hidden;
}

body.night-mode .chat-sidebar {
  border-color: var(--card-dark-divider);
  background: var(--card-dark-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.chat-sidebar .chat-sidebar-content {
  padding-top: 6px;
}

.chat-sidebar .chat-sidebar-content li,
.chat-sidebar .chat-sidebar-content .chat-sidebar-item {
  border-radius: 14px;
  margin: 6px 10px;
  padding: 8px 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chat-sidebar .chat-sidebar-content li:hover,
.chat-sidebar .chat-sidebar-content .chat-sidebar-item:hover {
  background: var(--vf-accent-soft);
  transform: translateY(-1px);
}

body.night-mode .chat-sidebar .chat-sidebar-content li:hover,
body.night-mode .chat-sidebar .chat-sidebar-content .chat-sidebar-item:hover {
  background: rgba(76, 111, 255, 0.18);
}

.chat-sidebar .chat-sidebar-footer {
  padding: 10px 8px;
  left: 5px;
  right: auto !important;
  top: 988px;
  bottom: auto !important;
  background-color: var(--vf-surface);
}

body.night-mode .chat-sidebar .chat-sidebar-footer {
  background-color: var(--card-dark-color);
}

.chat-sidebar .js_scroller {
  scrollbar-width: thin;
  scrollbar-color: rgba(76, 111, 255, 0.4) transparent;
  left: 7px;
}

.chat-sidebar .js_scroller::-webkit-scrollbar {
  width: 6px;
}

.chat-sidebar .js_scroller::-webkit-scrollbar-thumb {
  background: rgba(76, 111, 255, 0.35);
  border-radius: 999px;
}

/* Chat sidebar (custom layout overrides) */
.chat-sidebar {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

@media (min-width: 1200px) {
  .chat-sidebar {
    top: 70px;
    width: 85px;
  }
}

/* Empty states */
.no-data,
.contest-empty,
.shoutbox-empty,
.vf-events-calendar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--vf-space-2);
  padding: var(--vf-space-3) var(--vf-space-4);
  border-radius: var(--vf-radius-lg);
  background: var(--vf-surface-alt);
  border: 1px dashed var(--vf-border);
  color: #64748b;
  font-weight: 600;
}

body.night-mode .no-data,
body.night-mode .contest-empty,
body.night-mode .shoutbox-empty,
body.night-mode .vf-events-calendar-empty {
  background: rgba(15, 23, 42, 0.6);
  border-color: var(--card-dark-divider);
  color: #94a3b8;
}

.contest-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--vf-accent-soft);
  color: var(--vf-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.night-mode .contest-empty-icon {
  background: rgba(76, 111, 255, 0.2);
  color: #93c5fd;
}

/* Avatars */
.avatarz,
.form-table-row > div.avatar,
.forum-thread .avatar {
  box-shadow: 0 0 0 2px var(--vf-surface), 0 0 0 4px rgba(76, 111, 255, 0.18);
}

body.night-mode .avatarz,
body.night-mode .form-table-row > div.avatar,
body.night-mode .forum-thread .avatar {
  box-shadow: 0 0 0 2px var(--card-dark-color), 0 0 0 4px rgba(76, 111, 255, 0.24);
}

.chat-avatar,
.chat-user-card .avatar {
  box-shadow: none;
}

.chat-avatar {
  width: var(--vf-avatar-md);
  height: var(--vf-avatar-md);
}

.chat-user-card .avatar {
  width: var(--vf-avatar-md);
  height: var(--vf-avatar-md);
}

/* Utilities */
.text-muted {
  color: #6b7280 !important;
}

body.night-mode .text-muted {
  color: #94a3b8 !important;
}

/* Small screens */
@media (max-width: 768px) {
  .main-header {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  }

  .page-header,
  .main-wrapper .page-header {
    border-radius: 0 0 20px 20px;
  }

  .main-side-nav > li > a,
  .side-nav > li > a {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .post,
  .publisher {
    border-radius: 16px;
  }

  .post .post-text {
    font-size: 0.97rem;
    line-height: 1.5;
  }

  .js_posts_stream .post .post-stats {
    min-height: 0 !important;
    padding: 8px 14px !important;
  }

  .js_posts_stream .post .post-stats .reactions-stats span,
  .js_posts_stream .post .post-stats .pointer,
  .js_posts_stream .post .post-stats .text-link {
    font-size: 0.85rem;
  }

  .post-actions .action-btn {
    min-height: 44px;
  }
}

/* Merits box adjustments */
.merits-box-wrapper > div {
  top: 11px;
}

.sg-offcanvas-mainbar .merits-box-wrapper button {
  top: 55px;
  bottom: auto !important;
}
