/* ambient-background.css */

/* Premium Light Base Theme: Light Purple & Lavender */
:root {
  --bg-base: #F8FAFC;
  /* Clean white-blue page background */
  --bg-grid: rgba(185, 28, 28, 0.04);
  --color-purple: rgba(127, 29, 29, 0.15);
  /* Deep Blue */
  --color-mint: rgba(255, 107, 0, 0.15);
  /* Sky Blue */
  --color-accent: rgba(185, 28, 28, 0.1);
  /* Medium Blue */

  --text-primary: #0f172a;
  /* Slate 900 */
  --text-secondary: #334155;
  /* Slate 700 */
  --text-muted: #64748b;
  /* Slate 500 */

  --primary-solid: #B91C1C;
  --primary-hover: #FF6B00;
  --secondary-solid: #FF6B00;
  /* Light Blue */
  --secondary-hover: #B91C1C;
}

body {
  background-color: transparent !important;
  background-image: none !important;
  background: transparent !important;
  color: var(--text-primary) !important;
}

/* Base Ambient Container */
.ambient-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -9999;
  background-color: var(--bg-base);
  overflow: hidden;
  pointer-events: none;
}

/* Subtle Premium Grid Pattern */
.ambient-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 200vw;
  height: 200vh;
  background-size: 60px 60px;
  background-image:
    linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
  z-index: 1;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 80%);
  animation: gridMove 120s linear infinite;
  opacity: 1;
}

/* Elegant Aurora Gradient Orbs */
.ambient-aurora {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  filter: blur(140px);
  opacity: 0.6;
}

.ambient-aurora::before,
.ambient-aurora::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: float 30s infinite alternate ease-in-out;
}

.ambient-aurora::before {
  top: -15%;
  left: -5%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, var(--color-purple) 0%, transparent 70%);
  animation-duration: 35s;
}

.ambient-aurora::after {
  bottom: -15%;
  right: -5%;
  width: 80vw;
  height: 80vw;
  background: radial-gradient(circle, var(--color-mint) 0%, transparent 70%);
  animation-direction: alternate-reverse;
}

.ambient-aurora-cyan {
  position: absolute;
  top: 25%;
  left: 35%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(160px);
  animation: float 40s infinite alternate ease-in-out;
  z-index: 2;
}

/* Canvas for Floating Particles */
#ambient-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}

/* Animations */
@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(6vw, 8vh) scale(1.1);
  }

  100% {
    transform: translate(-6vw, -4vh) scale(0.95);
  }
}

@keyframes gridMove {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-60px, -60px);
  }
}

/* ── PREMIUM LIGHT GLASSMORPHISM OVERRIDES ── */

/* Remove existing pseudo-element backgrounds that might conflict */
.left-panel::before,
.left-panel::after,
.right-panel::before,
.right-panel::after {
  display: none !important;
}

/* Make structural panels elegant white frosted glass — excludes .hero and nav */
.left-panel,
.right-panel,
.card,
.features,
.pricing,
.footer,
.workspace,
.top-bar,
.main-content,
.editor-card,
.upload-zone {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  color: var(--text-primary) !important;
  border-radius: 16px;
  /* Soften edges globally for premium feel */
}

/* Navbar: clean white, no border-radius */
nav {
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(185, 28, 28, 0.08) !important;
  border-radius: 0 !important;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04) !important;
}

/* Clean frosted glass for sidebar */
.sidebar {
  background: rgba(255, 255, 255, 0.85) !important;
  /* Frosted white */
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  border-right: 1px solid rgba(185, 28, 28, 0.15) !important;
  /* Subtle blue border */
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.02) !important;
  color: var(--text-primary) !important;
  border-radius: 0;
  /* Keep sidebar flush left */
}

/* White frosted glass for canvas containers */
.empty-state,
#chartContainer,
#mermaidContainer {
  background: #ffffff !important;
  /* White */
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  border: 1px solid rgba(185, 28, 28, 0.15) !important;
  /* Blue tint border */
  box-shadow: 0 20px 40px rgba(185, 28, 28, 0.03), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  color: var(--text-primary) !important;
  border-radius: 16px;
}

/* Dark Mode Overrides for Ambient Background */
body.dark-mode {
  background-color: transparent !important;
  --bg-base: #0f172a;
  /* Slate 900 */
  --bg-grid: rgba(255, 255, 255, 0.04);
  --color-purple: rgba(127, 29, 29, 0.15);
  --color-mint: rgba(255, 107, 0, 0.15);
  --color-accent: rgba(185, 28, 28, 0.1);

  --text-primary: #ffffff;
  /* Slate 50 */
  --text-secondary: #cbd5e1;
  /* Slate 300 */
  --text-muted: #FFF3CD;
  /* Slate 400 */
}

/* Dark mode overrides for hardcoded light colors */
body.dark-mode input:not([type="checkbox"]):not([type="radio"]),
body.dark-mode select,
body.dark-mode textarea {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
}

body.dark-mode input:not([type="checkbox"]):not([type="radio"]):focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  background: #0f172a !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

body.dark-mode .btn-outline,
body.dark-mode .secondary-btn {
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .empty-state .empty-title,
body.dark-mode .empty-state .empty-desc,
body.dark-mode .empty-state .empty-subtitle {
  color: var(--text-primary) !important;
}

/* Dark mode override for structural panels */
body.dark-mode .left-panel,
body.dark-mode .right-panel,
body.dark-mode .card,
body.dark-mode nav,
body.dark-mode .hero,
body.dark-mode .features,
body.dark-mode .pricing,
body.dark-mode .footer,
body.dark-mode .workspace,
body.dark-mode .top-bar,
body.dark-mode .sidebar,
body.dark-mode .main-content,
body.dark-mode .editor-card,
body.dark-mode .upload-zone {
  background: rgba(15, 23, 42, 0.75) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
  color: var(--text-primary) !important;
}

/* Override text colors globally for light aesthetic */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary) !important;
  letter-spacing: -0.02em;
}

p,
span,
.sub,
.desc,
label {
  color: var(--text-secondary) !important;
}

/* Links */
a:not(.btn):not(.primary-btn):not(.badge):not(.logo) {
  color: var(--primary-solid) !important;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

a:not(.btn):not(.primary-btn):not(.badge):hover {
  color: var(--primary-hover) !important;
}

/* Premium Logo Treatment */
.logo {
  color: var(--primary-solid) !important;
  text-shadow: none !important;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Input Fields - Clean, Apple-like */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: var(--text-primary) !important;
  border-radius: 8px !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: all 0.2s ease !important;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  background: #ffffff !important;
  border-color: var(--primary-solid) !important;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15) !important;
  outline: none !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(185, 28, 28, 0.4) !important;
  /* Visible against white */
}

/* ── BUTTON OVERRIDES ── */
button,
.btn,
.primary-btn,
input[type="submit"] {
  background: var(--primary-solid) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50px !important;
  /* Pill shape for modern look */
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

button:hover,
.btn:hover,
.primary-btn:hover,
input[type="submit"]:hover {
  background: var(--secondary-solid) !important;
  box-shadow: 0 6px 16px rgba(255, 107, 0, 0.35) !important;
  transform: translateY(-2px) !important;
}

/* Voice Button Listening State Override */
button.voice-btn.listening {
  background: rgba(239, 68, 68, 0.8) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3) !important;
  animation: voice-pulse 1.4s ease-in-out infinite !important;
}

button.voice-btn.listening:hover {
  background: rgba(220, 38, 38, 0.9) !important;
  transform: none !important;
}

/* Secondary / Outline Buttons */
.btn-outline,
.secondary-btn {
  background: transparent !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: none !important;
}

.btn-outline:hover,
.secondary-btn:hover {
  background: rgba(0, 0, 0, 0.03) !important;
  color: var(--primary-solid) !important;
  transform: translateY(-1px) !important;
}

/* Special treatment for SVG icons */
svg {
  color: currentColor;
}

/* ── EMPTY STATE LIGHT PURPLE HIGH CONTRAST OVERRIDES ── */
.empty-state .empty-title {
  color: #0d2a4a !important;
  /* Extremely dark blue for maximum contrast */
  text-shadow: none !important;
  font-weight: 700 !important;
}

.empty-state .empty-desc,
.empty-state .empty-subtitle {
  color: #1b497d !important;
  /* Dark blue for readable descriptions */
  font-weight: 500 !important;
}

.empty-state .empty-icon {
  background: rgba(185, 28, 28, 0.12) !important;
  border: 1px solid rgba(185, 28, 28, 0.3) !important;
  box-shadow: 0 8px 24px rgba(185, 28, 28, 0.12) !important;
  filter: brightness(0.65) contrast(1.15) saturate(1.1) !important;
  /* Elegant dark tone for the emoji face */
}

/* Also for other empty-icon circles containing SVGs */
.empty-icon-circle {
  background-color: rgba(185, 28, 28, 0.12) !important;
  border: 1px solid rgba(185, 28, 28, 0.3) !important;
}

.empty-icon-circle svg {
  stroke: #1b497d !important;
}