@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

body {
  background-color: #030712; /* gray-950 */
  color: #f3f4f6; /* gray-100 */
  font-family: 'Outfit', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: rgba(16, 185, 129, 0.3);
}

/* Glass panel */
.glass-panel {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.glass-input {
  background-color: rgba(31, 41, 55, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: #ffffff;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.glass-input:focus {
  outline: none;
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2), inset 0 2px 4px rgba(0,0,0,0.2);
  background-color: rgba(31, 41, 55, 0.6);
}

.glass-input::placeholder {
  color: #9ca3af;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-20deg);
  transition: 0.5s;
}
.btn-primary:hover:not(:disabled)::after {
  left: 150%;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.btn-secondary {
  background: rgba(31, 41, 55, 0.6);
  backdrop-filter: blur(10px);
  color: #e5e7eb;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn-secondary:hover {
  background: rgba(55, 65, 81, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2) 0%, rgba(159, 18, 57, 0.3) 100%);
  color: #fda4af;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(244, 63, 94, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-danger:hover {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.3) 0%, rgba(159, 18, 57, 0.5) 100%);
  border-color: rgba(244, 63, 94, 0.5);
  transform: translateY(-1px);
}

/* ── Animated gradients ── */
.bg-gradient-animated {
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(16, 185, 129, 0.12), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(56, 189, 248, 0.08), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(139, 92, 246, 0.1), transparent 40%);
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  animation: bg-pulse 10s ease-in-out infinite alternate;
}
@keyframes bg-pulse {
  0% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.05) translateY(-2%); }
  100% { transform: scale(1) translateY(0); }
}

/* Skeleton Loading */
.skeleton {
  background-color: rgba(31, 41, 55, 0.5);
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
}
.skeleton::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0.05) 20%,
      rgba(255, 255, 255, 0.1) 60%,
      rgba(255, 255, 255, 0));
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: 0.75rem;
  background: rgba(17, 24, 39, 0.4);
  border: 1px solid rgba(255,255,255,0.05);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  background: rgba(0,0,0,0.2);
}
td {
  padding: 1.25rem;
  color: #e5e7eb;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  transition: background-color 0.2s;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  position: relative;
}
.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 10px #10b981, inset 0 0 4px rgba(255,255,255,0.5);
}
.status-dot.online::after {
  content: ''; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%; border: 1px solid rgba(16, 185, 129, 0.5);
  animation: pulse-ring 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}
.status-dot.offline {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e, inset 0 0 4px rgba(255,255,255,0.5);
}
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/* Custom Toggle */
.custom-toggle {
  display: flex;
  background-color: rgba(17, 24, 39, 0.6);
  border-radius: 1rem;
  padding: 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}
.toggle-option {
  flex: 1;
  text-align: center;
  padding: 0.625rem 0;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: #9ca3af;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.toggle-option:hover:not(.active) {
  color: #f3f4f6;
  background-color: rgba(255, 255, 255, 0.05);
}
.toggle-option.active {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
.toggle-option.active[data-value="false"] {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.preset-chip {
  background: rgba(31, 41, 55, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.preset-chip:hover {
  background: rgba(55, 65, 81, 0.6);
  color: #f3f4f6;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.preset-chip.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
  transform: scale(1.02);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(17, 24, 39, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.8);
}

/* Utils */
.glass-nav {
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.stagger-show {
  opacity: 0;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}