/* FlashGate SaaS Theme Stylesheet - Pixel-Perfect High-End Design */

.hidden {
  display: none !important;
}

:root {
  --bg-base: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #151d30;
  --bg-elevated: #1a243b;
  --bg-input: #0e1424;
  --border-subtle: #1e293b;
  --border-medium: #27354f;
  --border-focus: #00a67e;
  --accent-emerald: #00a67e;
  --accent-emerald-hover: #008f6c;
  --accent-emerald-light: #10b981;
  --accent-emerald-bg: rgba(0, 166, 126, 0.12);
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

/* Global resets & typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

code, kbd, samp, pre {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0b0f19;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Base Component Styles */
.card-base {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
}

.card-inner {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.input-base {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  transition: all 0.15s ease-in-out;
}

.input-base:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 1px var(--accent-emerald);
}

.input-base::placeholder {
  color: #475569;
}

.select-base {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.select-base:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 1px var(--accent-emerald);
}

/* Primary Button (#00a67e / Emerald) */
.btn-primary {
  background-color: #00a67e;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #008f6c;
  box-shadow: 0 0 12px rgba(0, 166, 126, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Secondary Button */
.btn-secondary {
  background-color: #1a243b;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.15s ease-in-out;
  border: 1px solid #27354f;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #22304f;
  color: #ffffff;
  border-color: #334155;
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* Ghost Button */
.btn-ghost {
  background-color: transparent;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* Navigation items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  user-select: none;
}

.nav-item:hover {
  color: #f1f5f9;
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  background-color: rgba(0, 166, 126, 0.12);
  color: #00a67e;
  font-weight: 600;
}

.nav-item.active i {
  color: #00a67e;
}

/* Segmented Control Pill Buttons */
.seg-pill-container {
  display: inline-flex;
  background-color: #0e1424;
  border: 1px solid #1e293b;
  padding: 2px;
  border-radius: var(--radius-md);
}

.seg-pill-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #64748b;
  border-radius: calc(var(--radius-md) - 2px);
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
}

.seg-pill-btn:hover {
  color: #cbd5e1;
}

.seg-pill-btn.active {
  background-color: #1e293b;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

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

.custom-table th {
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  color: #64748b;
  background-color: #0d1322;
  border-bottom: 1px solid #1e293b;
  white-space: nowrap;
}

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

.custom-table tbody tr {
  transition: background-color 0.12s ease;
}

.custom-table tbody tr:hover {
  background-color: rgba(21, 29, 48, 0.6);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
}

.status-badge-active {
  background-color: rgba(0, 166, 126, 0.12);
  border: 1px solid rgba(0, 166, 126, 0.3);
  color: #10b981;
}

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

.status-badge-error {
  background-color: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fb7185;
}

/* Compact quick-action table icon button */
.table-action-btn {
  padding: 0.3rem;
  border-radius: 0.375rem;
  color: #94a3b8;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-action-btn:hover {
  background-color: #1e293b;
  color: #ffffff;
}

/* Code Copy Block Styling */
.code-block-wrapper {
  position: relative;
  background-color: #090d16;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  background-color: #1e293b;
  color: #cbd5e1;
  border-radius: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.12s ease;
}

.code-copy-btn:hover {
  background-color: #334155;
  color: #ffffff;
}

/* Code Snippet Window */
.code-window {
  border-radius: var(--radius-md);
  border: 1px solid #1a243b;
  background: #090d16;
  overflow: hidden;
}

.code-window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: #0d1322;
  border-bottom: 1px solid #1a243b;
  font-size: 0.6875rem;
  color: #94a3b8;
}

.code-window-content {
  padding: 0.75rem;
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.71875rem;
  line-height: 1.5;
  color: #cbd5e1;
  overflow-x: auto;
  white-space: pre;
}

/* Syntax colors */
.syn-kw { color: #f43f5e; }
.syn-str { color: #10b981; }
.syn-var { color: #38bdf8; }
.syn-comment { color: #64748b; font-style: italic; }
.syn-num { color: #f59e0b; }

/* Modal backdrop & container */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-card {
  width: 100%;
  max-width: 580px;
  background-color: #111827;
  border: 1px solid #1e293b;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Toast animation */
#toast-container {
  pointer-events: none;
}
.toast-msg {
  pointer-events: auto;
  animation: toastSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
