/* Sentinel - Minimalist Pitch-Black Mobile-First Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-pitch-black: #000000;
  --bg-card: #0A0A0D;
  --bg-card-hover: #121216;
  --bg-card-secondary: #141418;
  
  --border-subtle: #1D1D22;
  --border-active: #31313A;
  
  --text-primary: #FFFFFF;
  --text-secondary: #A1A1AA;
  --text-muted: #66666E;
  
  /* Minimalist Accents */
  --accent-blue: #3B82F6;
  --accent-emerald: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--bg-pitch-black);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #000;
}
::-webkit-scrollbar-thumb {
  background: #222228;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Mobile-First Main Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 70px; /* Space for Mobile Bottom Nav */
}

/* Header Bar */
.top-header {
  background: #000000;
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-title-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  background: #FFFFFF;
  color: #000000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid var(--border-subtle);
  background: #0A0A0D;
  padding: 2px;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #FFF;
}

.brand-domain {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.header-status-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0A0A0D;
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-emerald);
}

.health-score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.health-score-pill strong {
  font-size: 14px;
  font-family: var(--font-mono);
}

.ai-chip {
  background: #0F0F13;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-chip:hover {
  background: var(--accent-blue);
  color: #FFF;
  border-color: var(--accent-blue);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 1.6s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  background: #0A0A0D;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex: 1;
}

.btn:hover, .btn:active {
  background: #141418;
  border-color: var(--border-active);
}

.btn-primary {
  background: #FFFFFF;
  color: #000000;
  border: none;
  font-weight: 700;
}

.btn-primary:hover, .btn-primary:active {
  background: #E4E4E7;
}

/* Mobile Bottom Navigation Bar */
.mobile-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #0A0A0D;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding: 0 8px;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.15s ease;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.mobile-nav-item.active {
  color: var(--text-primary);
}

/* Desktop Navigation Sidebar (Hidden on Mobile) */
.desktop-sidebar {
  display: none;
}

/* Main Body View Panels */
.main-content {
  padding: 20px 16px;
  flex: 1;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

/* Pitch Black Solid Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card-title-sub {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.card-value-hero {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  color: #FFF;
}

.card-footer-info {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Grids for Metrics & Charts */
.grid-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Chart Canvas Container */
.chart-box {
  position: relative;
  width: 100%;
  height: 240px;
  margin-top: 12px;
}

/* Data Tables (Mobile Scrollable) */
.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-card);
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

.clean-table th {
  padding: 12px 14px;
  background: #0F0F13;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.clean-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.clean-table tr:last-child td {
  border-bottom: none;
}

.clean-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #FFF;
}

/* Minimal Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.status-pill.success { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-pill.warning { background: rgba(245, 158, 11, 0.12); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-pill.danger { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.status-pill.info { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }

/* Progress Bars */
.progress-bg {
  width: 100%;
  height: 6px;
  background: #18181D;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Alert Item */
.alert-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-blue);
  border-radius: 10px;
  margin-bottom: 10px;
}

.alert-row.critical { border-left-color: var(--accent-rose); }
.alert-row.warning { border-left-color: var(--accent-amber); }

/* DESKTOP RESPONSIVE MEDIA QUERIES (768px and up) */
@media (min-width: 768px) {
  .app-container {
    flex-direction: row;
    padding-bottom: 0;
  }

  .mobile-nav-bar {
    display: none; /* Hide bottom nav on desktop */
  }

  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 240px;
    background: #000000;
    border-right: 1px solid var(--border-subtle);
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 24px 16px;
  }

  .sidebar-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 24px;
    flex: 1;
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .sidebar-nav-item:hover {
    background: #0A0A0D;
    color: var(--text-primary);
  }

  .sidebar-nav-item.active {
    background: #141418;
    color: #FFFFFF;
    border: 1px solid var(--border-subtle);
  }

  .sidebar-nav-item svg {
    width: 18px;
    height: 18px;
  }

  .top-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
  }

  .header-actions {
    flex: none;
  }

  .btn {
    flex: none;
  }

  .main-wrapper-desktop {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .main-content {
    padding: 32px;
  }

  /* Grid Layouts for Desktop */
  .grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
  }
}
