/* Enterprise Responsive Design System for CPU LLM Dashboard */
:root {
  --bg-app: #080c14;
  --bg-card: #0f172a;
  --bg-card-subtle: #141f36;
  --bg-card-hover: #1e293b;
  --border-subtle: #1e293b;
  --border-focus: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --state-green: #10b981;
  --state-amber: #f59e0b;
  --state-rose: #ef4444;
  --state-purple: #a855f7;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html, body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre, .font-mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

/* Modal Backdrops */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Nav Item Styling */
.nav-tab, .nav-tab-btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-tab:hover, .nav-tab-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-tab.active, .nav-tab-btn.active {
  color: #fff;
  background-color: var(--border-subtle);
  font-weight: 600;
}

/* Mobile Bottom Navigation */
.mobile-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-subtle);
  z-index: 50;
  display: flex;
  justify-content: space-around;
  padding: 0.4rem 0.2rem;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.6rem;
  font-weight: 500;
  padding: 0.25rem 0.25rem;
  border-radius: 0.375rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
  flex: 1;
  text-align: center;
}

.mobile-nav-btn.active {
  color: #3b82f6;
  font-weight: 600;
}

.mobile-nav-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  margin-bottom: 0.15rem;
}

/* Standard Badges */
.badge, .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.badge-green, .badge-success {
  background-color: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-amber, .badge-warning {
  background-color: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-red, .badge-danger {
  background-color: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-blue, .badge-info {
  background-color: rgba(37, 99, 235, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge-gray, .badge-neutral {
  background-color: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Buttons */
.btn, .btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  white-space: nowrap;
}

.btn-blue, .btn-primary {
  background-color: var(--brand-blue);
  color: #fff;
}
.btn-blue:hover, .btn-primary:hover {
  background-color: var(--brand-blue-hover);
}

.btn-ghost, .btn-secondary {
  background-color: var(--bg-card-subtle);
  border-color: var(--border-subtle);
  color: var(--text-main);
}
.btn-ghost:hover, .btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-danger {
  background-color: #ef4444;
  color: #fff;
}
.btn-danger:hover {
  background-color: #dc2626;
}

/* Inputs & Form Elements */
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.75rem;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
}

/* Cards & Responsive Tables */
.responsive-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

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

.custom-table th {
  padding: 0.75rem 1rem;
  background-color: rgba(15, 23, 42, 0.7);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background-color: rgba(30, 41, 59, 0.35);
}

/* Chat bubble styling */
.chat-bubble-user {
  background-color: var(--brand-blue);
  color: #ffffff;
  border-radius: 1rem 1rem 0.25rem 1rem;
  padding: 0.75rem 1rem;
  max-width: 85%;
  font-size: 0.8rem;
  word-break: break-word;
}

.chat-bubble-assistant {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 1rem 1rem 1rem 0.25rem;
  padding: 0.85rem 1.1rem;
  max-width: 88%;
  font-size: 0.8rem;
  line-height: 1.6;
  word-break: break-word;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  body {
    padding-bottom: 5rem; /* Space for mobile bottom bar */
  }
  
  .chat-bubble-user, .chat-bubble-assistant {
    max-width: 95%;
  }

  .responsive-card {
    padding: 1rem;
  }
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.35);
}
