/* 
  BlueJax Core Dashboard Premium Styling
  Theme: Dark Mode, Glassmorphism, Vibrant Neon Accents
*/

:root {
  /* Core Colors */
  --bg-base: #0A0A0B; /* Deepest dark */
  --bg-surface: #121215;
  --bg-surface-elevated: #1A1A1F;
  --bg-surface-glass: rgba(18, 18, 21, 0.6);
  
  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0AB;
  --text-muted: #6B6B76;
  
  /* Accents */
  --accent-primary: #8B5CF6; /* Electric Purple */
  --accent-primary-hover: #7C3AED;
  --accent-cyan: #06B6D4;
  --accent-success: #10B981;
  
  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(139, 92, 246, 0.5);
  
  /* Layout */
  --sidebar-width: 260px;
  --header-height: 72px;
  
  /* Shadows */
  --shadow-glow-purple: 0 0 20px rgba(139, 92, 246, 0.3);
  --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.3);
  
  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Animations */
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Keyframes for Dynamic Feel */
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px var(--accent-cyan); opacity: 0.8; }
  50% { box-shadow: 0 0 25px var(--accent-cyan), 0 0 10px var(--accent-cyan) inset; opacity: 1; }
}

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

/* Hard CSS Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

html { overflow-x: hidden; }

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-cyan { color: var(--accent-cyan) !important; }
.text-purple { color: var(--accent-primary) !important; }
.text-black { color: #000 !important; }

/* Icons */
.lucide { width: 20px; height: 20px; stroke-width: 2; }
.icon-sm { width: 16px; height: 16px; stroke-width: 2.5; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-surface-elevated);
}

/* Layout Container */
.app-container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  height: 100vh;
  width: 100vw;
  max-width: 100vw;
  overflow: hidden;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  z-index: 10;
  -ms-flex-negative: 0;
      flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  animation: pulseGlow 4s infinite alternate;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-selector {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.brand-selector:hover { border-color: var(--text-muted); color: var(--text-primary); }
.active-brand { display: flex; align-items: center; justify-content: space-between; }

.sidebar-nav {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-spacer { flex-grow: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition-fast);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.08); /* Faint purple */
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
  padding-left: 11px;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  margin-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.9rem; font-weight: 600; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }


/* Main Content */
.main-content {
  -webkit-box-flex: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100vw;
  background: 
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.05), transparent 40%),
    radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.03), transparent 40%);
}

/* Header */
.top-header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 5;
}

.glass-panel {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.page-title { font-size: 1.25rem; font-weight: 600; }

.global-search {
  position: relative;
  width: 380px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.global-search input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px 10px 42px;
  border-radius: 100px; /* pill shape */
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.global-search input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

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

.notification-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

.dashboard-grid {
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.span-full { grid-column: 1 / -1; }
.span-2-col { grid-column: span 2; }

/* Widgets / Cards */
.widget {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  min-width: 0; /* Prevent flex/grid blowout */
  transition: var(--transition-normal);
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  will-change: transform, box-shadow, border-color;
}

.dashboard-grid .widget:nth-child(1) { animation-delay: 0.0s; }
.dashboard-grid .widget:nth-child(2) { animation-delay: 0.1s; }
.dashboard-grid .widget:nth-child(3) { animation-delay: 0.2s; }
.dashboard-grid .widget:nth-child(4) { animation-delay: 0.3s; }
.dashboard-grid .widget:nth-child(5) { animation-delay: 0.4s; }
.dashboard-grid .widget:nth-child(6) { animation-delay: 0.5s; }

.widget:hover {
  border-color: rgba(255,255,255,0.15); 
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.live-metrics-container {
  margin-top: 30px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* AI Quick Plan Hub */
.ai-hub {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 48px 32px;
  border: 1px solid rgba(6, 182, 212, 0.2); /* Cyan subtle border */
}

.ai-hub-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
}

.ai-hub h2 {
  font-size: 1.75rem;
  font-weight: 500;
  margin-bottom: 24px;
  background: linear-gradient(to right, #fff, #A0A0AB);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-input-wrapper {
  position: relative;
  display: flex;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border-radius: 12px;
}

.ai-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.ai-input-wrapper input {
  width: 100%;
  padding: 18px 20px 18px 56px;
  background: rgba(25, 25, 30, 0.8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(10px);
}

.ai-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.ai-input-wrapper .submit-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  bottom: 8px;
  padding: 0 16px;
  border-radius: 8px;
}

.ai-suggestions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.suggestion-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.suggestion-chip:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

/* Ambient glow effects for AI Hub */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
  animation: orbFloat 12s ease-in-out infinite alternate;
}
.orb-primary {
  background: var(--accent-primary);
  width: 300px; height: 300px;
  top: -100px; left: -50px;
}
.orb-secondary {
  background: var(--accent-cyan);
  width: 250px; height: 250px;
  bottom: -100px; right: -50px;
  animation-delay: -6s;
}

/* KPI Cards */
.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.kpi-title { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }
.kpi-value { font-size: 2rem; font-weight: 600; /* lining-nums */ font-feature-settings: 'lnum' 1, 'tnum' 1; }
.kpi-limit { font-size: 1rem; color: var(--text-muted); font-weight: 400; }

.kpi-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  margin-top: 12px;
}

.kpi-trend.positive { color: var(--accent-success); }

.kpi-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 100px;
  margin-top: 16px;
  overflow: hidden;
}

.progress-fill { height: 100%; border-radius: 100px; }
.cyan-glow {
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Timeline & Lists */
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.widget-header h3 { font-size: 1.1rem; font-weight: 500; }
.view-all { color: var(--accent-primary); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: var(--transition-fast); }
.view-all:hover { color: var(--accent-primary-hover); text-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }

.timeline-list { display: flex; flex-direction: column; gap: 16px; }

.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  cursor: default;
}

.timeline-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.timeline-time { font-size: 0.85rem; color: var(--text-muted); }

.timeline-content { display: flex; align-items: center; gap: 12px; }

.brand-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.tag-bluejax { background: rgba(59, 130, 246, 0.15); color: #60A5FA; }
.tag-soloo { background: rgba(236, 72, 153, 0.15); color: #F472B6; }

.post-preview { font-size: 0.95rem; color: var(--text-primary); }

.timeline-status {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 500;
}
.status-ready { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-draft { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); border: 1px solid rgba(255, 255, 255, 0.1); }


/* Activity List */
.activity-list { display: flex; flex-direction: column; gap: 16px; }

.activity-item { 
  display: flex; 
  align-items: flex-start; 
  gap: 12px; 
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition-fast);
}
.activity-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.act-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-cyan { background: var(--accent-cyan); color: #000; }
.bg-purple { background: var(--accent-primary); }

.act-details p { font-size: 0.9rem; color: var(--text-primary); }
.act-details span { font-size: 0.75rem; color: var(--text-muted); }

/* Responsive basics */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .span-2-col { grid-column: span 2; }
  .live-metrics-container { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr; padding: 16px; gap: 16px; max-width: 100vw; overflow-x: hidden; box-sizing: border-box; }
  .span-full, .span-2-col { grid-column: span 1; }
  .app-container { flex-direction: column; }
  .sidebar { width: 100%; height: auto; flex-direction: row; align-items: center; justify-content: space-between; border-right: none; border-bottom: 1px solid var(--border-subtle); padding: 10px; max-width: 100vw; box-sizing: border-box; }
  .sidebar-nav, .user-profile { display: none; /* simple mobile hide for now */ }
  .sidebar-header { border-bottom: none; padding: 10px; margin: 0;}
  .live-metrics-container { grid-template-columns: 1fr;gap: 12px; margin-top: 16px;}
  .ai-hub { padding: 32px 16px; }
  .ai-hub h2 { font-size: 1.4rem; }
  .top-header { padding: 12px 16px; height: auto; min-height: 60px; flex-wrap: wrap; gap: 12px; max-width: 100vw; box-sizing: border-box; }
  .global-search { display: none; }
  .widget { padding: 16px; width: 100%; box-sizing: border-box; }
  .marketing-card { padding: 16px !important; margin-bottom: 12px !important; }
}
@media (max-width: 480px) {
  .global-search { display: none; }
  .ai-input-wrapper { display: flex; flex-direction: column; gap: 8px; box-shadow: none; border: none; background: transparent; padding: 0; }
  .ai-input-wrapper input { width: 100%; padding: 14px 16px; border-radius: 8px; background: rgba(25, 25, 30, 0.8); }
  .ai-input-wrapper .submit-btn { position: relative; width: 100%; top: auto; right: auto; padding: 12px; }
  .ai-icon { display: none; }
}

/* Modals & Inputs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 650px;
  background: rgba(22, 22, 26, 0.85); /* Slightly darker solid base for readability */
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-primary);
}

.modal-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.premium-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-normal);
}

.premium-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2), inset 0 2px 4px rgba(0,0,0,0.5);
  background: rgba(0, 0, 0, 0.4);
}

.premium-input::placeholder {
  color: var(--text-muted);
}

textarea.premium-input {
  resize: vertical;
  min-height: 120px;
}

.platform-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.platform-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 16px;
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-normal);
}

.platform-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.platform-chip.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.modal-footer {
  padding: 24px 32px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 20px 20px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
