/* ══════════════════════════════════════════════════════════════════
   InstaBot — Premium Dark UI
   ══════════════════════════════════════════════════════════════════ */

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

/* ─── CSS Variables ──────────────────────────────────────────────── */
:root {
  --bg-dark: #080b14;
  --bg-card: #0f1629;
  --bg-card-2: #131d35;
  --bg-hover: #1a2545;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);
  --text-primary: #f0f4ff;
  --text-secondary: #8892aa;
  --text-muted: #4a5568;
  --accent: #6c63ff;
  --accent-light: #8b84ff;
  --accent-glow: rgba(108,99,255,0.3);
  --success: #10d97e;
  --warning: #f0b429;
  --error: #ef4444;
  --gradient-1: linear-gradient(135deg, #6c63ff 0%, #f093fb 100%);
  --gradient-2: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-3: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(108,99,255,0.2);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Page System ────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }
#page-dashboard.active {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 70px;
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-primary);
}

.nav-logo {
  width: 36px; height: 36px;
  background: var(--gradient-1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
  cursor: pointer;
}

.nav-links a:hover { color: var(--text-primary); }

.nav-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.nav-mobile-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.btn-primary {
  background: var(--gradient-1);
  border: none;
  color: white;
  padding: 0.5rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* ═══════════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 100px 5% 60px;
  gap: 4rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 8s ease-in-out infinite;
}

.blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #6c63ff, transparent);
  top: -200px; left: -200px;
  animation-delay: 0s;
}

.blob-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #f093fb, transparent);
  top: 50%; right: -100px;
  animation-delay: 2s;
}

.blob-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #4facfe, transparent);
  bottom: -100px; left: 40%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent-light);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease;
}

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

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

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.gradient-text {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease 0.3s both;
}

.btn-hero-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gradient-1);
  border: none;
  color: white;
  padding: 0.9rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-hero-primary svg {
  width: 18px; height: 18px;
  transition: transform var(--transition);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-glow);
}
.btn-hero-primary:hover svg { transform: translateX(4px); }

.btn-hero-secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.9rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-hero-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-hover);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.stat-item .stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-item .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* ─── Phone Mockup ───────────────────────────────────────────────── */
.hero-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  animation: fadeInRight 0.8s ease 0.3s both;
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

.phone-mockup {
  width: 320px;
  background: #0f1629;
  border-radius: 36px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(108,99,255,0.1);
  animation: phoneFloat 4s ease-in-out infinite;
}

@keyframes phoneFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

.phone-inner { padding: 1.2rem; }

.phone-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.phone-dot {
  width: 10px; height: 10px;
  background: var(--gradient-1);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.phone-header span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.phone-post-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.phone-avatar {
  width: 36px; height: 36px;
  background: var(--gradient-1);
  border-radius: 50%;
}

.phone-username { font-size: 0.8rem; font-weight: 700; }
.phone-time { font-size: 0.7rem; color: var(--text-secondary); }
.phone-verified { color: #4facfe; font-size: 0.85rem; margin-left: auto; }

.phone-image {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.8rem;
  height: 150px;
}

.phone-img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a2545, #0f1629);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}

.img-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.phone-actions {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
  color: var(--text-secondary);
}

.phone-caption { font-size: 0.75rem; line-height: 1.5; }
.phone-caption-user { font-weight: 700; margin-right: 0.3rem; }
.phone-caption-text { color: var(--text-secondary); }

.phone-processing {
  margin-top: 1rem;
  text-align: center;
}

.ai-badge {
  display: inline-block;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent-light);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.7rem;
  animation: pulse 2s infinite;
}

/* ═══════════════════════════════════════════════════════════════════
   FEATURES SECTION
   ═══════════════════════════════════════════════════════════════════ */
.features, .how-it-works, .pricing {
  padding: 6rem 5%;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent-light);
  padding: 0.3rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition);
  cursor: default;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3), var(--shadow-glow);
}

.feature-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Steps ──────────────────────────────────────────────────────── */
.how-it-works {
  background: linear-gradient(180deg, transparent, rgba(108,99,255,0.03), transparent);
}

.steps {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  position: relative;
}

.step-number {
  width: 64px; height: 64px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: 0 8px 30px var(--accent-glow);
  flex-shrink: 0;
}

.step-content h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.step-content p { font-size: 0.85rem; color: var(--text-secondary); }

.step-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
  padding: 0 1rem;
  margin-top: -40px;
  flex-shrink: 0;
}

/* ─── Pricing ────────────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all var(--transition);
  position: relative;
}

.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(108,99,255,0.2);
  transform: scale(1.03);
}

.pricing-card.featured:hover { transform: scale(1.03) translateY(-4px); }

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-1);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 1rem;
  border-radius: 50px;
}

.plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.plan-price {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 2rem;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.plan-price small {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  -webkit-text-fill-color: var(--text-secondary);
}

.plan-features {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
}

.plan-features li {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.btn-plan {
  width: 100%;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent-light);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-plan:hover { background: rgba(108,99,255,0.2); }
.btn-plan.featured {
  background: var(--gradient-1);
  border: none;
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 3rem;
  border-top: 1px solid var(--border);
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════════ */
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-left {
  background: linear-gradient(135deg, #080b14, #0f1629);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  z-index: 1;
}

.auth-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
}

.auth-blob {
  position: absolute;
  width: 400px; height: 400px;
  background: linear-gradient(135deg, #6c63ff, #4facfe);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
}

.auth-icons {
  position: relative;
  z-index: 1;
  margin-bottom: 2rem;
  height: 100px;
  width: 200px;
}

.auth-icon-float {
  position: absolute;
  font-size: 2rem;
  animation: authFloat 3s ease-in-out infinite;
  animation-delay: var(--delay);
}

.auth-icon-float:nth-child(1) { top: 0; left: 10%; }
.auth-icon-float:nth-child(2) { top: 0; right: 10%; }
.auth-icon-float:nth-child(3) { bottom: 0; left: 20%; }
.auth-icon-float:nth-child(4) { bottom: 0; right: 20%; }

@keyframes authFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.auth-visual h2 {
  font-size: 2rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-visual p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.auth-right {
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-form-container {
  width: 100%;
  max-width: 420px;
}

.auth-form-container h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1rem;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-card-2);
}

.input-toggle {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}

.form-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.form-check label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.form-check a {
  color: var(--accent-light);
  cursor: pointer;
  text-decoration: none;
}

.btn-submit {
  width: 100%;
  padding: 0.9rem;
  background: var(--gradient-1);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--accent-light);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* ─── Alerts ─────────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
}

.alert-success {
  background: rgba(16,217,126,0.1);
  border: 1px solid rgba(16,217,126,0.3);
  color: var(--success);
}

.alert-warning {
  background: rgba(240,180,41,0.1);
  border: 1px solid rgba(240,180,41,0.3);
  color: var(--warning);
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(108,99,255,0.15);
  color: var(--accent-light);
  font-weight: 600;
}

.link-icon { font-size: 1.1rem; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.sidebar-avatar, .topbar-avatar {
  width: 38px; height: 38px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-username {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-plan {
  font-size: 0.75rem;
  color: var(--accent-light);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  color: #ef4444;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-logout:hover {
  background: rgba(239,68,68,0.15);
}

/* ─── Dashboard Main ─────────────────────────────────────────────── */
.dashboard-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
}

.topbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  flex: 1;
}

.tab-content {
  display: none;
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

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

/* ─── Stat Cards ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card-num {
  font-size: 2rem;
  font-weight: 800;
}

.stat-card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.1rem;
}

/* ─── Dashboard Cards ────────────────────────────────────────────── */
.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.card-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.3rem;
}

.btn-sm {
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent-light);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-sm:hover { background: rgba(108,99,255,0.2); }

/* ─── Quick Upload Zone ──────────────────────────────────────────── */
.quick-upload-zone {
  background: rgba(108,99,255,0.05);
  border: 2px dashed rgba(108,99,255,0.3);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.quick-upload-zone:hover {
  background: rgba(108,99,255,0.1);
  border-color: var(--accent);
}

.quick-upload-zone .upload-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.quick-upload-zone p { color: var(--text-secondary); font-size: 0.9rem; }
.quick-upload-zone span { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; display: block; }

/* ─── Upload Zone ────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed rgba(108,99,255,0.4);
  border-radius: var(--radius);
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1.5rem;
  position: relative;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(108,99,255,0.08);
}

.upload-zone-icon { font-size: 3rem; margin-bottom: 1rem; }
.upload-zone-content h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.upload-zone-content p { color: var(--text-secondary); margin-bottom: 1rem; }
.upload-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.8rem; }

.btn-file-select {
  display: inline-block;
  background: var(--gradient-1);
  color: white;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-file-select:hover { transform: translateY(-1px); }

/* ─── Preview Grid ───────────────────────────────────────────────── */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
}

.preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 0.4rem; right: 0.4rem;
  background: rgba(0,0,0,0.7);
  border: none;
  color: white;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.preview-remove:hover { background: var(--error); }

/* ─── Upload Actions ─────────────────────────────────────────────── */
#upload-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-upload {
  flex: 1;
  min-width: 200px;
  padding: 1rem;
  background: var(--gradient-1);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 20px var(--accent-glow);
  position: relative;
  overflow: hidden;
}
.btn-upload:hover { transform: translateY(-1px); }
.btn-upload:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.upload-progress-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: rgba(255,255,255,0.5);
  animation: progressAnim 2s linear infinite;
}

@keyframes progressAnim {
  0% { width: 0%; left: 0; }
  50% { width: 60%; left: 20%; }
  100% { width: 0%; left: 100%; }
}

.btn-clear {
  padding: 1rem 1.5rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  color: #ef4444;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-clear:hover { background: rgba(239,68,68,0.2); }

.upload-result {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
}

/* ─── Posts Grid ─────────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.post-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.post-card:hover {
  transform: scale(1.02);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.post-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.post-card-info {
  padding: 0.75rem;
}

.post-status-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-published {
  background: rgba(16,217,126,0.15);
  color: var(--success);
}

.status-processing {
  background: rgba(108,99,255,0.15);
  color: var(--accent-light);
}

.status-pending {
  background: rgba(240,180,41,0.15);
  color: var(--warning);
}

.status-failed {
  background: rgba(239,68,68,0.15);
  color: var(--error);
}

.post-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.post-delete-btn {
  position: absolute;
  top: 0.4rem; right: 0.4rem;
  background: rgba(0,0,0,0.7);
  border: none;
  color: white;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.post-card:hover .post-delete-btn { display: flex; }
.post-delete-btn:hover { background: var(--error); }

/* ─── Empty State ────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.loading-spinner { grid-column: 1 / -1; text-align: center; padding: 2rem; color: var(--text-secondary); }

/* ─── Pagination ─────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.page-btn {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ─── Settings ───────────────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
}

.settings-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  padding: 0.8rem;
  background: rgba(108,99,255,0.05);
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: var(--radius-sm);
}

.settings-info {
  padding: 0.8rem;
  background: rgba(16,217,126,0.07);
  border: 1px solid rgba(16,217,126,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--success);
  margin-bottom: 1.2rem;
}

.plan-info-card {
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.plan-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.plan-badge-sm {
  background: var(--gradient-1);
  color: white;
  padding: 0.2rem 0.7rem;
  border-radius: 50px;
  font-size: 0.75rem;
}

.quota-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.quota-bar {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 50px;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 50px;
  transition: width 0.5s ease;
}

/* ─── Filter ─────────────────────────────────────────────────────── */
.filter-select {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ─── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideInToast 0.3s ease;
  max-width: 300px;
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { border-color: rgba(16,217,126,0.4); color: var(--success); }
.toast-error   { border-color: rgba(239,68,68,0.4); color: var(--error); }
.toast-info    { border-color: rgba(108,99,255,0.4); color: var(--accent-light); }

/* ─── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  overflow: hidden;
  position: relative;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  z-index: 1;
}

.modal-content img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.modal-info {
  padding: 1.2rem;
}

.modal-status { margin-bottom: 0.5rem; }
.modal-caption {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.modal-date { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Animations ─────────────────────────────────────────────────── */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-mockup { display: none; }
  .steps { flex-direction: column; align-items: flex-start; }
  .step-arrow { transform: rotate(90deg); margin-top: 0; align-self: center; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-menu { display: flex; }
  .auth-container { grid-template-columns: 1fr; }
  .auth-left { display: none; }

  #page-dashboard.active {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    top: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 100;
    transition: left var(--transition);
  }

  .sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; }
  .tab-content { padding: 1rem; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 80px 1.5rem 40px; }
  .features, .how-it-works, .pricing { padding: 3rem 1.5rem; }
  .pricing-card.featured { transform: none; }
  .pricing-card.featured:hover { transform: translateY(-4px); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .navbar { padding: 0 1rem; }
}
