/* ═══════════════════════════════════════════════════════════════
   TODAYE AI — CINEMATIC LUXURY LAYER
   "Begin Again." — Warm, editorial, alive.
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts injected via CSS ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&family=Crimson+Pro:ital,wght@0,300;0,400;1,300;1,400&display=swap');

/* ── Root Design Tokens ── */
:root {
  --gold: #C8A55C;
  --gold-soft: #E8D5A3;
  --gold-glow: rgba(200, 165, 92, 0.15);
  --cream: #FDF8F0;
  --cream-warm: #FAF4E8;
  --ivory: #FFFEF9;
  --charcoal: #2C2C2C;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6B6B;
  --text-muted: #9B9B9B;
  --teal: #0D9488;
  --teal-soft: rgba(13, 148, 136, 0.08);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.45);
  --shadow-soft: 0 2px 20px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.03);
  --shadow-elevated: 0 8px 48px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-gold: 0 4px 24px rgba(200, 165, 92, 0.12);
  --radius-card: 20px;
  --radius-pill: 50px;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-editorial: 'Crimson Pro', 'Playfair Display', Georgia, serif;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-spring: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Global Reset & Base ── */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans) !important;
  color: var(--text-primary);
  background: var(--cream) !important;
  letter-spacing: -0.01em;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Main App Wrapper — Warm cinematic gradient ── */
.min-h-screen.flex.flex-col {
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(200, 165, 92, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(13, 148, 136, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(253, 248, 240, 0.9) 0%, transparent 100%),
    linear-gradient(175deg, #FDF8F0 0%, #FAF4E8 35%, #F0FDF4 65%, #FDF8F0 100%) !important;
}

/* ── Header / Top Bar ── */
.flex.items-center.justify-between.p-4 {
  padding: 16px 24px !important;
  backdrop-filter: blur(20px);
  background: rgba(253, 248, 240, 0.85) !important;
  border-bottom: 1px solid rgba(200, 165, 92, 0.12) !important;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── ClaudiaTai name — serif elegance ── */
.text-sm.font-semibold.text-gray-800 {
  font-family: var(--font-serif) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em;
  color: var(--charcoal) !important;
}

/* ── Status text — refined ── */
.text-\[10px\].text-gray-400 {
  font-family: var(--font-sans) !important;
  font-size: 10px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold) !important;
  font-weight: 500 !important;
}

/* ── Avatar — luxury ring ── */
.w-10.h-10.rounded-full,
.w-8.h-8.rounded-full {
  border: 2px solid var(--gold-soft) !important;
  box-shadow: 0 2px 12px rgba(200, 165, 92, 0.2), 0 0 0 3px rgba(200, 165, 92, 0.08) !important;
  transition: var(--transition-smooth);
}

.w-10.h-10.rounded-full:hover,
.w-8.h-8.rounded-full:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 20px rgba(200, 165, 92, 0.3), 0 0 0 4px rgba(200, 165, 92, 0.12) !important;
}

/* ── Online indicator — golden pulse ── */
.bg-green-400.border-2.border-white.rounded-full {
  background: var(--gold) !important;
  border-color: var(--cream) !important;
  animation: golden-pulse 3s ease-in-out infinite;
}

@keyframes golden-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 165, 92, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(200, 165, 92, 0); }
}

/* ═══════════════════════════════════════════════════════════════
   CHAT MESSAGES — Editorial, warm, alive
   ═══════════════════════════════════════════════════════════════ */

/* ── Chat area padding ── */
.flex-1.overflow-y-auto {
  padding: 24px 20px !important;
}

/* ── Message container ── */
.flex.justify-start.group\/msg,
.flex.justify-end.group\/msg {
  margin-bottom: 6px !important;
  animation: msg-enter 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes msg-enter {
  from { 
    opacity: 0; 
    transform: translateY(12px) scale(0.98); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

/* ── ClaudiaTai messages — warm glass ── */
.bg-white\/92,
[class*="bg-white/92"] {
  background: linear-gradient(135deg, rgba(253, 248, 240, 0.95), rgba(255, 255, 255, 0.9)) !important;
  border: 1px solid rgba(200, 165, 92, 0.15) !important;
  box-shadow: var(--shadow-card) !important;
  border-radius: 20px 20px 20px 4px !important;
  padding: 16px 20px !important;
  font-size: 14.5px !important;
  line-height: 1.7 !important;
  color: var(--text-primary) !important;
  font-family: var(--font-sans) !important;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.bg-white\/92::before,
[class*="bg-white/92"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 165, 92, 0.3), transparent);
}

.bg-white\/92:hover,
[class*="bg-white/92"]:hover {
  box-shadow: var(--shadow-elevated) !important;
  transform: translateY(-1px);
}

/* ── User messages — teal glass ── */
.bg-gradient-to-br.from-teal-500.to-teal-600,
[class*="bg-gradient-to-br"][class*="from-teal-500"] {
  background: linear-gradient(135deg, #0D9488, #0F766E) !important;
  border: none !important;
  box-shadow: 0 4px 24px rgba(13, 148, 136, 0.25), 0 1px 4px rgba(0, 0, 0, 0.05) !important;
  border-radius: 20px 20px 4px 20px !important;
  padding: 16px 20px !important;
  font-size: 14.5px !important;
  line-height: 1.7 !important;
  color: white !important;
  transition: var(--transition-smooth);
}

/* ── Message action buttons — refined ── */
.group-hover\/msg\:opacity-100 {
  backdrop-filter: blur(12px);
}

[class*="text-[10px]"][class*="bg-white/90"][class*="rounded-lg"] {
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
  border-radius: 10px !important;
  padding: 4px 10px !important;
  background: rgba(253, 248, 240, 0.95) !important;
  border-color: rgba(200, 165, 92, 0.2) !important;
  transition: var(--transition-smooth);
}

/* ═══════════════════════════════════════════════════════════════
   TOOLS GRID — Premium cards with depth
   ═══════════════════════════════════════════════════════════════ */

/* ── Grid layout — wider gaps ── */
.grid.grid-cols-3.gap-2 {
  gap: 12px !important;
  padding: 20px !important;
}

/* ── Tool cards — luxury glass with hover lift ── */
.grid.grid-cols-3 > button,
.grid.grid-cols-3 > div,
[class*="p-4"][class*="bg-white/70"][class*="backdrop-blur"][class*="rounded-2xl"] {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(253, 248, 240, 0.75)) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(200, 165, 92, 0.12) !important;
  border-radius: var(--radius-card) !important;
  padding: 20px !important;
  box-shadow: var(--shadow-soft) !important;
  transition: var(--transition-spring) !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

[class*="p-4"][class*="bg-white/70"][class*="backdrop-blur"][class*="rounded-2xl"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(200, 165, 92, 0.05), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  border-radius: inherit;
}

[class*="p-4"][class*="bg-white/70"][class*="backdrop-blur"][class*="rounded-2xl"]:hover {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(200, 165, 92, 0.15) !important;
  border-color: rgba(200, 165, 92, 0.25) !important;
}

[class*="p-4"][class*="bg-white/70"][class*="backdrop-blur"][class*="rounded-2xl"]:hover::after {
  opacity: 1;
}

/* ── Special gradient cards (Generation Engine, etc.) ── */
[class*="bg-gradient-to-br"][class*="from-purple-50"] {
  background: linear-gradient(145deg, rgba(243, 232, 255, 0.85), rgba(253, 248, 240, 0.75)) !important;
  border-color: rgba(168, 85, 247, 0.15) !important;
}

[class*="bg-gradient-to-br"][class*="from-teal-50"][class*="to-green-50"] {
  background: linear-gradient(145deg, rgba(204, 251, 241, 0.6), rgba(253, 248, 240, 0.75)) !important;
  border-color: rgba(13, 148, 136, 0.15) !important;
}

[class*="bg-gradient-to-br"][class*="from-amber-50"] {
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.85), rgba(253, 248, 240, 0.75)) !important;
  border-color: rgba(200, 165, 92, 0.2) !important;
}

[class*="bg-gradient-to-br"][class*="from-blue-50"] {
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.6), rgba(253, 248, 240, 0.75)) !important;
  border-color: rgba(59, 130, 246, 0.15) !important;
}

/* ── Tool card emoji icons — larger, with glow ── */
.text-xl.block.mb-1 {
  font-size: 28px !important;
  margin-bottom: 8px !important;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

/* ── Tool card labels — serif, editorial ── */
.text-xs.text-gray-600.font-medium {
  font-family: var(--font-serif) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.01em;
}

/* ── Purple labels ── */
.text-xs.text-purple-700.font-medium {
  font-family: var(--font-serif) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #7C3AED !important;
}

/* ── Teal labels ── */
.text-xs.text-teal-700.font-medium {
  font-family: var(--font-serif) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--teal) !important;
}

/* ── Amber labels ── */
.text-xs.text-amber-700.font-medium {
  font-family: var(--font-serif) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #B45309 !important;
}

/* ═══════════════════════════════════════════════════════════════
   INPUT BAR — Floating luxury glass
   ═══════════════════════════════════════════════════════════════ */

/* ── Input container ── */
.sticky.bottom-0 {
  background: rgba(253, 248, 240, 0.85) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  border-top: 1px solid rgba(200, 165, 92, 0.1) !important;
  padding: 16px 24px !important;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.03) !important;
}

/* ── Input field — warm glass ── */
input[type="text"],
.flex-1.bg-white\/70,
[class*="flex-1"][class*="bg-white/70"][class*="rounded-2xl"] {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1.5px solid rgba(200, 165, 92, 0.18) !important;
  border-radius: var(--radius-pill) !important;
  padding: 14px 22px !important;
  font-size: 15px !important;
  font-family: var(--font-sans) !important;
  color: var(--text-primary) !important;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03) !important;
}

input[type="text"]:focus,
.flex-1.bg-white\/70:focus,
[class*="flex-1"][class*="bg-white/70"][class*="rounded-2xl"]:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(200, 165, 92, 0.1), 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  outline: none !important;
}

input::placeholder {
  color: var(--text-muted) !important;
  font-style: italic;
  font-family: var(--font-editorial) !important;
}

/* ── Send button — golden gradient ── */
button[class*="rounded-2xl"][class*="bg-gradient-to-r"],
button[class*="bg-teal"] {
  background: linear-gradient(135deg, var(--gold), #B8944E) !important;
  border: none !important;
  border-radius: var(--radius-pill) !important;
  padding: 14px 20px !important;
  box-shadow: var(--shadow-gold) !important;
  transition: var(--transition-spring) !important;
  color: white !important;
  font-weight: 600 !important;
}

button[class*="rounded-2xl"][class*="bg-gradient-to-r"]:hover,
button[class*="bg-teal"]:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 6px 32px rgba(200, 165, 92, 0.3) !important;
}

/* ── Disabled send — muted gold ── */
button[class*="cursor-not-allowed"] {
  background: rgba(200, 165, 92, 0.15) !important;
  color: rgba(200, 165, 92, 0.4) !important;
  box-shadow: none !important;
}

/* ── Attachment/voice buttons ── */
.text-lg.px-2.py-2.rounded-xl {
  color: var(--gold) !important;
  border-radius: 14px !important;
  transition: var(--transition-smooth);
}

.text-lg.px-2.py-2.rounded-xl:hover {
  background: var(--gold-glow) !important;
  color: #A88A3D !important;
  transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════
   TOP BUTTONS — Work Feed, User badge
   ═══════════════════════════════════════════════════════════════ */

/* ── Work Feed button — golden ── */
button[style*="linear-gradient(135deg, rgb(5, 150, 105)"] {
  background: linear-gradient(135deg, var(--gold), #A88A3D) !important;
  border: 1px solid rgba(200, 165, 92, 0.5) !important;
  box-shadow: var(--shadow-gold) !important;
  border-radius: 20px !important;
  font-family: var(--font-sans) !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 11px !important;
}

/* ── User badge — refined ── */
button[style*="backdrop-filter: blur(20px)"] {
  border: 1px solid rgba(200, 165, 92, 0.3) !important;
  border-radius: 24px !important;
  background: rgba(253, 248, 240, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  font-family: var(--font-sans) !important;
  color: var(--charcoal) !important;
  box-shadow: var(--shadow-soft) !important;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN / MODALS — Frosted luxury
   ═══════════════════════════════════════════════════════════════ */

/* ── Modal backdrop ── */
[style*="position: fixed"][style*="z-index: 5"] {
  backdrop-filter: blur(16px) saturate(120%) !important;
  background: rgba(253, 248, 240, 0.7) !important;
}

/* ── Login card ── */
[style*="background: white"][style*="border-radius"],
[style*="background: rgb(255, 255, 255)"][style*="border-radius"] {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(253, 248, 240, 0.9)) !important;
  border: 1px solid rgba(200, 165, 92, 0.15) !important;
  box-shadow: var(--shadow-elevated), 0 0 0 1px rgba(200, 165, 92, 0.05) !important;
  border-radius: 24px !important;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR — Ultra-refined
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(200, 165, 92, 0.25);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 165, 92, 0.45);
}

/* ═══════════════════════════════════════════════════════════════
   SELECTION — On-brand
   ═══════════════════════════════════════════════════════════════ */

::selection {
  background: rgba(200, 165, 92, 0.2);
  color: var(--charcoal);
}

/* ═══════════════════════════════════════════════════════════════
   BOLD TEXT — Gold accent
   ═══════════════════════════════════════════════════════════════ */

strong, b {
  color: var(--gold) !important;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   RICH TEXT RENDERING
   ═══════════════════════════════════════════════════════════════ */

/* ── Code blocks — warm dark ── */
pre, code {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace !important;
  border-radius: 14px !important;
}

pre {
  background: #1E1E1E !important;
  border: 1px solid rgba(200, 165, 92, 0.15) !important;
  box-shadow: var(--shadow-card) !important;
  padding: 20px !important;
}

/* ── Inline code ── */
code:not(pre code) {
  background: rgba(200, 165, 92, 0.08) !important;
  color: #B45309 !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  font-size: 0.9em !important;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS — Cinematic entrance
   ═══════════════════════════════════════════════════════════════ */

@keyframes luxury-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes luxury-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

/* ── Staggered card entrance ── */
.grid.grid-cols-3 > *:nth-child(1) { animation: luxury-fade-in 0.6s ease both 0.05s; }
.grid.grid-cols-3 > *:nth-child(2) { animation: luxury-fade-in 0.6s ease both 0.1s; }
.grid.grid-cols-3 > *:nth-child(3) { animation: luxury-fade-in 0.6s ease both 0.15s; }
.grid.grid-cols-3 > *:nth-child(4) { animation: luxury-fade-in 0.6s ease both 0.2s; }
.grid.grid-cols-3 > *:nth-child(5) { animation: luxury-fade-in 0.6s ease both 0.25s; }
.grid.grid-cols-3 > *:nth-child(6) { animation: luxury-fade-in 0.6s ease both 0.3s; }
.grid.grid-cols-3 > *:nth-child(7) { animation: luxury-fade-in 0.6s ease both 0.35s; }
.grid.grid-cols-3 > *:nth-child(8) { animation: luxury-fade-in 0.6s ease both 0.4s; }
.grid.grid-cols-3 > *:nth-child(9) { animation: luxury-fade-in 0.6s ease both 0.45s; }
.grid.grid-cols-3 > *:nth-child(10) { animation: luxury-fade-in 0.6s ease both 0.5s; }
.grid.grid-cols-3 > *:nth-child(11) { animation: luxury-fade-in 0.6s ease both 0.55s; }
.grid.grid-cols-3 > *:nth-child(12) { animation: luxury-fade-in 0.6s ease both 0.6s; }
.grid.grid-cols-3 > *:nth-child(n+13) { animation: luxury-fade-in 0.6s ease both 0.65s; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile luxury
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .grid.grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  [class*="p-4"][class*="bg-white/70"][class*="backdrop-blur"][class*="rounded-2xl"] {
    padding: 14px !important;
  }

  .text-xl.block.mb-1 {
    font-size: 24px !important;
  }

  .text-xs.text-gray-600.font-medium,
  .text-xs.text-purple-700.font-medium,
  .text-xs.text-teal-700.font-medium,
  .text-xs.text-amber-700.font-medium {
    font-size: 12px !important;
  }
  
  .sticky.bottom-0 {
    padding: 12px 16px !important;
  }
}

@media (max-width: 480px) {
  .grid.grid-cols-3 {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   SUBTLE GRAIN TEXTURE — Premium paper feel
   ═══════════════════════════════════════════════════════════════ */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 10000;
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px;
}

/* ═══════════════════════════════════════════════════════════════
   FLOATING PARTICLES — Gold instead of teal
   ═══════════════════════════════════════════════════════════════ */

[style*="color: rgba(13, 148, 136, 0.3)"] {
  color: rgba(200, 165, 92, 0.25) !important;
}

/* ═══════════════════════════════════════════════════════════════
   FOCUS STATES — Accessible & beautiful
   ═══════════════════════════════════════════════════════════════ */

:focus-visible {
  outline: 2px solid var(--gold) !important;
  outline-offset: 2px;
  border-radius: 8px;
}

/* No dark mode. Light. Warm. Life-giving. Always. */
@media (prefers-color-scheme: dark) {
  html, body {
    color-scheme: light !important;
  }
}
