/*
 * Heliactyl Galaxy Theme
 * A cosmic, space-inspired dark theme with animated stars and nebula effects
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Theme Variables)
   ============================================ */
:root {
  /* Galaxy Color Palette */
  --galaxy-void: #0a0a0f;
  --galaxy-deep: #0d0d1a;
  --galaxy-dark: #12121f;
  --galaxy-medium: #1a1a2e;
  --galaxy-light: #252542;

  /* Nebula Accent Colors */
  --nebula-purple: #7c3aed;
  --nebula-blue: #3b82f6;
  --nebula-cyan: #06b6d4;
  --nebula-pink: #ec4899;
  --nebula-violet: #8b5cf6;

  /* Star Colors */
  --star-white: #ffffff;
  --star-blue: #a5b4fc;
  --star-yellow: #fde68a;

  /* Functional Colors */
  --bg-primary: var(--galaxy-void);
  --bg-secondary: var(--galaxy-deep);
  --bg-card: var(--galaxy-dark);
  --bg-sidebar: linear-gradient(180deg, var(--galaxy-medium) 0%, var(--galaxy-deep) 100%);
  --bg-navbar: rgba(13, 13, 26, 0.85);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Accent & Interactive */
  --accent-primary: var(--nebula-blue);
  --accent-secondary: var(--nebula-purple);
  --accent-hover: var(--nebula-cyan);
  --accent-glow: rgba(59, 130, 246, 0.5);

  /* Borders & Shadows */
  --border-color: rgba(139, 92, 246, 0.2);
  --border-glow: rgba(139, 92, 246, 0.4);
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-color);

  /* Gradients */
  --gradient-nebula: linear-gradient(135deg, var(--nebula-purple) 0%, var(--nebula-blue) 50%, var(--nebula-cyan) 100%);
  --gradient-card: linear-gradient(145deg, rgba(30, 30, 50, 0.8) 0%, rgba(18, 18, 31, 0.9) 100%);
  --gradient-button: linear-gradient(135deg, var(--nebula-purple) 0%, var(--nebula-blue) 100%);

  /* Animation Timings */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ============================================
   LIGHT MODE OVERRIDE
   ============================================ */
body.light-mode {
  /* Light Galaxy Color Palette */
  --galaxy-void: #f8fafc;
  --galaxy-deep: #f1f5f9;
  --galaxy-dark: #e2e8f0;
  --galaxy-medium: #cbd5e1;
  --galaxy-light: #94a3b8;

  /* Functional Colors - Light */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  --bg-navbar: rgba(255, 255, 255, 0.9);

  /* Text Colors - Light */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  /* Borders & Shadows - Light */
  --border-color: rgba(139, 92, 246, 0.15);
  --border-glow: rgba(139, 92, 246, 0.3);
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--border-color);

  /* Gradients - Light */
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.95) 100%);
}

/* Light mode - hide stars and nebula effect */
body.light-mode::before {
  opacity: 0;
}

body.light-mode::after {
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(124, 58, 237, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 80%, rgba(236, 72, 153, 0.03) 0%, transparent 50%);
}

/* Light mode - Page loader */
body.light-mode #galaxy-loader {
  background: #f8fafc;
}

body.light-mode .loader-text {
  color: var(--text-secondary);
}

/* Light mode - Cards and components */
body.light-mode .card {
  background: var(--gradient-card) !important;
  border-color: rgba(139, 92, 246, 0.15) !important;
}

body.light-mode .sidebar {
  background: var(--bg-sidebar) !important;
  border-right-color: rgba(139, 92, 246, 0.15);
}

body.light-mode .sidebar-brand-wrapper {
  background: rgba(241, 245, 249, 0.95) !important;
}

body.light-mode .navbar {
  background: var(--bg-navbar) !important;
  border-bottom-color: rgba(139, 92, 246, 0.15);
}

body.light-mode .dropdown-menu {
  background: #ffffff !important;
  border-color: rgba(139, 92, 246, 0.15) !important;
}

body.light-mode .form-control {
  background: #ffffff !important;
  border-color: rgba(139, 92, 246, 0.2) !important;
  color: var(--text-primary) !important;
}

body.light-mode .alert {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%) !important;
}

body.light-mode .footer {
  background: rgba(241, 245, 249, 0.95) !important;
}

/* Light mode - Scrollbar */
body.light-mode::-webkit-scrollbar-track {
  background: #f1f5f9;
}

/* Theme toggle button */
.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: var(--transition-normal);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--nebula-purple);
}

.theme-toggle i {
  font-size: 20px;
}

/* Hide/show sun/moon icons based on theme */
.theme-toggle .mdi-weather-sunny {
  display: none;
}

body.light-mode .theme-toggle .mdi-weather-sunny {
  display: block;
}

body.light-mode .theme-toggle .mdi-weather-night {
  display: none;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
  background: var(--bg-primary) !important;
  color: var(--text-primary);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Stars Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, var(--star-white), transparent),
    radial-gradient(2px 2px at 40px 70px, var(--star-blue), transparent),
    radial-gradient(1px 1px at 90px 40px, var(--star-white), transparent),
    radial-gradient(2px 2px at 160px 120px, var(--star-yellow), transparent),
    radial-gradient(1px 1px at 230px 80px, var(--star-white), transparent),
    radial-gradient(2px 2px at 300px 160px, var(--star-blue), transparent),
    radial-gradient(1px 1px at 350px 50px, var(--star-white), transparent),
    radial-gradient(2px 2px at 420px 200px, var(--star-white), transparent),
    radial-gradient(1px 1px at 480px 100px, var(--star-yellow), transparent),
    radial-gradient(2px 2px at 550px 180px, var(--star-blue), transparent);
  background-size: 600px 300px;
  animation: twinkle 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -2;
}

/* Nebula Effect */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

@keyframes twinkle {
  0% {
    opacity: 0.6;
  }

  100% {
    opacity: 1;
  }
}

/* ============================================
   PAGE LOADER
   ============================================ */
#galaxy-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--galaxy-void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#galaxy-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Galaxy Spinner */
.galaxy-spinner {
  width: 120px;
  height: 120px;
  position: relative;
}

.galaxy-spinner .orbit {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 50%;
  animation: orbit-spin 3s linear infinite;
}

.galaxy-spinner .orbit:nth-child(1) {
  width: 100%;
  height: 100%;
  border-top-color: var(--nebula-purple);
  animation-duration: 2.5s;
}

.galaxy-spinner .orbit:nth-child(2) {
  width: 75%;
  height: 75%;
  top: 12.5%;
  left: 12.5%;
  border-right-color: var(--nebula-blue);
  animation-duration: 2s;
  animation-direction: reverse;
}

.galaxy-spinner .orbit:nth-child(3) {
  width: 50%;
  height: 50%;
  top: 25%;
  left: 25%;
  border-bottom-color: var(--nebula-cyan);
  animation-duration: 1.5s;
}

.galaxy-spinner .core {
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--gradient-nebula);
  border-radius: 50%;
  box-shadow: 0 0 30px var(--nebula-purple), 0 0 60px var(--nebula-blue);
  animation: core-pulse 2s ease-in-out infinite;
}

@keyframes orbit-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes core-pulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

.loader-text {
  margin-top: 30px;
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
  animation: text-fade 2s ease-in-out infinite;
}

@keyframes text-fade {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container-scroller {
  background: transparent !important;
}

.container-fluid.page-body-wrapper {
  background: transparent !important;
}

.main-panel {
  background: transparent !important;
}

.content-wrapper {
  background: transparent !important;
  padding: 20px;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */
.sidebar {
  background: var(--bg-sidebar) !important;
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.sidebar-brand-wrapper {
  background: rgba(13, 13, 26, 0.9) !important;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
  color: var(--text-primary) !important;
  font-weight: 600;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar .nav-item .nav-link {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-md);
  margin: 4px 12px;
  padding: 12px 16px;
  transition: var(--transition-normal);
}

.sidebar .nav-item .nav-link:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-primary) !important;
  transform: translateX(4px);
}

.sidebar .nav-item.active .nav-link {
  background: var(--gradient-button);
  color: white !important;
  box-shadow: var(--shadow-glow);
}

.sidebar .nav-category {
  margin-top: 16px;
}

.sidebar .nav-category h4 {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--nebula-purple);
  font-weight: 600;
}

/* ============================================
   NAVBAR STYLES
   ============================================ */
.navbar {
  background: var(--bg-navbar) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.navbar-profile-name {
  color: var(--text-primary) !important;
}

.dropdown-menu {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  backdrop-filter: blur(20px);
}

.dropdown-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-md) !important;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(139, 92, 246, 0.15) !important;
  color: var(--text-primary) !important;
}

/* Dropdown Animation */
.dropdown-menu {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  visibility: hidden;
  display: block !important;
}

.dropdown-menu.show,
.dropdown.show .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Dropdown items animation */
.dropdown-menu .dropdown-item {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.dropdown-menu.show .dropdown-item,
.dropdown.show .dropdown-menu .dropdown-item {
  opacity: 1;
  transform: translateX(0);
}

.dropdown-menu.show .dropdown-item:nth-child(1) {
  transition-delay: 0.05s;
}

.dropdown-menu.show .dropdown-item:nth-child(2) {
  transition-delay: 0.1s;
}

.dropdown-menu.show .dropdown-item:nth-child(3) {
  transition-delay: 0.15s;
}

.dropdown-menu.show .dropdown-item:nth-child(4) {
  transition-delay: 0.2s;
}

/* ============================================
   CARD STYLES
   ============================================ */
.card {
  background: var(--gradient-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
  backdrop-filter: blur(10px);
  transition: var(--transition-normal);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow) !important;
  box-shadow: var(--shadow-glow), var(--shadow-card) !important;
}

.card-body {
  background: transparent !important;
}

.card-title {
  color: var(--text-primary) !important;
  font-weight: 600;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.button,
.btn-primary {
  background: var(--gradient-button) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  color: white !important;
  font-weight: 500;
  padding: 12px 32px;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.button::before,
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.button:hover::before,
.btn-primary:hover::before {
  left: 100%;
}

.button:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
}

.btn-danger:hover {
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  color: white !important;
}

/* Button2 (Create Server) */
.button2 {
  background: var(--gradient-card) !important;
  border: 2px dashed var(--border-glow) !important;
  transition: var(--transition-normal);
}

.button2:hover {
  background: rgba(139, 92, 246, 0.1) !important;
  border-color: var(--nebula-purple) !important;
  transform: scale(1.05);
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-control,
select.form-control {
  background: rgba(18, 18, 31, 0.8) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  padding: 12px 16px;
  transition: var(--transition-normal);
}

.form-control:focus {
  border-color: var(--nebula-purple) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2) !important;
  outline: none;
}

.form-control option {
  background: var(--galaxy-dark);
  color: var(--text-primary);
}

label {
  color: var(--text-secondary) !important;
  font-weight: 500;
  margin-bottom: 8px;
}

/* ============================================
   ALERT STYLES
   ============================================ */
.alert {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%) !important;
  border: 1px solid var(--border-glow) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  padding: 16px 20px;
  backdrop-filter: blur(10px);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary) !important;
}

h2 {
  font-weight: 700;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

p,
.text-gray {
  color: var(--text-secondary) !important;
}

code {
  color: var(--nebula-cyan) !important;
  background: rgba(6, 182, 212, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

a {
  color: var(--accent-primary);
  transition: var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

/* ============================================
   FOOTER STYLES
   ============================================ */
.footer {
  background: rgba(13, 13, 26, 0.9) !important;
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.footer .text-muted {
  color: var(--text-secondary) !important;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--galaxy-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--nebula-purple);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--nebula-violet);
}

/* ============================================
   SWEETALERT2 GALAXY THEME
   ============================================ */
.swal2-popup {
  background: linear-gradient(145deg, var(--galaxy-dark) 0%, var(--galaxy-deep) 100%) !important;
  border: 1px solid var(--border-glow) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(139, 92, 246, 0.2) !important;
}

.swal2-title {
  color: var(--text-primary) !important;
  font-weight: 700;
}

.swal2-html-container {
  color: var(--text-secondary) !important;
}

.swal2-confirm {
  background: var(--gradient-button) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 32px !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.swal2-confirm:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4) !important;
}

.swal2-cancel {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 32px !important;
  font-weight: 600 !important;
}

.swal2-cancel:hover {
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4) !important;
}

/* SweetAlert Icons */
.swal2-icon.swal2-success {
  border-color: #22c55e !important;
  color: #22c55e !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(34, 197, 94, 0.3) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
  background-color: #22c55e !important;
}

.swal2-icon.swal2-error {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
  background-color: #ef4444 !important;
}

.swal2-icon.swal2-warning {
  border-color: #f59e0b !important;
  color: #f59e0b !important;
}

.swal2-icon.swal2-info {
  border-color: var(--nebula-cyan) !important;
  color: var(--nebula-cyan) !important;
}

.swal2-icon.swal2-question {
  border-color: var(--nebula-purple) !important;
  color: var(--nebula-purple) !important;
}

/* Timer progress bar */
.swal2-timer-progress-bar {
  background: var(--gradient-nebula) !important;
}

/* Toast notifications */
.swal2-popup.swal2-toast {
  background: var(--galaxy-dark) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

.swal2-popup.swal2-toast .swal2-title {
  font-size: 14px !important;
}

.swal2-popup.swal2-toast .swal2-html-container {
  font-size: 13px !important;
}

/* Backdrop */
.swal2-backdrop-show {
  background: rgba(10, 10, 15, 0.85) !important;
  backdrop-filter: blur(5px);
}

/* Input fields in SweetAlert */
.swal2-input,
.swal2-textarea,
.swal2-select {
  background: rgba(18, 18, 31, 0.8) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
  border-color: var(--nebula-purple) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2) !important;
}

/* Close button */
.swal2-close {
  color: var(--text-muted) !important;
}

.swal2-close:hover {
  color: var(--text-primary) !important;
}

/* Galaxy Toast custom class */
.galaxy-toast {
  padding: 12px 16px !important;
}

/* ============================================
   PAGE TRANSITION ANIMATIONS
   ============================================ */
.content-wrapper {
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: cardFadeIn 0.5s ease-out backwards;
}

.card:nth-child(1) {
  animation-delay: 0.1s;
}

.card:nth-child(2) {
  animation-delay: 0.2s;
}

.card:nth-child(3) {
  animation-delay: 0.3s;
}

.card:nth-child(4) {
  animation-delay: 0.4s;
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ============================================
   404 PAGE
   ============================================ */
.error-page {
  background: transparent !important;
}

.error-page h1 {
  font-size: 120px;
  font-weight: 800;
  background: var(--gradient-nebula);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

/* ============================================
   RESPONSIVE DESIGN - ALL DEVICES
   ============================================ */

/* ---------------------------------------------
   EXTRA LARGE SCREENS (1400px+) - Large Desktops
   --------------------------------------------- */
@media (min-width: 1400px) {
  .content-wrapper {
    padding: 30px 40px;
  }

  .card-body {
    padding: 28px !important;
  }

  h2 {
    font-size: 2rem;
  }
}

/* ---------------------------------------------
   LARGE SCREENS (992px - 1399px) - Desktops/Laptops
   --------------------------------------------- */
@media (min-width: 992px) and (max-width: 1399px) {
  .content-wrapper {
    padding: 24px 30px;
  }

  .card-body {
    padding: 24px !important;
  }
}

/* ---------------------------------------------
   MEDIUM SCREENS (768px - 991px) - Tablets
   --------------------------------------------- */
@media (max-width: 991px) {

  /* Sidebar as overlay on tablet */
  .sidebar {
    background: var(--galaxy-dark) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  }

  .sidebar-brand-wrapper {
    padding: 15px;
  }

  /* Content adjustments */
  .content-wrapper {
    padding: 20px;
  }

  .main-panel {
    width: 100% !important;
  }

  /* Smaller loader on tablet */
  #galaxy-loader .galaxy-spinner {
    width: 80px;
    height: 80px;
  }

  #galaxy-loader .loader-text {
    font-size: 12px;
  }

  /* Cards side by side on tablet */
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Typography scaling */
  h2 {
    font-size: 1.6rem;
  }

  /* Button adjustments */
  .button,
  .btn-primary,
  .btn-lg {
    padding: 10px 24px;
    font-size: 14px;
  }

  /* Form controls */
  .form-control {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Navbar adjustments */
  .navbar-profile-name {
    font-size: 14px;
  }

  /* Dropdown menu */
  .dropdown-menu {
    min-width: 200px;
  }
}

/* ---------------------------------------------
   SMALL SCREENS (576px - 767px) - Large Phones/Small Tablets
   --------------------------------------------- */
@media (max-width: 767px) {

  /* Stack cards vertically */
  .col-md-6,
  .col-lg-4,
  .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Content padding */
  .content-wrapper {
    padding: 16px;
  }

  /* Card adjustments */
  .card {
    margin-bottom: 16px;
  }

  .card-body {
    padding: 20px !important;
  }

  .card:hover {
    transform: none;
    /* Disable hover lift on touch devices */
  }

  /* Typography */
  h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
  }

  .text-gray,
  p {
    font-size: 14px;
  }

  /* Buttons - Full width on mobile */
  .button,
  .btn-primary,
  .btn-danger,
  .btn-warning {
    padding: 12px 20px;
    font-size: 14px;
    width: 100%;
    margin-bottom: 10px;
    display: block;
    text-align: center;
  }

  .btn-lg {
    padding: 12px 20px !important;
    font-size: 14px !important;
  }

  /* Server actions - stack buttons */
  .server-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .server-actions a {
    margin: 0 !important;
  }

  /* Form improvements */
  .form-control {
    font-size: 16px;
    /* Prevents iOS zoom */
    padding: 12px 14px;
  }

  select.form-control {
    font-size: 16px;
  }

  /* Loader smaller */
  #galaxy-loader .galaxy-spinner {
    width: 60px;
    height: 60px;
  }

  .loader-text {
    font-size: 11px;
    letter-spacing: 2px;
  }

  /* Hide nebula effect on smaller screens for performance */
  body::after {
    opacity: 0.5;
  }

  /* Footer adjustments */
  .footer {
    text-align: center;
    padding: 15px;
  }

  .footer .d-sm-flex {
    flex-direction: column;
    gap: 10px;
  }

  /* Navbar compact */
  .navbar {
    padding: 8px 15px !important;
  }

  .navbar-profile img {
    width: 32px !important;
    height: 32px !important;
  }

  /* Alerts */
  .alert {
    padding: 12px 16px;
    font-size: 14px;
  }

  /* 404 page */
  .error-page h1 {
    font-size: 80px;
  }

  .error-page h2 {
    font-size: 1.2rem;
  }

  .error-page h3 {
    font-size: 1rem;
  }

  /* Create server button */
  .button2 {
    padding: 60px 70px !important;
  }

  .button2__text {
    font-size: 48px !important;
  }
}

/* ---------------------------------------------
   EXTRA SMALL SCREENS (< 576px) - Mobile Phones
   --------------------------------------------- */
@media (max-width: 575px) {

  /* Minimal padding */
  .content-wrapper {
    padding: 12px;
  }

  /* Card compact */
  .card {
    border-radius: var(--radius-md) !important;
  }

  .card-body {
    padding: 16px !important;
  }

  /* Typography compact */
  h2 {
    font-size: 1.25rem;
  }

  h4.card-title {
    font-size: 1rem;
  }

  /* Sidebar navigation items */
  .sidebar .nav-item .nav-link {
    padding: 10px 12px;
    margin: 2px 8px;
    font-size: 14px;
  }

  .sidebar .nav-category h4 {
    font-size: 10px;
  }

  /* Icons in cards */
  .mdi {
    font-size: 24px !important;
  }

  .d-flex.align-items-center .mdi {
    margin-right: 8px !important;
  }

  /* Login page */
  .col-lg-4 {
    padding: 0 12px;
  }

  .card.col-lg-4 {
    margin: 0 12px;
  }

  /* Form group spacing */
  .form-group {
    margin-bottom: 12px;
  }

  /* Select dropdowns */
  .row[style*="gap"] {
    flex-direction: column;
  }

  /* Loader even smaller */
  #galaxy-loader .galaxy-spinner {
    width: 50px;
    height: 50px;
  }

  #galaxy-loader .core {
    width: 12px;
    height: 12px;
  }

  .loader-text {
    font-size: 10px;
    margin-top: 20px;
  }

  /* 404 page mobile */
  .error-page h1 {
    font-size: 60px;
  }

  .error-page .col-lg-6 {
    padding: 0 20px;
  }

  /* Create server button smaller */
  .button2 {
    padding: 40px 50px !important;
  }

  .button2__text {
    font-size: 36px !important;
  }

  /* Dropdown menu full width */
  .dropdown-menu {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px);
  }

  /* Profile in navbar */
  .navbar-profile {
    padding: 0;
  }

  .navbar-profile img {
    width: 28px !important;
    height: 28px !important;
  }

  /* Server stats compact */
  .server-stats {
    padding: 12px !important;
  }

  .server-stats p {
    font-size: 13px;
    margin: 2px 0 !important;
  }

  /* Reward info box */
  .reward-info {
    padding: 10px 12px !important;
  }
}

/* ---------------------------------------------
   TOUCH DEVICE OPTIMIZATIONS
   --------------------------------------------- */
@media (hover: none) and (pointer: coarse) {

  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow-card) !important;
  }

  .button:hover,
  .btn-primary:hover {
    transform: none;
  }

  .sidebar .nav-item .nav-link:hover {
    transform: none;
  }

  /* Better touch targets */
  .button,
  .btn-primary,
  .btn-lg {
    min-height: 44px;
  }

  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Active states for touch */
  .button:active,
  .btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
  }

  .card:active {
    transform: scale(0.99);
  }
}

/* ---------------------------------------------
   LANDSCAPE PHONE ORIENTATION
   --------------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  #galaxy-loader {
    flex-direction: row;
    gap: 30px;
  }

  #galaxy-loader .galaxy-spinner {
    width: 60px;
    height: 60px;
  }

  .loader-text {
    margin-top: 0;
  }

  .content-wrapper {
    padding: 10px 20px;
  }
}

/* ---------------------------------------------
   PRINT STYLES
   --------------------------------------------- */
@media print {

  body::before,
  body::after,
  #galaxy-loader,
  .sidebar,
  .navbar {
    display: none !important;
  }

  .main-panel {
    margin: 0 !important;
    width: 100% !important;
  }

  .card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ============================================
   LOADING BAR OVERRIDE
   ============================================ */
.loadingbar .bar {
  background: var(--gradient-nebula) !important;
  box-shadow: 0 0 15px var(--nebula-purple) !important;
}

.nanobar .bar {
  background: var(--gradient-nebula) !important;
}