/* -----------------------------
   Base Styles
----------------------------- */
:root {
  --primary-gradient: linear-gradient(135deg, #ad6331, #8b423b);
  --primary-hover-gradient: linear-gradient(135deg, #ad6331, #c3594f);
  --secondary-gradient: linear-gradient(135deg, #6c757d, #343a40);
  --secondary-hover-gradient: linear-gradient(135deg, #343a40, #212529);
  --background-gradient: linear-gradient(135deg, #1e1e2f, #343a40);
  --card-bg: rgba(33, 37, 41, 0.9);
  --accent-color: #f0b469;
  --text-color: #fff;
  --box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
  overflow-y: scroll !important;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  font-family: "Roboto", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--text-color);
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--background-gradient);
  background-size: cover;
}

body.no-scroll {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* -----------------------------
   Layout Components
----------------------------- */
.main-content {
  flex: 1;
  opacity: 1;
  transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 1.5rem 0;
}

.main-content.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

.main-content.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.section {
  margin-bottom: 2.5rem;
}

/* -----------------------------
   Navigation
----------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 3000;
  background: radial-gradient(circle at top, #32373d, #272b30);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-top: 2px solid rgba(74, 144, 226, 0.2);
  animation: fadeInNav 0.6s ease-in;
}

@keyframes fadeInNav {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.nav-link:hover .nav-icon {
  transform: translateY(-2px);
}

.grayscale {
  filter: grayscale(100%) !important;
}

.navbar .nav-link {
  padding: 1rem !important;
  padding-right: 1.3rem !important;
  padding-left: 1.3rem !important;
  border-radius: 4px !important;
  margin-right: 4px;
  border-left: 0px !important;
  -webkit-user-drag: none;
}

.navbar .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.navbar .nav-link.active {
  background-color: rgba(240, 180, 105, 0.1);
  border-bottom: 2px solid var(--accent-color);
}

/* -----------------------------
   Buttons
----------------------------- */
.btn {
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 16px;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-color);
  border: none;
  box-shadow: 0 8px 20px rgba(173, 99, 49, 0.36);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  background: var(--primary-hover-gradient) !important;
  box-shadow: 0 8px 25px rgba(246, 147, 81, 0.5);
}

.btn-secondary,
.btn-warning {
  background: var(--secondary-gradient);
  color: var(--text-color);
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  background: var(--secondary-hover-gradient) !important;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* Button Focus States */
.btn:focus,
.btn:active {
  outline: none;
  box-shadow: 0 0 0 3px rgba(240, 180, 105, 0.3);
}

/* Button Loading State */
.btn.loading {
  position: relative;
  color: transparent !important;
}

.btn.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: button-loading-spinner 0.8s linear infinite;
}

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }
  to {
    transform: rotate(1turn);
  }
}

/* Contextual Buttons */
.btn-success {
  background: linear-gradient(135deg, #28a745, #218838);
  color: var(--text-color);
  border: none;
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #28a745, #30d05c) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(40, 167, 69, 0.4);
}

/* -----------------------------
   Cards & Images
----------------------------- */
.card {
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 15px;
  transition: var(--transition);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.card-hover:hover {
  transform: translateY(-5px);
  transition: var(--transition);
  cursor: pointer;
}

.featured-item {
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
}

.card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 1.5rem;
}

.card-height-control {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 390px;
}

.card-height-control-title {
  font-size: 1.25rem;
  min-height: 40px;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--accent-color);
}

.card-height-control-text {
  flex-grow: 1;
  min-height: 60px;
  max-height: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.6;
}

/* Image Wrappers */
.image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #151515;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.featured-banner .image-wrapper {
  background: #151515;
  padding-top: 0;
  height: 200px;
}

.featured-banner {
  background: #151515 !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
}

.image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-in-out, transform 0.5s ease;
}

.image-wrapper:hover img {
  transform: scale(1.05);
}

.shop-image-wrapper {
  background: #151515 !important;
  border-radius: 6px !important;
  position: relative;
  padding-top: 100%;
  width: 100%;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.shop-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease-in-out, transform 0.3s ease;
}

.shop-image-wrapper:hover img {
  transform: scale(1.05);
}

.shopimage {
  background: #151515;
  pointer-events: none !important;
}

.shop-button {
  font-size: 14px;
  padding-left: 8px;
  padding-right: 8px;
  margin-top: auto;
}

.featured-image-wrapper,
.news-image-wrapper {
  background: #151515 !important;
  border-radius: 6px !important;
  position: relative;
  width: 100%;
  height: 200px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.featured-image-wrapper img,
.news-image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200px !important;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease-in-out, transform 0.3s ease;
}

.featured-image-wrapper:hover img,
.news-image-wrapper:hover img {
  transform: scale(1.05);
}

.newscard {
  cursor: pointer;
}

/* Image Loading States */
.lazyload {
  opacity: 0;
}

.lazyloaded,
.image-wrapper img.loaded,
.shop-image-wrapper img.loaded {
  opacity: 1 !important;
}

/* Image Loading Animation */
.image-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #1a1a1a, #2a2a2a, #1a1a1a);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

/* -----------------------------
   Modal Styles
----------------------------- */
.modal-dialog {
  max-width: 800px;
  margin: 30px auto;
}

.modal-content {
  border-radius: 15px;
  overflow: hidden;
  background-color: #1e1e2f;
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.modal-header,
.modal-footer {
  background-color: #343a40;
  border: none;
  padding: 1.25rem 1.5rem;
}

.modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  color: var(--accent-color);
  font-weight: 600;
}

.modal-header .btn-close {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.modal-header .btn-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
  font-size: 1rem;
}

.modal-body img {
  max-height: 300px;
  object-fit: contain;
  background: #343a40;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-body h2 {
  font-size: 1.8rem;
  color: var(--accent-color);
  margin-bottom: 1rem;
}

.modal-body h4 {
  font-size: 1.4rem;
  color: #f8f9fa;
  margin-top: 1.5rem;
}

/* -----------------------------
   Form Controls & Inputs
----------------------------- */
.form-control,
.form-select {
  background-color: #1e1e2f;
  color: var(--text-color) !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 12px;
  transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
  background-color: #1e1e2f;
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(240, 180, 105, 0.5);
}

/* Placeholders */
.form-control::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Toggle Switch */
.form-check-input {
  background-color: #343a40;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 25px;
  border-radius: 15px;
  cursor: pointer;
  transition: var(--transition);
}

.form-check-input:checked {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Toggle Switch Animation */
.form-check-input:checked::before {
  transform: translateX(25px);
}

@keyframes fadeInMessage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.sent {
  background-color: #ad6331;
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  margin-left: auto;
}

.chat-message.received {
  background-color: #343a40;
  color: white;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  margin-right: auto;
}

.chat-timestamp {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 5px;
  text-align: right;
}

.skeleton {
  background: rgba(24, 26, 29, 0.9);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0) 100%
  );  
  animation: skeleton-loading 2s ease-in-out infinite;
}

/* -----------------------------
   Footer
----------------------------- */
.footer {
  margin-top: auto;
  background-color: #1d2024;
  color: #ffffff;
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-copyright {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* -----------------------------
   Animations
----------------------------- */
@keyframes loading {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes skeleton-loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}


@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 180, 105, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(240, 180, 105, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(240, 180, 105, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* -----------------------------
   Settings Page Styling
----------------------------- */
.settings-card {
  background: rgba(33, 37, 41, 0.9);
  color: var(--text-color);
  border-radius: 15px;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.settings-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.settings-card h3 {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.75rem;
}

.theme-options {
  display: flex;
  gap: 15px;
  margin-bottom: 1.5rem;
}

.theme-option {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.theme-option:hover {
  transform: scale(1.15);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.theme-light {
  background: #f0f0f0;
}

.theme-dark {
  background: #343a40;
}

.theme-blue {
  background: linear-gradient(135deg, #007bff, #0056b3);
}

.theme-option.active {
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}

.price-icon {
  width: 20px;
  height: 20px;
}

/* Badge Styles */
.badge {
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px; /* More rounded badge edges */
  padding: 5px 10px;
}

.badge.bg-warning {
  background-color: #f39c12 !important; /* More muted and professional yellow */
  color: #fff;
}

.badge.bg-info {
  background-color: #1abc9c !important; /* Slightly different blue for better contrast */
  color: #fff;
}

/* Notification Toggle Switch */
.serverOfflineNotification {
  background: linear-gradient(45deg, #efb353, #f9d060, #f69051, #efb353);
  background-size: 400% 400%;
  animation: notificationAnimation 30s ease infinite;
  color: #000 !important;
  font-weight: 100;
  border-bottom: 2px solid #3a3a3a;
}

@keyframes notificationAnimation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.form-check-input {
  background-color: #34495e;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px; /* Soft, rounded edges */
}

.form-check-input:checked {
  background-color: #f39c12;
  border-color: #f39c12;
}

/* Button Styles */
.btn-secondary {
  background: linear-gradient(135deg, #7f8c8d, #34495e);
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 20px;
  transition: all 0.3s ease-in-out;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #34495e, #2c3e50);
  transform: translateY(-2px); /* Hover effect for raised button */
}

.noselect {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Old versions of Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
  -webkit-user-drag: none !important; /* Prevent image dragging in WebKit browsers */
}

#returnToTopBtn {
  position: fixed !important;
  bottom: 50px !important; /* Adjust to ensure it's inside the viewport */
  left: 20px !important;
  background-color: red !important; /* Highlight the button */
  width: 40px; /* Set a visible size */
  display: block !important;
  height: 40px;
  z-index: 9999 !important; /* Bring it to the front */
  transition: opacity 0.3s ease-in-out;
}

#returnToTopBtn.hidden {
  display: none !important; /* Hides the button */
}

#returnToTopBtn:hover {
  background-color: #0056b3; /* Darker shade on hover */
}

.lessOpacity {
  opacity: 0.5;
}

.siteAlert {
  position: sticky;
  top: 0;
  z-index: 800; /* Ensures it stays above other elements */
}

.siteAlertDark {
  background-color: #14191e;
  border-radius: 0px;
}

#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Currency Display */
.currency-display-container {
  background: linear-gradient(90deg, #282c34, #3a3f4b);
  border: 2px solid #555a64;
  border-radius: 10px;
  padding: 15px 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  max-width: 600px;
  margin: 0 auto;
}

.currency-display {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.currency-item {
  display: flex;
  align-items: center;
  color: #ffffff;
  font-weight: bold;
}

.currency-icon {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}

.currency-icon-small {
  width: 25px;
  height: 25px;
  margin-right: 5px;
}

.currency-text {
  font-size: 1.75rem;
  color: #ffc107 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.currency-text-small {
  color: #ffc107 !important;
  font-size: 1rem;
}

.notification-container {
  display: flex;
  justify-content: center;
  margin: 10px 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

.notification-bar {
  display: flex;
  align-items: center;
  background-color: #1d1e1f;
  color: #f8f8f8;
  border-left: 4px solid #0d6efd;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  padding: 16px 20px;
  max-width: 100%;
  width: auto;
  transition: all 0.3s ease;
}

.notification-icon {
  margin-right: 14px;
  flex-shrink: 0;
}

.notification-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.notification-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 4px 0;
  color: #f8f8f8;
}

.notification-message {
  font-size: 14px;
  color: #f8f8f8;
  margin: 0;
}

@media (max-width: 576px) {
  .notification-bar {
    padding: 12px 16px;
  }

  .notification-icon {
    margin-right: 10px;
  }
}

/* Headers and Titles */
.header-container {
  width: 100%;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin: 2.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--hover-color);
}

/* Stats Components */
.stats-container {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  margin: 0 auto;
  padding: 1.5rem;
  background-color: var(--background-dark);
  color: var(--text-primary);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.stats-tab {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  color: var(--text-secondary);
  background-color: var(--card-bg);
}

.stats-tab.active {
  background-color: var(--button-primary);
  color: var(--text-dark);
}

.stats-tab:hover:not(.active) {
  background-color: var(--table-header-bg);
  color: var(--text-primary);
}

.stats-table-wrapper {
  overflow-x: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
}

.stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.925rem;
  color: var(--text-primary);
}

.stats-table th {
  background-color: var(--table-header-bg);
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.stats-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table tbody tr:nth-child(even) {
  background-color: rgba(42, 46, 52, 0.3);
}

.stats-table tbody tr:hover {
  background-color: var(--table-row-hover);
}

.stats-page-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding: 0 0.5rem;
}

.stats-pagination {
  display: flex;
  gap: 0.5rem;
}

.page-button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background-color: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-button.active {
  background-color: var(--button-primary);
  border-color: var(--button-primary);
  color: var(--text-dark);
}

.page-button:hover:not(.active) {
  background-color: var(--table-header-bg);
  border-color: var(--hover-color);
}

.stats-search {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-search input {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 24rem;
  background-color: var(--card-bg);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.stats-search input:focus {
  border-color: var(--button-primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.stats-search-button {
  padding: 0.75rem 1.25rem;
  background-color: var(--button-primary);
  color: var(--text-dark);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stats-search-button:hover {
  background-color: var(--button-hover);
}

.stats-table-container {
  display: none;
}

.stats-table-container.active {
  display: block;
}

.sort-icon {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.sort-asc {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid currentColor;
}

.sort-desc {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
}

/* Media Queries */
@media (max-width: 1024px) {
  .section-header {
    font-size: 1.5rem;
    margin: 2rem 0;
  }
}

@media (max-width: 768px) {
  .stats-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .stats-tab {
    white-space: nowrap;
    flex: 0 0 auto;
    padding: 0.625rem 1rem;
  }

  .stats-search {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-search input {
    max-width: 100%;
  }

  .stats-table th,
  .stats-table td {
    padding: 0.75rem 1rem;
  }

  .stats-page-controls {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .card {
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  .section-header {
    font-size: 1.25rem;
    margin: 1.5rem 0;
  }

  .stats-container {
    padding: 1rem;
  }

  .page-button {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Enhanced Leaderboard Styles - Compatible with Existing HTML */
/* These styles enhance your existing stats-container for leaderboard usage */
.stats-container.leaderboard {
  position: relative;
  padding-top: 2rem;
}

/* Enhanced table appearance */
.stats-table-wrapper {
  transition: box-shadow 0.3s ease;
}

.stats-table-wrapper:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* Rank styling for first three rows */
.stats-table tbody tr:nth-child(1) td:first-child {
  font-weight: 700;
  color: #ffc107; /* Gold */
  position: relative;
}

.stats-table tbody tr:nth-child(2) td:first-child {
  font-weight: 700;
  color: #b0bec5; /* Silver */
  position: relative;
}

.stats-table tbody tr:nth-child(3) td:first-child {
  font-weight: 700;
  color: #cd7f32; /* Bronze */
  position: relative;
}

/* Row animation on hover */
.stats-table tbody tr {
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.stats-table tbody tr:hover {
  transform: translateY(-2px);
  z-index: 5;
}

/* Highlighted row for current user */
.stats-table tr.current-user {
  background-color: rgba(59, 130, 246, 0.15) !important;
  border-left: 3px solid var(--button-primary);
}

.stats-table tr.current-user td:first-child {
  position: relative;
}

.stats-table tr.current-user td:first-child::before {
  content: '•';
  position: absolute;
  left: -12px;
  color: var(--button-primary);
  font-size: 1.5rem;
}

/* Enhanced tabs with subtle indicator */
.stats-tab {
  position: relative;
  overflow: hidden;
}

.stats-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background-color: var(--button-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: 3px 3px 0 0;
}

.stats-tab.active::after,
.stats-tab:hover::after {
  width: 80%;
}

/* Improved pagination buttons */
.page-button {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.page-button.active {
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.page-button:hover:not(.active) {
  transform: translateY(-2px);
}

/* Improved header cells */
.stats-table th {
  position: relative;
  transition: background-color 0.2s ease;
}

.stats-table th.sortable {
  cursor: pointer;
  padding-right: 1.75rem;
}

.stats-table th.sortable:hover {
  background-color: var(--hover-color);
}

.sort-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.2s ease;
}

th:not(:hover) .sort-icon:not(.active) {
  opacity: 0.5;
}

/* Number value formatting */
.stats-table td.numeric {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-positive {
  background-color: #10b981;
}

.status-neutral {
  background-color: #94a3b8;
}

.status-negative {
  background-color: #ef4444;
}

/* Search field enhancements */
.stats-search input {
  transition: all 0.3s ease;
}

.stats-search input:focus {
  transform: translateY(-2px);
}

.stats-search-button {
  position: relative;
  overflow: hidden;
}

.stats-search-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.3s ease-out;
}

.stats-search-button:active::after {
  transform: translate(-50%, -50%) scale(2);
}
