:root {
  --bg-darker: #0a0e14;
  --bg-dark: #0f1419;
  --bg-card: #151a21;
  --border-color: #21262d;
  --border-hover: #30363d;
  --text-primary: #e6edf3;
  --text-muted: #8b949e;
  --text-subtle: #6e7681;
  --accent-blue: #58a6ff;
  --accent-purple: #bc8cff;
  --accent-green: #56d364;
  --accent-red: #f85149;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --gradient-accent: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) var(--bg-darker);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

*::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

body {
  background: var(--bg-dark) !important;
  color: var(--text-primary) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: radial-gradient(ellipse at top, rgba(88, 166, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.bg-darker {
  background-color: var(--bg-darker) !important;
}

/* Cards with glassmorphism effect */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* box-shadow: var(--shadow-sm); */
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  /* box-shadow: var(--shadow-md); */
  border-color: var(--border-hover);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  font-weight: 600;
  padding: 1.25rem 1.5rem !important;
}

.card-body {
  padding: 1.5rem !important;
}

/* Modern Table */
.table-dark {
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-color);
  color: var(--text-primary) !important;
  border-radius: 8px;
  overflow: hidden;
}

.table-dark thead {
  background: var(--bg-darker);
  border-bottom: 2px solid var(--border-hover);
}

.table-dark thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 1rem;
  border: none !important;
}

.table-dark tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.table-dark tbody tr:hover {
  background: rgba(88, 166, 255, 0.05) !important;
  transform: scale(1.01);
}

.table-dark tbody td {
  padding: 1rem;
  vertical-align: middle;
  border: none !important;
}

/* Modern Badges */
.badge {
  padding: 0.4em 0.8em;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.badge-success {
  background: rgba(86, 211, 100, 0.15) !important;
  color: var(--accent-green) !important;
  border-color: rgba(86, 211, 100, 0.3);
}

.badge-danger {
  background: rgba(248, 81, 73, 0.15) !important;
  color: var(--accent-red) !important;
  border-color: rgba(248, 81, 73, 0.3);
}

.badge-warning {
  background: rgba(187, 128, 9, 0.15) !important;
  color: #d29922 !important;
  border-color: rgba(187, 128, 9, 0.3);
}

.badge-info {
  background: rgba(88, 166, 255, 0.15) !important;
  color: var(--accent-blue) !important;
  border-color: rgba(88, 166, 255, 0.3);
}

.badge:hover {
  transform: scale(1.05);
}

/* Brand Logo */
.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Modern Navbar */
.navbar {
  background: rgba(15, 20, 25, 0.8) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  /* box-shadow: var(--shadow-sm); */
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Modern Modal */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  /* box-shadow: var(--shadow-lg); */
  backdrop-filter: blur(16px);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem;
  background: var(--bg-darker);
  border-radius: 16px 16px 0 0;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  background: var(--bg-darker);
  border-radius: 0 0 16px 16px;
}

/* Modern Form Controls */
.form-control,
.form-select {
  background: var(--bg-darker) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  background: var(--bg-card) !important;
  border-color: var(--accent-blue) !important;
  /* box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15) !important; */
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: var(--text-subtle);
}

.form-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Modern Buttons */
.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  /* box-shadow: var(--shadow-md); */
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient-accent) !important;
  /* box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3); */
}

.btn-primary:hover {
  /* box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4); */
}

.btn-success {
  background: linear-gradient(135deg, #3fb950 0%, #56d364 100%) !important;
  /* box-shadow: 0 4px 12px rgba(86, 211, 100, 0.3); */
}

.btn-danger {
  background: linear-gradient(135deg, #da3633 0%, #f85149 100%) !important;
  /* box-shadow: 0 4px 12px rgba(248, 81, 73, 0.3); */
}

.btn-outline-primary {
  border: 2px solid var(--accent-blue) !important;
  color: var(--accent-blue) !important;
  background: transparent !important;
}

.btn-outline-primary:hover {
  background: var(--accent-blue) !important;
  color: white !important;
}

/* Modern Pagination */
.pagination {
  --bs-pagination-bg: var(--bg-card);
  --bs-pagination-border-color: var(--border-color);
  --bs-pagination-hover-bg: var(--bg-darker);
  --bs-pagination-hover-border-color: var(--border-hover);
  /* --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15); */
  --bs-pagination-active-bg: var(--accent-blue);
  --bs-pagination-active-border-color: var(--accent-blue);
  gap: 0.5rem;
}

.page-link {
  border-radius: 8px !important;
  font-weight: 600;
  transition: all 0.2s ease;
  color: var(--text-primary) !important;
}

.page-link:hover {
  transform: translateY(-2px);
  /* box-shadow: var(--shadow-sm); */
}

.page-item.active .page-link {
  background: var(--gradient-accent) !important;
  border-color: transparent !important;
}

/* Alert Modern */
.alert {
  border-radius: 12px;
  border: 1px solid;
  backdrop-filter: blur(8px);
  padding: 1rem 1.25rem;
}

.alert-success {
  background: rgba(86, 211, 100, 0.1);
  border-color: rgba(86, 211, 100, 0.3);
  color: var(--accent-green);
}

.alert-danger {
  background: rgba(248, 81, 73, 0.1);
  border-color: rgba(248, 81, 73, 0.3);
  color: var(--accent-red);
}

.alert-info {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.3);
  color: var(--accent-blue);
}

/* Loading Animation */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: rgba(88, 166, 255, 0.3);
  color: var(--text-primary);
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
