/* ==========================================
   AetherMQTT Core Style & Design System
   ========================================== */

:root {
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  /* Color Palette */
  --bg-primary: #090e1a;
  --bg-secondary: rgba(18, 28, 54, 0.8);
  --bg-sidebar: #0b132b;
  --bg-card: rgba(20, 32, 66, 0.6);
  --bg-input: rgba(28, 43, 84, 0.5);
  
  --border-color: rgba(250, 204, 21, 0.12);
  --border-focus: rgba(250, 204, 21, 0.6);
  
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Accents */
  --color-primary: #2563eb; /* Royal Blue */
  --color-primary-hover: #1d4ed8;
  --color-secondary: #facc15; /* Gold Yellow */
  --color-success: #10b981; /* Emerald Green */
  --color-warning: #f97316; /* Orange */
  --color-danger: #ef4444; /* Red */
  
  /* Visual Effects */
  --glow-1: rgba(37, 99, 235, 0.15);
  --glow-2: rgba(250, 204, 21, 0.12);
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Background glows */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.8;
}

.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -100px;
  background-color: var(--glow-1);
}

.glow-2 {
  width: 400px;
  height: 400px;
  bottom: 100px;
  left: -100px;
  background-color: var(--glow-2);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes pulseGreen {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes slideInUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Utility Helpers */
.hidden {
  display: none !important;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted) !important; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.btn-full { width: 100%; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
  background-color: var(--bg-input);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: rgba(30, 41, 73, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: var(--color-danger);
  color: #fff;
}

.btn-transparent {
  background: transparent;
  color: var(--text-secondary);
}

.btn-transparent:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group-row {
  display: flex;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  padding-left: 2.5rem !important;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  font-family: var(--font-family);
  font-size: 0.875rem;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.625rem 1rem;
  transition: all var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--color-primary);
  background-color: rgba(30, 41, 73, 0.8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-transform: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

.align-center-checkbox {
  display: flex;
  align-items: center;
  padding-top: 1rem;
}

/* Error / Alert Boxes */
.error-msg, .alert-msg {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.error-msg {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-msg.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-msg.error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================
   Login Wrapper
   ========================================== */

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: radial-gradient(circle at center, rgba(11, 19, 43, 0.8), var(--bg-primary));
  animation: fadeIn 0.4s var(--transition-normal);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  animation: slideInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  font-size: 1.75rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.login-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.login-header p {
  font-size: 0.875rem;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================
   Main Application Layout
   ========================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
  animation: fadeIn 0.4s var(--transition-normal);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text h2 {
  font-size: 1.125rem;
  color: #ffffff;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  flex-grow: 1;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  color: #0b132b;
  background: var(--color-secondary);
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.25);
  padding-left: 1rem;
}

.nav-link i {
  font-size: 1.125rem;
  width: 20px;
  text-align: center;
}

.sidebar-user {
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, 0.15);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-secondary);
  color: var(--color-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info h4 {
  font-size: 0.875rem;
}

.online-indicator {
  font-size: 0.75rem;
  color: var(--color-success);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pulse {
  width: 6px;
  height: 6px;
  background-color: var(--color-success);
  border-radius: 50%;
  display: inline-block;
  animation: pulseGreen 1.8s infinite;
}

.btn-logout-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.btn-logout-icon:hover {
  color: var(--color-danger);
  background-color: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.top-bar {
  padding: 2rem 2.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.page-title p {
  font-size: 0.875rem;
}

.connection-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-success);
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.75rem;
}

.pulse-green {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  animation: pulseGreen 1.5s infinite;
}

/* Tab Panels */
.tab-panel {
  display: none;
  padding: 2rem 2.5rem;
  flex-grow: 1;
  animation: fadeIn 0.3s var(--transition-normal);
}

.tab-panel.active {
  display: block;
}

/* ==========================================
   Dashboard Tab View
   ========================================== */

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  backdrop-filter: blur(8px);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.icon-blue { background-color: rgba(37, 99, 235, 0.1); color: var(--color-primary); }
.icon-purple { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.icon-cyan { background-color: rgba(250, 204, 21, 0.1); color: var(--color-secondary); }
.icon-orange { background-color: rgba(249, 115, 22, 0.1); color: var(--color-warning); }

.stat-info h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.stat-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
}

.stat-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Panel Sections & Tables */
.panel-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.panel-header h3 {
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-header h3 i {
  color: var(--color-primary);
}

/* General Tables */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

th, td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

tbody tr {
  background-color: transparent;
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

.code-text {
  font-family: monospace;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================
   Credentials Tab View
   ========================================== */

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.search-box {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  padding-left: 2.5rem;
  background-color: var(--bg-card);
}

/* Connection strings copy utility */
.copy-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon-only {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon-only:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon-only.btn-delete:hover {
  color: white;
  background-color: var(--color-danger);
  border-color: var(--color-danger);
}

/* ==========================================
   Web Tester Tab View
   ========================================== */

.tester-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.tester-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tester-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.tester-card h3 {
  font-size: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.tester-card h3 i {
  color: var(--color-secondary);
}

.active-subs-container {
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.active-subs-container h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.active-subs-container ul {
  list-style: none;
}

.active-subs-container li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: monospace;
  margin-bottom: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.active-subs-container li button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
}

.active-subs-container li button:hover {
  color: var(--color-danger);
}

.no-subs {
  color: var(--text-muted) !important;
  background: transparent !important;
  border: none !important;
  font-family: var(--font-family) !important;
  padding: 0 !important;
}

/* Console logs Panel */
.tester-log-console {
  background-color: #050811;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  height: 640px;
  box-shadow: var(--shadow-sm);
}

.console-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.console-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.console-header h3 i {
  color: var(--color-success);
}

.console-body {
  padding: 1.5rem;
  flex-grow: 1;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', Courier, monospace;
  font-size: 0.825rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.log-entry {
  padding: 0.625rem 0.875rem;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--text-muted);
  animation: fadeIn 0.15s ease-out;
}

.log-entry.system-log {
  border-left-color: var(--color-primary);
  color: var(--text-secondary);
}

.log-entry.connect-log {
  border-left-color: var(--color-success);
  color: var(--color-success);
  background-color: rgba(16, 185, 129, 0.04);
}

.log-entry.disconnect-log {
  border-left-color: var(--color-danger);
  color: var(--color-danger);
  background-color: rgba(239, 68, 68, 0.04);
}

.log-entry.publish-log {
  border-left-color: var(--color-warning);
  background-color: rgba(245, 158, 11, 0.02);
}

.log-entry.receive-log {
  border-left-color: var(--color-secondary);
  background-color: rgba(6, 182, 212, 0.04);
}

.log-time {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.log-topic {
  font-weight: 700;
  color: var(--color-secondary);
}

.log-payload {
  white-space: pre-wrap;
  margin-top: 0.25rem;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.45);
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

/* ==========================================
   Settings Tab View
   ========================================== */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.settings-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.section-desc {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

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

.info-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.info-value {
  font-size: 0.875rem;
  font-weight: 600;
}

.broker-ports-card {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
}

.broker-ports-card h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.port-listener {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.port-tag {
  background-color: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.port-desc {
  font-size: 0.825rem;
}

/* ==========================================
   Modals
   ========================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 8, 17, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-header h3 i {
  color: var(--color-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.btn-close-modal:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Credentials Result Box inside modal */
.credentials-result-box {
  animation: fadeIn 0.3s ease-out;
}

.success-banner {
  text-align: center;
  margin-bottom: 1.5rem;
}

.success-banner i {
  font-size: 3rem;
  color: var(--color-success);
  margin-bottom: 0.5rem;
}

.success-banner h4 {
  font-size: 1.25rem;
}

.credentials-result-box p {
  font-size: 0.825rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.credential-item {
  margin-bottom: 1rem;
}

.cred-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.25rem;
}

.cred-value-container {
  display: flex;
  gap: 0.5rem;
}

.cred-value-container input {
  font-family: monospace;
  font-size: 0.875rem;
  background-color: rgba(0, 0, 0, 0.3);
}

.btn-copy {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Responsive Design */
@media (max-width: 900px) {
  .tester-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-brand {
    padding: 1.25rem;
  }
  
  .sidebar-nav {
    padding: 0.75rem;
  }
  
  .sidebar-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .sidebar-nav li {
    margin-bottom: 0;
  }
  
  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .nav-link.active {
    border-left: none;
    border-bottom: 3px solid var(--color-primary);
    padding-left: 0.75rem;
    padding-bottom: calc(0.5rem - 3px);
  }
  
  .top-bar {
    padding: 1.25rem;
  }
  
  .tab-panel {
    padding: 1.25rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Quota and Limits styling */
.limit-tag {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-secondary);
}

.quota-normal {
  color: var(--color-success);
  font-weight: bold;
  font-family: monospace;
}

.quota-exceeded {
  color: var(--color-danger);
  font-weight: bold;
  font-family: monospace;
  background-color: rgba(239, 68, 68, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-reset-usage {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 0.5rem;
  font-size: 0.85rem;
  transition: color 0.2s;
  vertical-align: middle;
}

.btn-reset-usage:hover {
  color: var(--color-primary);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  font-size: 0.7rem;
  color: #e2e8f0;
  text-align: center;
  border-top: 1px solid rgba(250, 204, 21, 0.15);
  background-color: rgba(0, 0, 0, 0.25);
  line-height: 1.4;
  font-weight: 500;
}
