/* RankPost AI — Complete Production Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-dark: #080914;
  --bg-surface: #0d0e1e;
  --bg-card: rgba(16, 20, 38, 0.75);
  --bg-card-hover: rgba(24, 30, 56, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(168, 85, 247, 0.4);

  --primary: #a855f7;
  --primary-dark: #7c3aed;
  --primary-indigo: #6366f1;
  --cyan: #06b6d4;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --blue: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  background-image:
    radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.02em;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===================== LAYOUT & SIDEBAR ===================== */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  background: var(--bg-dark);
}

.social-sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: fixed;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 18px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 18px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.4);
}

.brand-text h2 { font-size: 1.15rem; font-weight: 700; color: #fff; }
.brand-text span { font-size: 0.7rem; color: var(--cyan); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.nav-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 700;
  padding: 12px 6px 8px;
}

.social-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  border: 1px solid transparent;
}

.social-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.social-item.active-gmb {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  font-weight: 700;
}

.social-item.connected {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-glass);
}

.social-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.social-meta-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.05));
  color: #fff;
  border-left: 3px solid var(--primary);
  font-weight: 700;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
  margin-top: auto;
}

/* TOGGLE SLIDER SWITCH */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* ===================== MAIN WRAPPER ===================== */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100vw - 260px);
}

.top-header {
  height: 64px;
  background: rgba(13, 14, 30, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; gap: 12px; }

.post-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  padding: 14px 28px;
  background: rgba(13, 14, 30, 0.6);
}

.social-tabs {
  display: flex;
  gap: 16px;
}
.social-tab {
  padding: 6px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.social-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.content-body { padding: 24px 28px; flex: 1; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none; transition: var(--transition); text-decoration: none;
  outline: none;
}
.btn:focus-visible { ring: 2px solid var(--primary); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }

/* ===================== GLASS CARDS ===================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-bottom: 20px;
  transition: var(--transition);
}
.glass-card:hover { border-color: rgba(255, 255, 255, 0.12); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}
.card-title { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 10px; color: #fff; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-full);
  font-size: 0.76rem; font-weight: 700;
}
.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: var(--primary); border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: var(--rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }

/* ===================== FORMS & INPUTS ===================== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 700;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-input, .form-textarea, .form-select {
  width: 100%; background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md); padding: 11px 14px;
  color: #fff; font-family: inherit; font-size: 0.92rem;
  outline: none; transition: var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.25);
}

/* ===================== OPTION CHIPS ===================== */
.chip-selector-group {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.option-chip {
  padding: 8px 18px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: #cbd5e1; font-size: 0.84rem; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.option-chip:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.option-chip.selected {
  background: var(--emerald); color: #fff; border-color: var(--emerald);
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
}

/* ===================== VARIABLE TAGS ===================== */
.var-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 6px; padding: 4px 10px;
  font-size: 0.78rem; font-weight: 700; color: var(--primary);
  cursor: pointer; transition: var(--transition);
}
.var-tag:hover { background: rgba(168, 85, 247, 0.3); color: #fff; }

/* ===================== AI FILTER POPOVER MENU ===================== */
.btn-ai-filter {
  height: 100%;
  padding: 0 16px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.3));
  border: 1.5px solid #a855f7;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.btn-ai-filter:hover {
  background: var(--primary);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.ai-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 8px 0;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7);
  z-index: 200;
  animation: menuIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.ai-filter-menu.hidden { display: none; }

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  padding: 8px 14px 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 0.84rem;
  color: #e2e8f0;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.menu-item:hover {
  background: rgba(168, 85, 247, 0.2);
  color: #fff;
}
.menu-item i { width: 15px; height: 15px; color: var(--primary); }

.menu-item.has-submenu:hover .submenu {
  display: block;
}

.submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 6px;
  width: 160px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 6px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}
.submenu-item {
  padding: 8px 14px;
  font-size: 0.82rem;
  color: #cbd5e1;
  cursor: pointer;
  transition: var(--transition);
}
.submenu-item:hover {
  background: rgba(168, 85, 247, 0.25);
  color: #fff;
}

/* ===================== CALENDAR ===================== */
.calendar-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.calendar-nav { display: flex; align-items: center; gap: 14px; }
.calendar-nav button {
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-glass);
  color: #fff; border-radius: var(--radius-md); padding: 6px 12px; cursor: pointer;
  transition: var(--transition);
}
.calendar-nav button:hover { background: rgba(255, 255, 255, 0.12); }
.calendar-month-label { font-size: 1.2rem; font-weight: 700; color: #fff; }

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-day-header {
  text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--text-dim);
  padding: 8px 0; text-transform: uppercase; letter-spacing: 0.06em;
}
.cal-cell {
  min-height: 105px; background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass); border-radius: var(--radius-sm);
  padding: 8px; transition: var(--transition); cursor: pointer;
}
.cal-cell:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(168, 85, 247, 0.3); }
.cal-cell.today { border-color: var(--primary); background: rgba(168, 85, 247, 0.08); }
.cal-cell.other-month { opacity: 0.3; }
.cal-date { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.cal-cell.today .cal-date { color: var(--primary); }

.cal-post-chip {
  font-size: 0.7rem; padding: 4px 6px; border-radius: 4px; margin-bottom: 4px;
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-post-chip.type-what_new { background: rgba(59, 130, 246, 0.2); color: var(--blue); }
.cal-post-chip.type-offer { background: rgba(245, 158, 11, 0.2); color: var(--amber); }

/* ===================== TOAST & MODAL ===================== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: #111827; color: #fff; border: 1px solid var(--primary);
  padding: 12px 20px; border-radius: var(--radius-md); box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  font-weight: 600; display: flex; align-items: center; gap: 10px;
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #0f172a; border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl); padding: 28px; width: 680px; max-width: 95vw;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
  .social-sidebar { width: 80px; padding: 14px 8px; }
  .brand-text, .nav-section-label, .social-meta-sub, .nav-item span, .sidebar-footer span { display: none; }
  .main-wrapper { margin-left: 80px; width: calc(100vw - 80px); }
  .create-workspace-layout { grid-template-columns: 1fr; }
}
