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

:root {
  --page-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-hover: #f1f5f9;
  --border: rgba(0, 0, 0, 0.06);
  --text: #0f172a;
  --text-muted: #64748b;
  --text-secondary: #475569;
  --primary: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --surface: #ffffff;
}

body.dark,
body[data-theme="dark"] {
  --page-bg: #0a0e1a;
  --card-bg: #111827;
  --card-hover: #1a2332;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --text-secondary: #cbd5e1;
  --surface: #111827;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
  min-width: 320px;
  overflow-x: hidden;
}

/* NAVBAR */
.navbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
}

.navbar-container {
  width: 100%;
  max-width: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 100%;
}

.navbar-brand {
  font-size: 1.125rem;
  font-weight: 800;
  flex-shrink: 0;
}

.navbar-brand a {
  background: linear-gradient(135deg, #3b82f6, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.nav-right-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link,
.dropdown-toggle {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.8125rem;
  transition: all 0.2s;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link:hover,
.dropdown-toggle:hover,
.nav-link.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.dropdown {
  position: relative;
}

.dropdown-arrow {
  font-size: 0.625rem;
  transition: transform 0.2s;
}

.dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.15);
  min-width: 13.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.625rem);
  transition: all 0.2s;
  z-index: 200;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 0.625rem 1rem;
  color: var(--text);
  text-decoration: none;
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s;
  border-bottom: 1px solid var(--border);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: var(--card-hover);
  color: var(--primary);
  padding-left: 1.125rem;
}

/* WebSocket Button */
.button.reset_restart_websocket {
  position: relative;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.button.reset_restart_websocket:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.button.reset_restart_websocket:active {
  transform: translateY(0);
}

.signal-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
  animation: pulse 2s infinite;
}

.signal-indicator.red-signal {
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.signal-indicator.green-signal {
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.button.reset_restart_websocket.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 1rem;
  transition: all 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  border-radius: 0.5rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 1.125rem;
  transition: all 0.2s;
  color: var(--text);
}

/* MOBILE DROPDOWN */
.mobile-dropdown {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.mobile-dropdown.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 3.75rem;
}

.mobile-dropdown-content {
  background: var(--card-bg);
  border-radius: 1rem;
  width: calc(100% - 2rem);
  max-width: 25rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  box-shadow: 0 1.25rem 3.75rem rgba(0, 0, 0, 0.4);
}

.mobile-dropdown-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 1;
}

.mobile-dropdown-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.mobile-close-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--card-hover);
  border: none;
  color: var(--text);
  font-size: 1.25rem;
}

.mobile-dropdown-section {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.mobile-dropdown-section:last-child {
  border-bottom: none;
}

.mobile-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.mobile-nav-link {
  padding: 0.75rem 1rem;
  color: var(--text);
  text-decoration: none;
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.15s;
  margin-bottom: 0.25rem;
}

.mobile-nav-link:hover {
  background: var(--card-hover);
  color: var(--primary);
}

/* PAGE CONTENT */
.page-content {
  width: 100%;
  max-width: 100%;
  padding: 1rem;
  min-height: calc(100vh - 60px);
}

/* RESPONSIVE */
@media (max-width: 63.9375rem) {
  .desktop-nav {
    display: none !important;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
}

@media (max-width: 47.9375rem) {
  html {
    font-size: 14px;
  }
  
  .navbar-brand {
    font-size: 1rem;
  }
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 0.375rem;
  height: 0.375rem;
}

::-webkit-scrollbar-track {
  background: var(--card-hover);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 0.1875rem;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.desktop-nav .dropdown:last-child .dropdown-menu {
  left: auto !important;
  right: 0 !important;
}
.reset_restart_websocket {
    visibility: hidden;
}

.ws-wrapper {
  width: 0;  
  overflow: hidden;
  display: flex;
  align-items: center;
}

