@import "tailwindcss";

/* ================================================
   ContentGen AI — Design System
   Aesthetic Direction: Cinematic Dark + Violet Neon
   Frontend Design Skill: Bold, intentional, unforgettable
   ================================================ */

@theme {
  /* ── Color Palette ── */
  --color-bg-void: #000000;
  --color-bg-deep: #050509;
  --color-bg-base: #0a0a12;
  --color-bg-surface: #111120;
  --color-bg-elevated: #1a1a2e;
  --color-bg-subtle: #232340;

  --color-border-faint: #1e1e3a;
  --color-border-default: #2a2a4a;
  --color-border-strong: #3a3a5a;

  --color-text-primary: #f0f0ff;
  --color-text-secondary: #a0a0c0;
  --color-text-muted: #6a6a8a;
  --color-text-ghost: #4a4a6a;

  /* Brand */
  --color-violet-400: #a78bfa;
  --color-violet-500: #8b5cf6;
  --color-violet-600: #7c3aed;
  --color-violet-700: #6d28d9;
  --color-violet-glow: rgba(139, 92, 246, 0.15);

  --color-cyan-400: #22d3ee;
  --color-cyan-500: #06b6d4;
  --color-cyan-glow: rgba(6, 182, 212, 0.12);

  --color-emerald-400: #34d399;
  --color-emerald-500: #10b981;

  --color-amber-400: #fbbf24;
  --color-amber-500: #f59e0b;

  --color-rose-400: #fb7185;
  --color-rose-500: #f43f5e;

  /* ── Spacing ── */
  --spacing-page: clamp(1rem, 4vw, 2.5rem);

  /* ── Radius ── */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow-glow-sm: 0 0 12px rgba(139, 92, 246, 0.08);
  --shadow-glow-md: 0 0 24px rgba(139, 92, 246, 0.12);
  --shadow-glow-lg: 0 0 48px rgba(139, 92, 246, 0.18);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.5);

  /* ── Animations ── */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* ── Base ── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg-void);
  color: var(--color-text-primary);
  overflow-x: hidden;
  min-height: 100dvh;
}

/* ── Selection ── */
::selection {
  background-color: rgba(139, 92, 246, 0.3);
  color: white;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--color-border-default);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-strong);
}

/* ── Glass Effect ── */
.glass {
  background: rgba(17, 17, 32, 0.6);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--color-border-faint);
}

.glass-subtle {
  background: rgba(17, 17, 32, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Glow Effects ── */
.glow-violet {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15),
              0 0 40px rgba(139, 92, 246, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.glow-cyan {
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15),
              0 0 40px rgba(6, 182, 212, 0.08);
}

/* ── Gradient Borders ── */
.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--color-violet-500), var(--color-cyan-400));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
}

/* ── Animated Gradient Background ── */
.gradient-mesh {
  background-image:
    radial-gradient(ellipse at 20% 50%, var(--color-violet-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, var(--color-cyan-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
}

/* ── Card Styles ── */
.card-surface {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-faint);
  border-radius: var(--radius-xl);
  transition: all var(--duration-normal) var(--ease-out-expo);
}
.card-surface:hover {
  border-color: var(--color-border-default);
  box-shadow: var(--shadow-glow-sm);
  transform: translateY(-1px);
}

/* ── Badge Styles ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}
.badge-violet {
  background: rgba(139, 92, 246, 0.12);
  color: var(--color-violet-400);
  border: 1px solid rgba(139, 92, 246, 0.2);
}
.badge-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--color-cyan-400);
  border: 1px solid rgba(6, 182, 212, 0.2);
}
.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-amber-400);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-rose {
  background: rgba(244, 63, 94, 0.12);
  color: var(--color-rose-400);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

/* ── Button Styles ── */
.btn-primary {
  background: linear-gradient(135deg, var(--color-violet-600), var(--color-violet-500));
  color: white;
  font-weight: 600;
  border-radius: var(--radius-lg);
  padding: 0.625rem 1.25rem;
  transition: all var(--duration-normal) var(--ease-out-expo);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border-faint);
  border-radius: var(--radius-lg);
  padding: 0.625rem 1.25rem;
  transition: all var(--duration-fast) var(--ease-out-expo);
}
.btn-ghost:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
  border-color: var(--color-border-default);
}

/* ── Mobile Navigation ── */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
  background: rgba(5, 5, 9, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--color-border-faint);
}

/* ── Progress Bar ── */
.progress-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-bg-elevated);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-violet-500), var(--color-cyan-400));
  transition: width var(--duration-slow) var(--ease-out-expo);
}

/* ── Skeleton Loader ── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-surface) 25%,
    var(--color-bg-elevated) 50%,
    var(--color-bg-surface) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ── Noise Texture Overlay ── */
.noise-overlay::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}

/* ── Page Transition ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-enter {
  animation: fadeIn var(--duration-slow) var(--ease-out-expo) forwards;
}

/* ── Touch Optimization ── */
@media (hover: none) {
  .card-surface:hover {
    transform: none;
    box-shadow: var(--shadow-card);
  }
  .btn-primary:hover {
    transform: none;
  }
}

/* ── Safe Area ── */
.pb-safe {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom));
}
