/* ==========================================================================
   UnliEmail Pro - Modern Dark Space & Cyber Glassmorphism Design System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-base: #070a12;
  --bg-surface: #0e1424;
  --bg-surface-elevated: #151d32;
  --bg-card: rgba(17, 24, 43, 0.75);
  --bg-card-hover: rgba(26, 36, 64, 0.85);
  --bg-glass: rgba(14, 20, 36, 0.65);
  
  /* Brand Accent Colors */
  --accent-cyan: #00f0ff;
  --accent-cyan-glow: rgba(0, 240, 255, 0.25);
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-rose: #f43f5e;

  /* Borders & Gradients */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(0, 240, 255, 0.5);
  --gradient-brand: linear-gradient(135deg, #00f0ff 0%, #7928ca 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  --gradient-glow: radial-gradient(circle at 50% -20%, rgba(0, 240, 255, 0.15), transparent 70%);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #030712;

  /* Sizing & Transitions */
  --sidebar-width: 270px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 25px rgba(0, 240, 255, 0.2);
  --shadow-glow-purple: 0 0 25px rgba(139, 92, 246, 0.2);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

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

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.4);
}

/* App Layout Grid */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--transition-normal);
}

.sidebar-brand {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
  flex-shrink: 0;
}

.brand-text h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--gradient-brand);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-top: 1px;
}

.sidebar-nav {
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 12px 6px 12px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.05);
  font-weight: 600;
}

.nav-link svg {
  flex-shrink: 0;
}

.nav-link span {
  flex: 1;
}

.nav-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.nav-pill.target-pill {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

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

@keyframes pulseAmber {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.routing-status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.status-indicator.online {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  flex-shrink: 0;
}

.routing-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.routing-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.footer-credit {
  margin-top: 10px;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Main Content Shell
   ========================================================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px 32px 64px 32px;
  min-height: 100vh;
  max-width: 1600px;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px;
}

.page-title-group h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
}

.page-title-group p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

.quick-stats-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.quick-stats-pill strong {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Tab Content Transitions */
.tab-content {
  display: none;
  animation: fadeInContent var(--transition-normal);
}

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

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

/* Utility Typography & Codes */
code, kbd, pre {
  font-family: 'JetBrains Mono', monospace;
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  color: var(--accent-cyan);
}
