/* ========================================
   LinkedIn Content Engine — Premium Light Theme (Apple Aesthetic)
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Core Palette - Apple Style */
  --bg-primary: #f5f5f7;
  --bg-secondary: #e8e8ed;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.7);
  
  /* Accents */
  --accent-blue: #0071e3;
  --accent-blue-light: #2997ff;
  --accent-blue-glow: rgba(0, 113, 227, 0.15);
  --accent-green: #34c759;
  --accent-green-glow: rgba(52, 199, 89, 0.1);
  --accent-red: #ff3b30;
  --accent-red-glow: rgba(255, 59, 48, 0.1);
  --accent-orange: #ff9500;
  --accent-purple: #5e5ce6;
  
  /* Text */
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-muted: #a1a1a6;
  
  /* Borders */
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-active: rgba(0, 113, 227, 0.3);
  
  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 8px 32px rgba(0, 0, 0, 0.08);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle gradient background for premium feel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.8), transparent 40%),
              radial-gradient(circle at bottom right, rgba(255,255,255,0.6), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ===== Layout ===== */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ===== Header / Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar__logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.navbar__title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.navbar__subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 980px; /* Apple pill shape */
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--text-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn--primary:hover {
  transform: scale(1.02);
  background: #000000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.btn--success:hover {
  background: var(--accent-blue-light);
  transform: scale(1.02);
}

.btn--danger {
  background: var(--bg-card);
  color: var(--accent-red);
  border: 1px solid rgba(255, 59, 48, 0.2);
}

.btn--ghost {
  background: rgba(0,0,0,0.03);
  color: var(--text-primary);
}

.btn--ghost:hover {
  background: rgba(0,0,0,0.06);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
  border: 1px solid rgba(0,0,0,0.02);
}

.card:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ===== Status Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--draft {
  background: #fff8e6;
  color: #d97706;
}

.badge--approved {
  background: #e6f9ec;
  color: #059669;
}

.badge--published {
  background: #e5f0fa;
  color: #0284c7;
}

.badge--skipped {
  background: #fee2e2;
  color: #dc2626;
}

.badge--pillar {
  background: #f3f0ff;
  color: #6d28d9;
}

.badge--hook {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* ===== Dashboard ===== */
.dashboard-header {
  padding: 56px 0 40px;
  text-align: center;
}

.dashboard-header h1 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.dashboard-header p {
  color: var(--text-secondary);
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto;
  font-weight: 400;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.stat-card {
  text-align: center;
  padding: 28px 20px;
  border-radius: var(--radius-xl);
}

.stat-card__number {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.stat-card__label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 8px;
}

/* Draft List */
.draft-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 64px;
}

.draft-item {
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
  text-decoration: none;
  color: inherit;
}

.draft-item__text {
  font-size: 16px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  font-weight: 400;
}

.draft-item__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.draft-item__date {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ===== Loading / Empty States ===== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  text-align: center;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.empty-state {
  text-align: center;
  padding: 100px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.empty-state__icon {
  font-size: 56px;
  margin-bottom: 20px;
  opacity: 0.8;
}

.empty-state__text {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 400px;
  margin: 0 auto;
}

/* ===== Toast Notification ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 150%);
  background: rgba(29, 29, 31, 0.9);
  backdrop-filter: blur(10px);
  color: white;
  border-radius: 980px;
  padding: 14px 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 1000;
  transition: transform var(--transition-smooth);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}

.toast.show {
  transform: translate(-50%, 0);
}

/* ===== Generating Overlay ===== */
.generating-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  flex-direction: column;
  gap: 24px;
}

.generating-overlay.active {
  display: flex;
}

.generating-overlay__text {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.generating-overlay__sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: -16px;
}

/* Pulse animation */
.pulse-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pulse-ring__inner {
  font-size: 28px;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.3);
}

/* ===== Premium Preferences Panel ===== */
.pref-panel {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 0;
  margin-bottom: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.03);
  overflow: hidden;
}

.pref-panel:hover {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.06);
  transform: none;
}

.pref-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 36px;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
}

.pref-panel__title {
  font-size: 19px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

.pref-panel__badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  border-radius: 100px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.pref-section {
  padding: 28px 36px;
  border-bottom: 1px solid #f8fafc;
}

.pref-section:last-of-type {
  border-bottom: none;
}

.pref-section__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}

.pref-grid {
  display: grid;
  gap: 20px;
}

.pref-grid--2col { grid-template-columns: 1fr 1fr; }
.pref-grid--4col { 
  grid-template-columns: 1.2fr 1fr 1fr 1fr; 
  align-items: start;
}

.pref-field { position: relative; }

.pref-field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pref-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.pref-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.pref-input:hover {
  border-color: #cbd5e1;
  background: #fafbfd;
}

.pref-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
  background: #ffffff;
}

/* Custom Select Dropdown */
.pref-select-wrap {
  position: relative;
}

.pref-select {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 42px 14px 18px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.pref-select:hover {
  border-color: #cbd5e1;
  background: #fafbfd;
}

.pref-select:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
  background: #ffffff;
}

.pref-select-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px !important;
  height: 16px !important;
  color: #94a3b8;
  pointer-events: none;
}

.pref-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 14px;
  line-height: 1.5;
}

.pref-actions {
  padding: 20px 36px 28px;
  display: flex;
  justify-content: flex-end;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
}

.pref-save-btn {
  padding: 14px 36px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 4px 16px rgba(79, 70, 229, 0.12) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.pref-save-btn:hover {
  transform: translateY(-1px) scale(1.01) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 8px 24px rgba(79, 70, 229, 0.2) !important;
}

/* ===== Layout & Responsiveness Updates ===== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 40px;
}

@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .dashboard-header h1 { font-size: 32px; }
  .stat-card__number { font-size: 36px; }
  .draft-item { padding: 20px; }
  .pref-grid--2col { grid-template-columns: 1fr; }
  .pref-grid--4col { grid-template-columns: 1fr 1fr; }
  .pref-panel__header { padding: 20px 24px; }
  .pref-section { padding: 20px 24px; }
  .pref-actions { padding: 16px 24px 20px; }
  
  /* Stats Row responsive styling */
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
  }
}

@media (max-width: 576px) {
  /* Navbar premium mobile optimization */
  .navbar {
    padding: 12px 0;
  }
  .navbar .container {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
  }
  .navbar__brand {
    gap: 8px !important;
  }
  .navbar__title {
    font-size: 17px !important;
  }
  .navbar__subtitle {
    display: none !important; /* Hide subtitle to keep logo clean */
  }
  .navbar__actions {
    width: 100%;
    justify-content: center !important;
    gap: 8px !important;
    margin-right: 0 !important;
  }
  #user-profile {
    margin-right: 0 !important;
    gap: 8px !important;
  }
  #user-name-display {
    display: none !important; /* Hide username on very small screens, avatar is enough! */
  }
  .nav-account-link {
    padding: 4px !important;
  }
  #li-connect-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
  
  /* Stats Row 1 Column on small mobile */
  .stats-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* Card paddings on mobile */
  .card {
    padding: 16px !important;
  }
}

/* ===== Premium Navigation Drawer ===== */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 85%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.05);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.menu-drawer.active {
  transform: translateX(0);
}

.menu-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.menu-drawer__title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.menu-drawer__close {
  background: rgba(0, 0, 0, 0.03);
  border: none;
  color: #64748b;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-drawer__close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #0f172a;
  transform: rotate(90deg);
}

.menu-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Profile Card inside drawer */
.menu-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 16px;
}

.menu-profile-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #4f46e5;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.menu-profile-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-profile-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.menu-profile-card__email {
  font-size: 12px;
  color: #64748b;
  word-break: break-all;
}

.menu-profile-card__badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(79, 70, 229, 0.06);
  color: #4f46e5;
  border: 1px solid rgba(79, 70, 229, 0.1);
}

/* Menu card sections */
.menu-card {
  padding: 20px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.01);
}

.menu-card__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.menu-card__desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* Nav Links inside drawer */
.menu-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  transition: all 0.2s;
}

.menu-link:hover {
  background: rgba(0, 0, 0, 0.03);
  color: #0f172a;
}

.menu-link.active {
  background: rgba(79, 70, 229, 0.06);
  color: #4f46e5;
}

.menu-drawer__footer {
  padding: 20px 28px 28px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.menu-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600 !important;
  color: #ff3b30 !important;
  border-color: rgba(255, 59, 48, 0.15) !important;
  background: rgba(255, 59, 48, 0.02) !important;
}

.menu-logout-btn:hover {
  background: rgba(255, 59, 48, 0.06) !important;
}


