* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: #0f172a;
  color: #f8fafc;
  line-height: 1.5;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.brand { font-size: 1.25rem; font-weight: 700; color: #f8fafc; text-decoration: none; }
.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 500;
}
.nav-links a:hover { color: #f8fafc; }
.container { max-width: 960px; margin: 0 auto; padding: 2rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero .lead { color: #94a3b8; font-size: 1.125rem; margin-bottom: 2rem; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }
.card {
  display: block;
  padding: 1.5rem;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  color: #f8fafc;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: #6366f1; transform: translateY(-2px); }
.card h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.card p { margin: 0; color: #94a3b8; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.375rem; font-weight: 500; }
.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #f8fafc;
  font-size: 1rem;
  font-family: inherit;
}
.form-group textarea { min-height: 160px; resize: vertical; }
.form-group input[type="file"] { color: #cbd5e1; }
.checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.checkboxes label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #4f46e5; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid #334155; }
.tab {
  padding: 0.625rem 1rem;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active { color: #f8fafc; border-bottom-color: #6366f1; }

.progress-bar {
  width: 100%;
  height: 12px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.3s ease;
}
.status-msg { color: #94a3b8; min-height: 1.5em; }
.status-msg.error { color: #f87171; }
.status-msg.done { color: #4ade80; }

video { width: 100%; max-width: 800px; border-radius: 0.5rem; margin-top: 1rem; background: #000; }
h1, h2, h3 { color: #f8fafc; }
small { color: #94a3b8; }
.shorts-list a { display: inline-block; margin: 0.25rem 0.5rem 0.25rem 0; }

/* Flash messages */
.flash { padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; }
.flash-success { background: #052e16; color: #86efac; border: 1px solid #166534; }
.flash-error { background: #450a0a; color: #fca5a5; border: 1px solid #991b1b; }
.flash-info { background: #082f49; color: #7dd3fc; border: 1px solid #075985; }

/* Secondary button (Google login etc) */
.btn-secondary {
  background: #334155;
  color: #f8fafc;
}
.btn-secondary:hover { background: #475569; }

/* ---------- Auth pages (signup/login) — split-screen layout ---------- */
.auth-page { min-height: calc(100vh - 73px); display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .auth-page { grid-template-columns: 1fr; } }
.auth-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  padding: 4rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.auth-hero::before {
  content: ""; position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px; border-radius: 50%;
  background: rgba(255,255,255,0.08); filter: blur(40px);
}
.auth-hero::after {
  content: ""; position: absolute; bottom: -120px; left: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: rgba(0,0,0,0.15); filter: blur(60px);
}
.auth-hero .brand-lg {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.5px;
  position: relative; z-index: 1;
}
.auth-hero .tagline {
  font-size: 2.25rem; line-height: 1.15; font-weight: 700;
  margin: 2rem 0 1rem; position: relative; z-index: 1;
}
.auth-hero .sub { font-size: 1.05rem; opacity: 0.85; max-width: 380px; position: relative; z-index: 1; }
.auth-hero .feat-list {
  list-style: none; padding: 0; margin: 2rem 0 0;
  position: relative; z-index: 1;
}
.auth-hero .feat-list li {
  padding: 0.6rem 0; font-size: 1rem; opacity: 0.9;
  display: flex; align-items: center; gap: 0.75rem;
}
.auth-hero .feat-list li::before {
  content: "✓"; width: 24px; height: 24px;
  background: rgba(255,255,255,0.22); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; flex-shrink: 0;
}
.auth-hero .footnote {
  font-size: 0.85rem; opacity: 0.7; position: relative; z-index: 1;
}
.auth-hero .hero-illustration {
  position: relative; z-index: 1;
  max-width: 280px; width: 100%; height: auto;
  align-self: center;
  margin: 1rem 0;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.20));
}
@media (max-width: 900px) {
  .auth-hero .hero-illustration { max-width: 180px; }
}

.auth-form-wrap {
  padding: 3rem 2.5rem;
  display: flex; flex-direction: column; justify-content: center;
  background: #0f172a;
}
.auth-form-wrap .form-card {
  width: 100%; max-width: 420px; margin: 0 auto;
}
.auth-form-wrap h1 {
  font-size: 1.875rem; font-weight: 700; margin: 0 0 0.5rem;
}
.auth-form-wrap .form-sub { color: #94a3b8; margin: 0 0 2rem; }
.auth-form-wrap .form-group { margin-bottom: 1.125rem; }
.auth-form-wrap .form-group label {
  font-size: 0.875rem; color: #cbd5e1; font-weight: 600; margin-bottom: 0.375rem;
}
.auth-form-wrap .form-group input {
  width: 100%; padding: 0.75rem 0.95rem;
  background: #1e293b; border: 1px solid #334155; border-radius: 0.625rem;
  color: #f8fafc; font-size: 0.95rem; font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.auth-form-wrap .form-group input:focus {
  outline: none; border-color: #6366f1;
  background: #1e293b; box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.auth-form-wrap .btn { width: 100%; padding: 0.85rem; font-size: 1rem; margin-top: 0.5rem; }
.auth-form-wrap .divider {
  display: flex; align-items: center; gap: 0.75rem;
  color: #64748b; font-size: 0.85rem; margin: 1.5rem 0;
}
.auth-form-wrap .divider::before,
.auth-form-wrap .divider::after {
  content: ""; flex: 1; height: 1px; background: #334155;
}
.auth-form-wrap .google-btn {
  width: 100%; padding: 0.85rem;
  background: #fff; color: #1f2937; border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  font-size: 0.95rem; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.625rem;
  text-decoration: none; transition: transform 0.1s, box-shadow 0.15s;
}
.auth-form-wrap .google-btn:hover {
  background: #f9fafb; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.auth-form-wrap .google-btn svg { width: 18px; height: 18px; }
.auth-form-wrap .footer-link {
  margin-top: 1.5rem; color: #94a3b8; font-size: 0.95rem; text-align: center;
}
.auth-form-wrap .footer-link a { color: #818cf8; text-decoration: none; font-weight: 600; }
.auth-form-wrap .footer-link a:hover { color: #a5b4fc; text-decoration: underline; }

/* Nav user menu */
.nav-user { display: flex; align-items: center; gap: 0.75rem; color: #cbd5e1; }
.nav-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #6366f1; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; overflow: hidden;
}
.nav-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-user a { color: #cbd5e1; text-decoration: none; font-weight: 500; }
.nav-user a:hover { color: #f8fafc; }
.nav-user .logout-form { display: inline; margin: 0; padding: 0; }
.nav-user .logout-form button {
  background: none; border: none; cursor: pointer;
  color: #cbd5e1; font-weight: 500; padding: 0;
  font-family: inherit; font-size: inherit;
}
.nav-user .logout-form button:hover { color: #f8fafc; }
.nav-anon a { margin-left: 1rem; }

/* ---------- Admin dashboard ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
@media (max-width: 720px) { .admin-stats { grid-template-columns: 1fr; } }
.stat-card {
  background: linear-gradient(135deg, #1e293b 0%, #312e81 100%);
  border: 1px solid #334155;
  border-radius: 0.75rem;
  padding: 1.5rem;
}
.stat-card .stat-label { color: #94a3b8; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: #f8fafc; margin-top: 0.5rem; }
.stat-card .stat-sub { color: #818cf8; font-size: 0.85rem; margin-top: 0.4rem; }

.admin-table-wrap { overflow-x: auto; margin-top: 1rem; border: 1px solid #334155; border-radius: 0.625rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table thead { background: #1e293b; }
.admin-table th { text-align: left; padding: 0.75rem 0.875rem; color: #cbd5e1; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table td { padding: 0.7rem 0.875rem; border-top: 1px solid #1e293b; color: #e2e8f0; }
.admin-table tbody tr:hover { background: rgba(99,102,241,0.05); }
.admin-table code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; background: #1e293b; padding: 0.1rem 0.4rem; border-radius: 0.25rem; }

.badge { font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; margin-left: 0.4rem; vertical-align: middle; }
.badge-admin { background: #7c3aed; color: #fff; }

.status-pill {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; text-transform: lowercase;
}
.status-pill.status-done, .status-pill.status-paid, .status-pill.status-active { background: #052e16; color: #86efac; }
.status-pill.status-running { background: #082f49; color: #7dd3fc; }
.status-pill.status-queued { background: #1e293b; color: #cbd5e1; }
.status-pill.status-error, .status-pill.status-failed, .status-pill.status-cancelled, .status-pill.status-expired { background: #450a0a; color: #fca5a5; }
.status-pill.status-created { background: #422006; color: #fcd34d; }

/* ---------- My Videos grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.video-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.75rem;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.video-card:hover { transform: translateY(-2px); border-color: #6366f1; }
.video-thumb {
  position: relative;
  display: block;
  background: #0f172a;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-thumb video, .video-thumb-placeholder {
  width: 100%; height: 100%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.video-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.9);
  font-size: 3rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 50%, rgba(0,0,0,0.3) 100%);
  pointer-events: none;
}
.video-meta { padding: 0.875rem 1rem; }
.video-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.video-sub { color: #94a3b8; font-size: 0.8rem; margin-bottom: 0.625rem; }
.video-actions { display: flex; gap: 0.875rem; flex-wrap: wrap; }
.video-actions a, .video-actions .link-btn {
  color: #818cf8; font-size: 0.85rem; font-weight: 600; text-decoration: none;
}
.video-actions a:hover, .video-actions .link-btn:hover { color: #a5b4fc; text-decoration: underline; }
.link-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: inherit;
}
.link-btn-danger { color: #f87171 !important; }
.link-btn-danger:hover { color: #fca5a5 !important; }

.empty-state {
  text-align: center; padding: 3rem 1rem;
  background: #1e293b; border: 1px dashed #334155; border-radius: 0.75rem;
}
.empty-state .btn { margin-top: 1rem; }

/* ---------- Profile page ---------- */
.profile-header {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 2rem; background: #1e293b; border: 1px solid #334155;
  border-radius: 0.75rem; margin-bottom: 1.5rem;
}
.profile-avatar-lg {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; overflow: hidden;
  flex-shrink: 0;
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 720px) { .profile-stats { grid-template-columns: 1fr; } }
.profile-form-card {
  background: #1e293b; border: 1px solid #334155;
  border-radius: 0.75rem; padding: 1.5rem;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.profile-form-card .form-group input {
  width: 100%; padding: 0.625rem 0.75rem;
  background: #0f172a; border: 1px solid #334155; border-radius: 0.5rem;
  color: #f8fafc; font-size: 0.95rem;
}
.profile-form-card .form-group input:focus {
  outline: none; border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ---------- User dropdown in nav ---------- */
.nav-user-dropdown { position: relative; }
.nav-user-trigger {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 0.6rem;
  color: #cbd5e1; padding: 0.4rem 0.6rem; border-radius: 0.5rem;
  font: inherit;
}
.nav-user-trigger:hover { background: #1e293b; color: #fff; }
.nav-user-trigger .chevron {
  display: inline-block; transition: transform 0.2s;
  font-size: 0.75rem; opacity: 0.7;
}
.nav-user-dropdown[data-open="true"] .chevron { transform: rotate(180deg); }
.nav-user-menu {
  position: absolute; top: calc(100% + 0.4rem); right: 0;
  min-width: 200px;
  background: #1e293b; border: 1px solid #334155; border-radius: 0.625rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  padding: 0.4rem; display: none; z-index: 50;
}
.nav-user-dropdown[data-open="true"] .nav-user-menu { display: block; }
.nav-user-menu a, .nav-user-menu button {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; text-align: left;
  padding: 0.55rem 0.75rem; border-radius: 0.375rem;
  color: #cbd5e1; text-decoration: none; font-size: 0.92rem;
  background: none; border: none; cursor: pointer; font-family: inherit;
}
.nav-user-menu a:hover, .nav-user-menu button:hover { background: #0f172a; color: #fff; }
.nav-user-menu .menu-divider { height: 1px; background: #334155; margin: 0.3rem 0; }
.nav-user-menu .menu-header {
  padding: 0.5rem 0.75rem 0.7rem;
  color: #94a3b8; font-size: 0.8rem;
  border-bottom: 1px solid #334155; margin-bottom: 0.3rem;
}
.nav-user-menu .menu-header .menu-name { color: #f8fafc; font-weight: 600; }

/* ---------- Pricing page ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.pricing-card {
  position: relative;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform 0.15s, border-color 0.15s;
}
.pricing-card:hover { transform: translateY(-4px); border-color: #6366f1; }
.pricing-featured {
  border: 2px solid #6366f1;
  background: linear-gradient(180deg, #1e293b 0%, #312e81 100%);
}
.pricing-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(99,102,241,0.4);
}
.pricing-card h3 { margin: 0 0 0.5rem; font-size: 1.25rem; color: #f8fafc; }
.pricing-price { color: #f8fafc; margin: 1rem 0 0.25rem; }
.pricing-price .rupee { font-size: 1.5rem; vertical-align: top; margin-right: 2px; }
.pricing-price .amount { font-size: 3.5rem; font-weight: 700; line-height: 1; }
.pricing-credits { color: #818cf8; font-size: 1rem; font-weight: 600; margin-bottom: 1.5rem; }
.pricing-perks {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  text-align: left;
}
.pricing-perks li {
  padding: 0.45rem 0; color: #cbd5e1; font-size: 0.92rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.pricing-perks li::before {
  content: "✓"; color: #4ade80; font-weight: 700; flex-shrink: 0;
}
.pricing-card .btn { width: 100%; }
