/* Domin8 Agency OS — Elite Redesign */
/* Inspired by: Dracula variant + Tokyo Night, with accent-driven red theme */

/* ============================================
   Design Tokens
   ============================================ */
:root {
  /* Background system — card-friendly */
  --bg-deep: #0b0b12;
  --bg-primary: #0f0f1a;
  --bg-secondary: #0f0f1a;
  --bg-tertiary: #1e1e35;
  --bg-elevated: #282845;

  /* Text hierarchy */
  --text: #e8e8f5;
  --text-secondary: #b0b0d0;
  --text-muted: #8080a8;
  --text-dim: #5a5a7a;

  /* Accent system — Domin8 Red */
  --accent: #dc2626;
  --accent-hover: #ef4444;
  --accent-muted: rgba(220, 38, 38, 0.15);
  --accent-glow: rgba(220, 38, 38, 0.25);

  /* Semantic colors */
  --green: #22c55e;
  --green-muted: rgba(34, 197, 94, 0.12);
  --yellow: #eab308;
  --yellow-muted: rgba(234, 179, 8, 0.12);
  --red: #ef4444;
  --red-muted: rgba(239, 68, 68, 0.12);

  /* Structural */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.15);

  /* Fonts */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   CSS Reset & Base
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background: var(--accent-muted);
  color: var(--text);
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Background noise texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

#app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 3px;
  color: var(--text);
}

.logo-accent {
  color: var(--accent);
  margin-left: 2px;
}

.sidebar nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.2s var(--ease-out);
  text-align: left;
  width: 100%;
  position: relative;
}

.nav-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.nav-btn.active {
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 600;
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-btn.active .nav-icon {
  opacity: 1;
  color: var(--accent);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.status-badge {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  text-align: center;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
  position: relative;
}

/* Subtle radial gradient overlay */
.main-content::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  min-height: 60px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.breadcrumb-item {
  color: var(--text-muted);
}

.breadcrumb-item.active {
  color: var(--text);
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.5px;
}

.breadcrumb-sep {
  color: var(--text-dim);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-muted);
  animation: pulse-dot 2s infinite;
}

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

/* ============================================
   Content Scroll Area
   ============================================ */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.view {
  display: none;
  animation: viewEnter 0.4s var(--ease-out);
}

.view.active {
  display: block;
}

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

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 6px;
}

/* ============================================
   Stat Grid
   ============================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-grid.mini {
  grid-template-columns: repeat(3, 1fr);
}

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all 0.3s var(--ease-out);
  animation: cardEnter 0.5s var(--ease-out) both;
  animation-delay: calc(var(--delay, 0) * 0.08s);
}

.stat-card:hover {
  border-color: var(--accent-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  color: var(--text);
  line-height: 1;
}

/* ============================================
   Quick Actions
   ============================================ */
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 16px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.action-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  animation: cardEnter 0.5s var(--ease-out) both;
}

.action-card:nth-child(1) { animation-delay: 0.1s; }
.action-card:nth-child(2) { animation-delay: 0.15s; }
.action-card:nth-child(3) { animation-delay: 0.2s; }
.action-card:nth-child(4) { animation-delay: 0.25s; }

.action-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  background: var(--bg-elevated);
}

.action-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.action-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.action-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   Forms & Cards
   ============================================ */
.form-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  max-width: 560px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-field {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s var(--ease-out);
  outline: none;
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.input-field::placeholder {
  color: var(--text-dim);
}

.btn-primary {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

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

/* ============================================
   Results Area
   ============================================ */
.results-area {
  margin-top: 20px;
}

.results-area > div {
  animation: cardEnter 0.4s var(--ease-out) both;
}

/* ============================================
   ClawMart & Integration Styles
   ============================================ */
.clawmart-links {
  margin-top: 20px;
}

.clawmart-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.clawmart-links a:hover {
  opacity: 0.8;
}

.settings-grid {
  max-width: 600px;
}

.settings-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.settings-card-header h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
}

.settings-icon {
  font-size: 20px;
}

.integration-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.integration-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.badge.green {
  background: var(--green-muted);
  color: var(--green);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: 60px;
    min-width: 60px;
  }
  .logo-text, .nav-btn span:not(.nav-icon) {
    display: none;
  }
  .sidebar-footer { display: none; }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .action-grid {
    grid-template-columns: 1fr;
  }
  .content-scroll {
    padding: 16px;
  }
  .topbar {
    padding: 12px 16px;
  }
  .hero-title {
    font-size: 24px;
  }
}
