/* PRD Design System - aiWeb */
:root {
  --bg: #F3F4F6;
  --sidebar: #FFFFFF;
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --text-dark: #111827;
  --text-light: #6B7280;
  --border: #E5E7EB;
  --card: #FFFFFF;
  --success: #22C55E;
  --danger: #EF4444;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--card);
}

/* ========== LANDING (Leonardo.ai inspired) ========== */
body.landing-page {
  background: #0f0f14;
  color: #e4e4e7;
}

html {
  scroll-behavior: smooth;
}

.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.35rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.landing-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}

.landing-nav a:hover {
  color: #fff;
}

.landing-nav .btn-nav {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.landing-nav .btn-primary {
  color: #fff;
}

/* Hero */
.landing-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
}

.hero-grid {
  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: 60px 60px;
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 720px;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #a5b4fc;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 1rem;
}

.hero-title-accent {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-cta .btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.btn-outline-light {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* Features */
.landing-features {
  padding: 5rem 1.5rem;
  background: #18181c;
}

.features-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.features-title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.features-subtitle {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #a5b4fc;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.35rem;
}

.feature-card p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  margin: 0;
}

/* CTA strip */
/* About */
.landing-about {
  padding: 4rem 1.5rem;
  background: #18181c;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.about-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 1.25rem;
}

.about-text {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.65;
  margin: 0;
}

/* Contact */
.landing-contact {
  padding: 4rem 1.5rem;
  background: #0f0f14;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.contact-options {
  margin-top: 0.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #a5b4fc;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.contact-link:hover {
  color: #c7d2fe;
}

.contact-note {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.contact-form {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-form label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.contact-form input,
.contact-form textarea {
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.7);
  padding: 0.6rem 0.75rem;
  color: #e5e7eb;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(148, 163, 184, 0.8);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.5);
  background: rgba(15, 23, 42, 0.9);
}

.contact-submit {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-submit i {
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* Landing showcase: videos + images */
.landing-showcase {
  padding: 4.5rem 1.5rem;
  overflow: hidden;
}

.landing-showcase-videos {
  background: #0f0f14;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.landing-showcase-images {
  background: #18181c;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.showcase-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.showcase-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-bottom: 0.35rem;
}

.showcase-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  margin-bottom: 2.25rem;
}

.showcase-videos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.showcase-video-item {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(24px);
  animation: showcase-fade-up 0.6s ease forwards;
}

.showcase-video-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.showcase-video-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}

.showcase-video-item {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.showcase-video-item:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.showcase-images-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.showcase-image-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(24px);
  animation: showcase-fade-up 0.6s ease forwards;
}

.showcase-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.showcase-image-item {
  transition: box-shadow 0.35s ease;
}

.showcase-image-item:hover img {
  transform: scale(1.08);
}

.showcase-image-item:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.showcase-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.2);
  font-size: 2.5rem;
}

@keyframes showcase-fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .showcase-videos-grid,
  .showcase-images-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .showcase-videos-grid,
  .showcase-images-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .landing-showcase {
    padding: 3rem 1rem;
  }
}

.landing-cta {
  padding: 4rem 1.5rem;
  background: #0f0f14;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cta-inner h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.cta-inner p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
}

/* Footer – professional layout */
.landing-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a0a0d;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.footer-logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  flex-shrink: 0;
}

.footer-logo:hover {
  color: #fff;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 13.5rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.25rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 1.5rem;
}

.footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-copyright {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

/* Legal pages (Privacy, Terms) */
.legal-page {
  min-height: 60vh;
  padding: 5rem 1.5rem 4rem;
  background: #0f0f14;
}

.legal-inner {
  max-width: 720px;
  margin: 0 auto;
}

.legal-title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.legal-updated {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2.5rem;
}

.legal-section {
  margin-bottom: 2rem;
}

.legal-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.5rem;
}

.legal-section p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.legal-section a {
  color: #a5b4fc;
  text-decoration: none;
}

.legal-section a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem 1rem;
  }
  .footer-grid {
    justify-content: center;
    gap: 2rem;
  }
  .footer-col {
    align-items: center;
  }
  .footer-bottom-inner {
    text-align: center;
  }
  .landing-nav a:not(.btn-nav) {
    display: none;
  }
  .hero-cta {
    flex-direction: column;
  }
  .hero-cta .btn-lg {
    width: 100%;
    max-width: 280px;
  }
}

/* Legacy landing (if used elsewhere) */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.landing h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.landing p {
  color: var(--text-light);
  max-width: 480px;
  margin-bottom: 2rem;
}

.landing .btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow);
}

.btn-primary.btn-loading {
  position: relative;
  color: rgba(255, 255, 255, 0.85);
}

.btn-primary.btn-loading .btn-label {
  opacity: 0.85;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  margin-right: 0.5rem;
  animation: preview-spin 0.8s linear infinite;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: var(--text-dark);
}

.btn-ghost:hover {
  background: var(--border);
}

/* ========== AUTH PAGES ========== */
.auth-page {
  min-height: 100vh;
  padding: 4.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #020617;
}

.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-page::before {
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(99, 102, 241, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 65%, rgba(139, 92, 246, 0.18) 0%, transparent 55%);
}

.auth-page::after {
  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: 60px 60px;
  opacity: 0.6;
}

.auth-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 2rem;
  align-items: stretch;
}

.auth-copy {
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-copy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 140, 248, 0.6);
  background: rgba(15, 23, 42, 0.7);
  font-size: 0.75rem;
  color: #c7d2fe;
  margin-bottom: 0.75rem;
}

.auth-copy-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.auth-copy-subtitle {
  margin: 0 0 1.75rem;
  color: rgba(209, 213, 219, 0.8);
  font-size: 0.95rem;
}

.auth-copy-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: rgba(209, 213, 219, 0.9);
}

.auth-copy-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-copy-list i {
  color: #22c55e;
  font-size: 0.9rem;
}

.auth-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-card {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 1.75rem 1.75rem 1.5rem;
  width: 100%;
}

.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
  color: #f9fafb;
}

.auth-card .subtitle {
  color: rgba(148, 163, 184, 0.9);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.375rem;
}

.form-group input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-dark);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-card .btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem;
}

.auth-card .footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.auth-card .footer-link a {
  font-weight: 500;
}

.auth-ads {
  display: grid;
  gap: 0.75rem;
}

.auth-ad-card {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(129, 140, 248, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.auth-ad-card.secondary {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(96, 165, 250, 0.1));
  border-color: rgba(52, 211, 153, 0.4);
}

.auth-ad-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.auth-ad-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-ad-text {
  font-size: 0.8rem;
  opacity: 0.9;
}

.auth-ad-pill {
  margin-top: 0.2rem;
  align-self: flex-start;
  border-radius: 999px;
  border: 1px solid rgba(248, 250, 252, 0.5);
  padding: 0.1rem 0.6rem;
  font-size: 0.7rem;
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard-wrap {
  display: flex;
  min-height: 100vh;
}

/* Sidebar - icon above label, minimal */
.sidebar {
  width: 80px;
  min-width: 80px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.sidebar-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 0.5rem;
  color: var(--text-dark);
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
  width: 56px;
  min-height: 52px;
  text-decoration: none;
}

.sidebar-nav a:hover {
  background: var(--bg);
  color: var(--primary);
}

.sidebar-nav a.active {
  background: #E5E7EB;
  color: var(--text-dark);
}

.sidebar-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: inherit;
}

.sidebar-label {
  line-height: 1.2;
  text-align: center;
  color: var(--text-light);
  font-size: 0.6875rem;
}

.sidebar-nav a.active .sidebar-label {
  color: var(--text-dark);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
  width: 100%;
}

.sidebar-footer-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-dark);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.sidebar-footer-item:hover {
  background: var(--bg);
  color: var(--primary);
}

.sidebar-profile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5a7c59 0%, #8b7355 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.sidebar-profile:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

/* Main content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top navbar */
.top-nav {
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-tabs {
  display: flex;
  gap: 0.25rem;
}

.nav-tabs a {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  border-radius: var(--radius);
}

.nav-tabs a:hover,
.nav-tabs a.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-select {
  appearance: none;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  max-width: 180px;
}

.project-select:focus {
  outline: none;
  border-color: var(--primary);
}

.credits {
  font-size: 0.875rem;
  color: var(--text-light);
}

.credits strong {
  color: var(--text-dark);
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

/* Workspace */
.workspace {
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  max-width: 100%;
  margin: 0 auto;
  min-height: 400px;
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Cards (Upload & Preview panels) */
.panel-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.panel-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.panel-card.preview-panel {
  min-height: 420px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
}

.panel-card.preview-panel .preview-area {
  flex: 1;
  min-height: 320px;
  max-height: 440px;
  height: 380px;
}

.dashboard-ad-placeholder {
  flex-shrink: 0;
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.06), rgba(129, 140, 248, 0.06));
  border: 1px dashed rgba(148, 163, 184, 0.5);
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.9);
  text-align: left;
}

.dashboard-ad-placeholder strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dashboard-ad-top {
  margin-top: 0;
  margin-bottom: 1rem;
}

.upload-zone {
  flex: 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.04);
}

.upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.preview-area {
  flex: 1;
  min-height: 280px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--text-light);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-area.has-content {
  color: var(--text-dark);
}

.preview-image-wrap {
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg);
  flex-shrink: 0;
}

.preview-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 8px;
  vertical-align: top;
}

/* Play overlay + timeline for generated previews */
.preview-image-wrap.has-play {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.65);
}

.preview-play-btn i {
  margin-left: 2px;
}

.preview-play-btn:hover {
  transform: scale(1.03);
  background: rgba(15, 23, 42, 0.9);
}

.preview-play-btn:active {
  transform: scale(0.97);
}

.preview-play-btn[disabled] {
  opacity: 0.65;
  cursor: default;
}

.preview-download-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.6);
}

.preview-download-btn:hover {
  background: rgba(15, 23, 42, 1);
  transform: translateY(-1px);
}

.preview-download-btn:active {
  transform: translateY(0);
}

.preview-download-btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.preview-timeline {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 14px;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  overflow: hidden;
}

.preview-timeline-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width 0.1s linear;
}

.preview-progress-wrap {
  padding: 1rem;
  text-align: center;
}

.preview-progress-text {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-light);
}

.preview-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.preview-progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.05s linear;
}

/* Overlay when generating */
.preview-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  backdrop-filter: blur(2px);
}

.preview-overlay.visible {
  display: flex;
}

.preview-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
}

.preview-overlay-spinner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: preview-spin 0.8s linear infinite;
}

.preview-overlay-text {
  font-weight: 500;
}

@keyframes preview-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error modal */
.error-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.error-modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
  max-width: 360px;
  width: 90%;
}

.error-modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
}

.error-modal.status-success .error-modal-title {
  color: var(--success);
}

.error-modal.status-error .error-modal-title {
  color: var(--danger);
}

.error-modal-text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.error-modal .btn {
  width: 100%;
}

/* Upgrade / Spin & Win modal */
.upgrade-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.upgrade-modal-backdrop.visible {
  display: flex;
}

.upgrade-modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.85);
  padding: 1.75rem 1.75rem 1.5rem;
  max-width: 420px;
  width: 90%;
  border: 1px solid rgba(129, 140, 248, 0.4);
  position: relative;
}

.upgrade-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.upgrade-modal-close:hover {
  background: rgba(148, 163, 184, 0.35);
  color: var(--text-dark);
}

.upgrade-modal-title {
  margin: 0 2.25rem 0.4rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
}

.upgrade-modal-text {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.upgrade-wheel-wrapper {
  margin: 0 auto 1rem;
  width: 240px;
  position: relative;
}

.upgrade-result-txt {
  min-height: 1.5em;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

/* Wheel outer circle */
.upgrade-wheel-outer {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  position: relative;
  overflow: visible;
}

.upgrade-wheel-outer::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  margin-left: -12px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 12px 16px 12px;
  border-color: transparent transparent #6366f1 transparent;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Inner rotating wheel with 6 segments */
.upgrade-inner-wheel {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
  transition: transform 5.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Triangle segments: 60° each, centered at 30°, 90°, ... */
.upgrade-sec {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 107px 62px 0 62px;
  border-color: #4f46e5 transparent transparent transparent;
  transform-origin: 62px 106px;
  left: 48px;
  top: -4px;
}

.upgrade-sec span {
  position: absolute;
  top: -85px;
  left: -18px;
  width: 36px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.upgrade-sec:nth-child(1) { transform: rotate(60deg);   border-color: #4f46e5 transparent transparent transparent; }
.upgrade-sec:nth-child(2) { transform: rotate(120deg);  border-color: #6366f1 transparent transparent transparent; }
.upgrade-sec:nth-child(3) { transform: rotate(180deg);   border-color: #7c3aed transparent transparent transparent; }
.upgrade-sec:nth-child(4) { transform: rotate(240deg);  border-color: #2563eb transparent transparent transparent; }
.upgrade-sec:nth-child(5) { transform: rotate(300deg);   border-color: #0ea5e9 transparent transparent transparent; }
.upgrade-sec:nth-child(6) { transform: rotate(360deg);  border-color: #06b6d4 transparent transparent transparent; }

/* Center spin button */
.upgrade-spin-btn {
  width: 56px;
  height: 56px;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  z-index: 1000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  user-select: none;
  border: none;
  font: inherit;
  padding: 0;
}

.upgrade-spin-btn:disabled {
  pointer-events: none;
  opacity: 0.85;
  cursor: default;
}

.upgrade-spin-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -22px 0 0 -22px;
  background: radial-gradient(ellipse at 30% 30%, #fff, #e5e7eb);
  box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 0 8px rgba(0,0,0,0.15);
}

.upgrade-spin-label {
  position: relative;
  z-index: 2;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  text-shadow: 0 1px 0 #fff;
}

.upgrade-spin-btn:active .upgrade-spin-inner {
  box-shadow: 0 0 8px rgba(0,0,0,0.25) inset;
}

/* Shine overlay */
.upgrade-wheel-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse 70% 70% at 50% 30%, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 60%);
  pointer-events: none;
}

/* Ad placement – shared by all modals */
.modal-ad-placeholder,
.upgrade-ad-placeholder {
  margin-top: 0.75rem;
  padding: 0.75rem 0.8rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(129, 140, 248, 0.08));
  border: 1px dashed rgba(148, 163, 184, 0.6);
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.95);
  text-align: left;
}

.modal-ad-placeholder strong,
.upgrade-ad-placeholder strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@keyframes upgrade-spin-bump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.96); }
}

/* ========== GENERATE PANEL (Upload sidebar) ========== */
.generate-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  overflow: hidden;
}

.generate-header {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.output-mode {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.output-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.output-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.output-option i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.output-option:hover {
  background: var(--bg);
  color: var(--text-dark);
}

.output-option.active,
.output-option:has(input:checked) {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
}

.generate-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.generate-panels {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
}

.input-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-layout.hidden {
  display: none !important;
}

.input-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}

.video-input-panel .upload-zone,
.motion-image-panel .upload-zone {
  min-height: 90px;
}

.prompt-panel-full .prompt-textarea {
  min-height: 120px;
}

.start-frame-panel {
  flex: 0 0 auto;
}

.start-frame-zone {
  padding: 1rem;
  min-height: 100px;
}

.start-frame-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.start-frame-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  margin: 0;
}

.start-frame-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.start-frame-preview {
  position: relative;
  width: 100%;
  text-align: center;
}

.start-frame-preview img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
}

.start-frame-preview .clear-start-frame,
.start-frame-preview .clear-motion-video,
.start-frame-preview .clear-motion-image {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  padding: 0.25rem;
}

.video-upload-zone .start-frame-preview video,
.motion-image-zone .start-frame-preview img {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
  margin: 0 auto;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-icon {
  padding: 0.5rem;
}

.btn-icon span {
  display: none;
}

.prompt-panel {
  flex: 1;
  min-height: 80px;
}

.prompt-textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-dark);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-textarea::placeholder {
  color: var(--text-light);
}

.prompt-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.settings-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.mode-settings {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.mode-settings.hidden {
  display: none !important;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius);
  cursor: pointer;
  background: transparent;
  color: var(--text-dark);
  border: none;
  transition: background 0.2s, color 0.2s;
}

.toolbar-btn:hover {
  background: var(--border);
  color: var(--primary);
}

.toolbar-spacer {
  flex: 1;
  min-width: 0.5rem;
}

.toolbar-select {
  position: relative;
  display: flex;
  align-items: center;
}

.toolbar-select select {
  appearance: none;
  padding: 0.5rem 1.75rem 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-dark);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.toolbar-select select:focus {
  outline: none;
  border-color: var(--primary);
}

.toolbar-select i {
  position: absolute;
  right: 0.5rem;
  pointer-events: none;
  font-size: 0.75rem;
  color: var(--text-light);
}

.model-select select {
  padding-right: 1.5rem;
  min-width: 6rem;
}

.generate-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.generate-footer .btn-primary {
  margin-left: auto;
}

/* Generate panel responsive */
@media (max-width: 600px) {
  .generate-panel {
    min-height: 280px;
  }

  .output-mode {
    flex-direction: row;
    justify-content: flex-start;
  }

  .output-option {
    flex: 1;
    justify-content: center;
  }

  .settings-toolbar {
    padding: 0.5rem 0;
  }

  .toolbar-btn span {
    display: none;
  }

  .toolbar-select select {
    min-width: 0;
    padding-right: 1.5rem;
  }

  .generate-footer {
    padding-top: 0.5rem;
  }

  .generate-footer .btn-primary {
    width: 100%;
    margin-left: 0;
  }
}

/* Nav links (landing) */
.nav-landing {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.75rem;
}

.nav-landing .btn {
  font-size: 0.875rem;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ========== WORKFLOW PAGE ========== */
.workflow-page {
  padding: 1.5rem;
}

.workflow-header {
  margin: 0 auto 1.5rem;
}

.workflow-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--text-dark);
}

.workflow-header p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 100%;
}

.workflow-ad-placeholder {
  grid-column: 1 / -1;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.06), rgba(129, 140, 248, 0.06));
  border: 1px dashed rgba(148, 163, 184, 0.5);
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.9);
  text-align: left;
}

.workflow-ad-placeholder strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workflow-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.workflow-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.workflow-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #020617;
  overflow: hidden;
}

.workflow-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 0.9;
}

.workflow-video-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.workflow-card:hover .workflow-video-wrap video {
  transform: scale(1.04);
  opacity: 1;
}

.workflow-use-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateY(10px);
  background: #111827;
  color: #fff;
  border-radius: 999px;
  border: none;
  padding: 0.5rem 1.3rem;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}

.workflow-use-btn::after {
  content: '→';
  font-size: 0.9em;
}

.workflow-card:hover .workflow-use-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.workflow-use-btn:hover {
  background: #020617;
}

.workflow-card-body {
  padding: 1rem 1rem 1.1rem;
}

.workflow-card-title {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-dark);
}

.workflow-card-text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.workflow-empty {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

@media (max-width: 768px) {
  .workflow-page {
    padding: 1rem 1rem 2rem;
  }
  .workflow-header {
    text-align: center;
  }
  .workflow-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== CHAT PAGE ========== */
.chat-page {
  padding: 1.5rem;
  height: 100%;
  min-height: 0;
}

.chat-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  height: 100%;
  min-height: 420px;
  max-height: calc(100vh - 140px);
}

.chat-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-box {
  flex: 1;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-msg {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 92%;
}

.chat-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.chat-msg.user .chat-msg-avatar {
  background: rgba(99, 102, 241, 0.25);
}

.chat-msg-bubble {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.chat-msg.user .chat-msg-bubble {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.chat-msg-bubble p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-dark);
}

.chat-input-wrap {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--card);
  color: var(--text-dark);
}

.chat-input:focus {
  outline: none;
  border-color: var(--primary);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-send-btn:hover {
  background: var(--primary-hover);
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  overflow-y: auto;
}

.chat-sidebar-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.chat-faq-section {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}

.chat-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-faq {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.chat-faq:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.chat-faq strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.chat-faq p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.45;
}

.chat-ad-placeholder {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.06), rgba(129, 140, 248, 0.06));
  border: 1px dashed rgba(148, 163, 184, 0.5);
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.9);
  text-align: left;
}

.chat-ad-placeholder strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chat-ad-top {
  margin-bottom: 1rem;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .chat-layout {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .chat-sidebar {
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .chat-faq-section {
    flex: 1;
    min-width: 260px;
  }
  .chat-ad-placeholder {
    flex: 1;
    min-width: 200px;
  }
}

/* ========== PROJECTS PAGE ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
}

.project-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.project-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.project-card-image {
  aspect-ratio: 16 / 10;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

.project-card-placeholder i {
  font-size: 2rem;
  opacity: 0.6;
}

.project-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.project-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-date {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin: 0;
}

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.project-card-actions .btn-primary {
  flex: 1;
}

.projects-empty {
  color: var(--text-light);
  font-size: 0.9375rem;
  margin: 0;
  padding: 2rem;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .auth-inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .auth-copy {
    text-align: center;
    align-items: center;
  }
  .auth-copy-list {
    justify-items: center;
  }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .dashboard-wrap {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .sidebar-nav a {
    width: 52px;
    min-height: 48px;
    padding: 0.4rem 0.25rem;
  }

  .sidebar-footer {
    flex-direction: row;
    justify-content: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    width: 100%;
  }

  .sidebar-nav a.active {
    box-shadow: none;
    background: #E5E7EB;
  }

  .nav-landing {
    position: static;
    justify-content: center;
    margin-top: 1rem;
  }

  .landing {
    padding: 1.5rem 1rem;
  }

  .auth-page {
    padding: 1.5rem 1rem;
  }
}
