/*
 * Dark Gaming Theme - Bajuma Gameservers
 * Bootstrap 5 based dark theme with neon gaming aesthetics
 */

/* ========================================
   Inter, the site's main font (body stack below)
   ======================================== */
/* Inter 4.1 (SIL OFL 1.1, fonts/inter-4.1/OFL.txt), one variable file for every weight from 100 to
   900. Served from this site, never from Google Fonts: embedding that sends the visitor's IP to
   Google. German and English pages need only the latin file (48 KB); the browser fetches latin-ext
   (85 KB) only for text with letters outside Latin-1, as in Polish, Czech or Turkish names. Other
   scripts (Cyrillic, Greek) fall back to the system font. cms/page_header.tpl preloads the latin
   file, so its URL there must match the one here; a new Inter version gets a new folder, which
   also replaces cached copies. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-4.1/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-4.1/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
  /* Core dark palette */
  --bg-body: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-hover: #1c2333;
  --bg-card: #21262d;
  --bg-card-header: #161b22;
  --bg-sidebar: #0d1117;
  --bg-header: rgba(13, 17, 23, 0.95);
  --bg-input: #0d1117;

  /* Border colors */
  --border-default: #30363d;
  --border-muted: #21262d;
  --border-accent: rgba(0, 229, 255, 0.3);

  /* Text colors */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-link: #58a6ff;

  /* Accent colors - neon gaming */
  --accent-cyan: #00e5ff;
  --accent-purple: #bb86fc;
  --accent-green: #39d353;
  --accent-red: #f85149;
  --accent-yellow: #e3b341;
  --accent-blue: #58a6ff;
  --accent-orange: #f0883e;

  /* Glow effects */
  --glow-cyan: 0 0 20px rgba(0, 229, 255, 0.3);
  --glow-purple: 0 0 20px rgba(187, 134, 252, 0.3);
  --glow-green: 0 0 15px rgba(57, 211, 83, 0.3);
  --glow-red: 0 0 15px rgba(248, 81, 73, 0.3);
  --glow-yellow: 0 0 15px rgba(227, 179, 65, 0.3);

  /* Glass morphism */
  --glass-bg: rgba(22, 27, 34, 0.8);
  --glass-border: rgba(48, 54, 61, 0.5);
  --glass-blur: blur(10px);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 0px;
  --header-height: 56px;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* ========================================
   Global Base Styles
   ======================================== */
html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-body) !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  width: 100% !important;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover, a:focus {
  color: #33eaff;
  text-decoration: none;
}

::selection {
  background: rgba(0, 229, 255, 0.3);
  color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

hr {
  border-color: var(--border-default);
  opacity: 0.5;
}

/* ========================================
   Main Layout Structure
   ======================================== */
.wrapper,
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  margin: 0 !important;
}

/* Sidebar */
.main-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  z-index: 1040;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-normal), width var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.sidebar-collapsed .main-sidebar {
  transform: translateX(-100%);
}

/* Sidebar header */
.sidebar-header {
  flex-shrink: 0;
}

/* Sidebar nav - scrollable area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Content area (right side) */
.content-area {
  flex: 1;
  /* A flex item does not shrink below its widest content by default: one wide element on a
     page made the whole area, header included, wider than a phone screen, which then scrolled
     sideways with the avatar cut off */
  min-width: 0;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-normal);
}

.sidebar-collapsed .content-area {
  margin-left: 0;
}

/* Main content area (legacy wrapper compat) */
.main-content {
  flex: 1;
  padding: 1rem;
}

/* Content wrapper (where templates inject content) */
.content-wrapper,
aside.content-wrapper {
  flex: 1;
  padding: 0;
  background: transparent !important;
  min-height: auto !important;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1035;
  cursor: pointer;
}
body.sidebar-open .sidebar-overlay {
  display: block;
}

/* ========================================
   Header / Top Navbar
   ======================================== */
/* New dark theme top header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.5rem;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Sidebar toggle button */
.sidebar-toggle-btn,
.sidebar-toggle {
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 1.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.sidebar-toggle-btn:hover,
.sidebar-toggle:hover {
  color: var(--accent-cyan);
  background: var(--bg-surface);
}

/* Header icon links (tickets, warnings) */
.header-icon-link {
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  text-decoration: none;
}
.header-icon-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.header-icon-link i {
  font-size: 1.1rem;
}

/* Badge counts on header icons */
.badge-count {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
  position: absolute;
  top: 0;
  right: -2px;
}
.badge-success {
  background: var(--accent-green);
  color: #000;
}
.badge-danger {
  background: var(--accent-red);
  color: #fff;
}

/* Language dropdown selector */
.lang-dropdown {
  position: relative;
}
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.lang-toggle:hover,
.lang-toggle:focus {
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  text-decoration: none;
}
.lang-toggle::after {
  /* Override Bootstrap caret */
  margin-left: 0.15rem;
  vertical-align: 0.15em;
  border-top-color: var(--text-muted);
}
.lang-toggle .lang-flag {
  font-size: 1.15rem;
  line-height: 1;
}
.lang-toggle .lang-code {
  letter-spacing: 0.04em;
}
.lang-menu {
  min-width: 180px;
  padding: 0.35rem 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.85rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}
.lang-item:hover,
.lang-item:focus {
  background: rgba(0, 229, 255, 0.08);
  color: var(--text-primary);
}
.lang-item.active {
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent-cyan);
}
.lang-item .lang-flag {
  font-size: 1.25rem;
  line-height: 1;
}

/* Legacy flag support (keep for backwards compat) */
.header-flags {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.flag-link {
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}
.flag-link:hover {
  opacity: 1;
}
.flag-link img {
  display: block;
}

/* Header dropdowns */
.header-dropdown {
  position: relative;
}

/* User toggle */
.user-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  transition: border-color var(--transition-fast);
}
.user-toggle:hover .user-avatar {
  border-color: var(--accent-cyan);
}
.user-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Dropdown menus */
.dropdown-menu,
.dropdown-dark {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  padding: 0.5rem 0;
  color: var(--text-primary);
}
.dropdown-menu > li > a,
.dropdown-menu .dropdown-item {
  color: var(--text-primary) !important;
  padding: 0.5rem 1rem;
  transition: background var(--transition-fast);
}
.dropdown-menu > li > a:hover,
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background: var(--bg-surface-hover) !important;
  color: var(--accent-cyan) !important;
}
.dropdown-menu .divider,
.dropdown-menu .dropdown-divider {
  border-color: var(--border-default) !important;
  margin: 0.25rem 0;
}
.dropdown-header {
  color: var(--text-secondary) !important;
  padding: 0.5rem 1rem !important;
}

/* User info header in dropdown */
.user-info-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}
.user-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(0, 229, 255, 0.3);
}
.user-info-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.user-info-text strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}
.user-info-text small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* User menu dropdown width */
.user-menu-dropdown {
  width: 280px;
  min-width: 280px;
}

/* Text color utility overrides for dropdown items */
.dropdown-item.text-danger {
  color: var(--accent-red) !important;
}
.dropdown-item.text-danger:hover {
  color: #fff !important;
  background: rgba(248, 81, 73, 0.2) !important;
}

/* Legacy AdminLTE header compat */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.main-header .logo {
  display: none;
}

.main-header .navbar {
  width: 100%;
  padding: 0;
  margin: 0;
  background: transparent !important;
  border: none !important;
  min-height: auto;
  display: flex;
  align-items: center;
}

.navbar-static-top {
  position: static !important;
}

/* Legacy navbar right menu compat */
.navbar-custom-menu {
  margin-left: auto;
}
.navbar-custom-menu .nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar-custom-menu .nav > li > a {
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.navbar-custom-menu .nav > li > a:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

/* Legacy notification badges */
.navbar-custom-menu .label {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 10px;
}

/* Legacy navbar right (language flags) */
.navbar-right {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}
.navbar-right .navbar-text {
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.navbar-right .navbar-text a {
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}
.navbar-right .navbar-text a:hover {
  opacity: 1;
}

/* Legacy user menu compat */
.user-menu .dropdown-menu {
  width: 280px;
}
.user-header {
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), rgba(187, 134, 252, 0.1));
  padding: 1.5rem;
  text-align: center;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.user-header img {
  width: 64px;
  height: 64px;
  border: 3px solid rgba(0, 229, 255, 0.3);
}
.user-header p {
  color: var(--text-primary);
  margin: 0.5rem 0 0;
}
.user-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-default);
}
.user-image {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 0.5rem;
}

/* ========================================
   Sidebar Styles
   ======================================== */
.sidebar-brand {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-height);
}
.sidebar-brand img {
  width: 32px;
  height: 32px;
}
.sidebar-brand span {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.sidebar {
  padding: 0;
}

.sidebar-menu {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

.sidebar-menu > li {
  margin: 1px 0.5rem;
}

.sidebar-menu > li > a {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  text-decoration: none;
}
.sidebar-menu > li > a:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.sidebar-menu > li.active > a {
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.08);
}

/* "Order server": the one entry that brings something new, so it stands out */
.sidebar-menu > li.sidebar-cta > a {
  color: var(--accent-green);
  font-weight: 700;
  border: 1px solid rgba(57, 211, 83, 0.35);
}
.sidebar-menu > li.sidebar-cta > a:hover,
.sidebar-menu > li.sidebar-cta.active > a {
  color: var(--accent-green);
  background: rgba(57, 211, 83, 0.1);
}

.sidebar-menu > li > a > i {
  width: 20px;
  text-align: center;
  margin-right: 0.75rem;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-menu > li > a > span {
  flex: 1;
}

/* Treeview arrow */
.pull-right-container {
  margin-left: auto;
  transition: transform var(--transition-normal);
}
.pull-right-container .pull-right {
  float: none !important;
  transition: transform var(--transition-normal);
}
.menu-open > a > .pull-right-container .pull-right,
.menu-open > a > .pull-right-container .fa-angle-left {
  transform: rotate(-90deg);
}

/* Treeview submenu */
.treeview-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.menu-open > .treeview-menu {
  /* max-height set by JS */
}

.treeview-menu > li {
  margin: 0;
}
.treeview-menu > li > a {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.75rem 0.45rem 2.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  margin: 0 0.5rem;
}
.treeview-menu > li > a:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}
.treeview-menu > li.active > a {
  color: var(--accent-cyan);
  background: rgba(0, 229, 255, 0.06);
}
.treeview-menu > li > a > i {
  width: 18px;
  text-align: center;
  margin-right: 0.5rem;
  font-size: 0.85rem;
}

/* Sidebar header/section labels */
.sidebar-menu .header {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1rem 1rem 0.5rem;
  font-weight: 600;
}

/* ========================================
   Responsive: Mobile Sidebar
   ======================================== */
@media (max-width: 991.98px) {
  .main-sidebar {
    transform: translateX(-100%);
  }
  .content-area,
  .main-content {
    margin-left: 0;
  }
  body:not(.sidebar-collapsed) .main-sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-open .main-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }
}

@media (min-width: 992px) {
  body.sidebar-collapsed .main-sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-collapsed .content-area,
  body.sidebar-collapsed .main-content {
    margin-left: 0;
  }
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-secondary);
}

small, .small {
  color: var(--text-muted);
}

code {
  background: var(--bg-surface);
  color: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: var(--text-primary);
}

/* ========================================
   Particles Background Canvas
   ======================================== */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
