/* =========================================================
   ONE CLICK SOCIAL MEDIA AUTOMATION — PREMIUM DARK THEME
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-dark: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2333;
  --bg-sidebar: #0d1424;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.15);

  --text-primary: #f0f4ff;
  --text-secondary: #8ba3c7;
  --text-muted: #4a6080;

  --accent-blue:   #4f86f7;
  --accent-purple: #8b5cf6;
  --accent-pink:   #ec4899;
  --accent-green:  #10b981;
  --accent-orange: #f59e0b;

  --gradient-main:   linear-gradient(135deg, #4f86f7 0%, #8b5cf6 100%);
  --gradient-glow:   linear-gradient(135deg, rgba(79,134,247,0.15) 0%, rgba(139,92,246,0.15) 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(79,134,247,0.2);

  --sidebar-width: 260px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font-family: inherit;
  outline: none;
}
img { max-width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Sidebar Layout ── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.sidebar-logo .logo-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(79,134,247,0.15);
  color: var(--accent-blue);
}
.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  background: rgba(10,14,26,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px 6px 8px;
  font-size: 0.8rem;
  font-weight: 500;
}
.avatar-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
}

/* ── Page Container ── */
.page-content { padding: 32px; flex: 1; max-width: 1200px; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }

.card-glass {
  background: rgba(17,24,39,0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}
.btn-primary {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 20px rgba(79,134,247,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(79,134,247,0.5);
}
.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-hover);
}
.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
}
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
}
.form-control:focus {
  border-color: var(--accent-blue);
  background: rgba(79,134,247,0.05);
  box-shadow: 0 0 0 3px rgba(79,134,247,0.12);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }

/* ── Platform Cards ── */
.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.platform-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--platform-color, var(--gradient-main));
  opacity: 0;
  transition: var(--transition);
}
.platform-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.platform-card:hover::before { opacity: 1; }
.platform-card.connected { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.04); }
.platform-card.connected::before { opacity: 1; background: var(--accent-green); }

.platform-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}
.platform-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.platform-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5; }

.connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16,185,129,0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 10px;
}

/* ── Stat Cards ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

/* ── Steps / Instructions ── */
.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.step-item:last-child { border-bottom: none; }
.step-number {
  width: 28px; height: 28px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.step-text { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; padding-top: 4px; }
.step-text b { color: var(--text-primary); font-weight: 600; }
.step-text code {
  background: rgba(79,134,247,0.12);
  color: var(--accent-blue);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: 'Courier New', monospace;
}
.step-text a { color: var(--accent-blue); text-decoration: underline; text-underline-offset: 2px; }

/* ── Error Accordion ── */
.error-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.error-item:last-child { border-bottom: none; }
.error-code {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--accent-orange);
  margin-bottom: 3px;
}
.error-desc { font-size: 0.8rem; color: var(--text-secondary); }

/* ── Platform Checkboxes ── */
.platform-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}
.platform-check-item:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.03); }
.platform-check-item.selected { border-color: var(--accent-blue); background: rgba(79,134,247,0.07); }
.platform-check-item input[type="checkbox"] { display: none; }

/* ── Toasts ── */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.3s ease forwards;
}
.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.info    { border-left: 3px solid var(--accent-blue); }
.toast-icon { font-size: 1rem; margin-top: 1px; }
.toast.success .toast-icon { color: var(--accent-green); }
.toast.error .toast-icon   { color: #ef4444; }
.toast.info .toast-icon    { color: var(--accent-blue); }
.toast-message { font-size: 0.85rem; line-height: 1.5; }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ── Loading Spinner ── */
#spinner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,14,26,0.7);
  backdrop-filter: blur(4px);
  z-index: 8888;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
#spinner-overlay.active { display: flex; }
.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-text { font-size: 0.875rem; color: var(--text-secondary); }

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 80% 80% at 50% -10%, rgba(79,134,247,0.18) 0%, transparent 70%),
              var(--bg-dark);
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-icon {
  width: 54px; height: 54px;
  background: var(--gradient-main);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(79,134,247,0.4);
}
.auth-title { font-size: 1.4rem; font-weight: 800; text-align: center; margin-bottom: 6px; }
.auth-sub { font-size: 0.85rem; color: var(--text-secondary); text-align: center; }
.auth-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}
.auth-link { font-size: 0.85rem; color: var(--text-secondary); text-align: center; margin-top: 20px; }
.auth-link a { color: var(--accent-blue); font-weight: 600; }
.auth-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #fca5a5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* ── Landing Page ── */
.landing-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 100% 60% at 50% -5%, rgba(79,134,247,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 90% 10%, rgba(139,92,246,0.12) 0%, transparent 50%),
    var(--bg-dark);
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,14,26,0.75);
}

.hero-section {
  text-align: center;
  padding: 100px 24px 80px;
  max-width: 780px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(79,134,247,0.12);
  border: 1px solid rgba(79,134,247,0.25);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}
.hero-title .gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
  background: var(--gradient-glow);
  border: 1px solid rgba(79,134,247,0.2);
  color: var(--accent-blue);
}
.feature-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }

.platforms-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 24px 80px;
}
.platform-logo-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}
.platform-logo-chip:hover { border-color: var(--border-hover); transform: translateY(-1px); }

.section-label {
  text-align: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* ── Video Placeholder ── */
.video-placeholder {
  background: rgba(0,0,0,0.3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.video-placeholder i { font-size: 2rem; color: var(--text-muted); }

/* ── Section Title ── */
.section-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.section-sub { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 28px; }

/* ── File Upload ── */
.file-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.file-upload-zone:hover, .file-upload-zone.dragover {
  border-color: var(--accent-blue);
  background: rgba(79,134,247,0.05);
}
.file-upload-zone i { font-size: 2rem; color: var(--text-muted); display: block; margin-bottom: 8px; }
.file-upload-zone span { font-size: 0.82rem; color: var(--text-secondary); }
#preview-img { max-height: 180px; border-radius: var(--radius-sm); margin-top: 12px; display: none; }

/* ── Results Display ── */
.result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.result-item.success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
.result-item.error   { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.2);  }

/* ── Utility ── */
.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-green); }
.text-danger  { color: #ef4444; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.fw-700 { font-weight: 700; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px; }
  .landing-nav { padding: 16px 20px; }
  .hero-section { padding: 70px 16px 50px; }
}
