/* ==========================================================================
   OmniCraft AI — Cyber Violet & Multi-Theme System
   ========================================================================== */

:root {
  --bg-primary: #0b0616;
  --bg-surface: rgba(22, 13, 38, 0.85);
  --bg-card: rgba(30, 18, 52, 0.8);
  --bg-card-hover: rgba(42, 25, 72, 0.9);
  --bg-input: rgba(14, 8, 25, 0.9);

  --border-color: rgba(139, 92, 246, 0.25);
  --border-glow: rgba(168, 85, 247, 0.5);

  --text-primary: #f8fafc;
  --text-secondary: #a78bfa;
  --text-muted: #7c3aed;

  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --accent-primary: #a855f7;
  --accent-orange: linear-gradient(135deg, #f97316 0%, #ef4444 100%);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* 🟢 Neon Emerald Theme */
[data-theme="emerald"] {
  --bg-primary: #041814;
  --bg-surface: rgba(9, 38, 32, 0.85);
  --bg-card: rgba(14, 52, 44, 0.8);
  --bg-card-hover: rgba(20, 70, 60, 0.9);
  --bg-input: rgba(5, 24, 20, 0.9);

  --border-color: rgba(16, 185, 129, 0.3);
  --border-glow: rgba(52, 211, 153, 0.6);

  --text-primary: #f0fdf4;
  --text-secondary: #6ee7b7;
  --text-muted: #059669;

  --accent-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --accent-primary: #10b981;
}

/* ⚡ Electric Cyan Theme */
[data-theme="cyan"] {
  --bg-primary: #05131f;
  --bg-surface: rgba(10, 32, 50, 0.85);
  --bg-card: rgba(15, 45, 70, 0.8);
  --bg-card-hover: rgba(22, 60, 92, 0.9);
  --bg-input: rgba(6, 20, 32, 0.9);

  --border-color: rgba(6, 182, 212, 0.3);
  --border-glow: rgba(56, 189, 248, 0.6);

  --text-primary: #f0f9ff;
  --text-secondary: #7dd3fc;
  --text-muted: #0891b2;

  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #38bdf8 100%);
  --accent-primary: #06b6d4;
}

/* 🔮 Sunset Rose Theme */
[data-theme="sunset"] {
  --bg-primary: #1a0914;
  --bg-surface: rgba(42, 14, 33, 0.85);
  --bg-card: rgba(58, 20, 46, 0.8);
  --bg-card-hover: rgba(78, 28, 62, 0.9);
  --bg-input: rgba(26, 8, 20, 0.9);

  --border-color: rgba(244, 63, 94, 0.3);
  --border-glow: rgba(251, 146, 60, 0.6);

  --text-primary: #fff1f2;
  --text-secondary: #fda4af;
  --text-muted: #e11d48;

  --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
  --accent-primary: #f43f5e;
}

/* ☀️ Modern Light Theme */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --bg-input: #ffffff;

  --border-color: rgba(0, 0, 0, 0.12);
  --border-glow: rgba(99, 102, 241, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-primary: #6366f1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Glowing Orbs */
.background-glows {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.35;
}

.glow-1 { top: -10%; left: 10%; width: 550px; height: 550px; background: var(--accent-primary); }
.glow-2 { bottom: 10%; right: 10%; width: 650px; height: 650px; background: #ec4899; }
.glow-3 { top: 40%; left: -10%; width: 450px; height: 450px; background: #06b6d4; }

.app-layout {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 1. ADSENSE CONTAINER & TOP BANNER */
.ad-container, .top-ad-banner {
  width: 100%;
}

.ad-placeholder, .top-ad-banner {
  width: 100%;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  text-align: center;
  background: var(--bg-surface);
}

.ad-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
  display: block;
}

.ad-content-slot p, .ad-text {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 2. HEADER NAVBAR */
.main-header, .app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-text h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-box, .brand-logo {
  width: 42px;
  height: 42px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.45);
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-selector-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
}

.theme-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.theme-dropdown {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.btn-donate, .btn-donate-glow {
  background: var(--accent-orange);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 3. HORIZONTAL NAV TABS CONTAINER */
.tool-nav, .nav-tabs-container {
  display: flex;
  gap: 10px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  padding: 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-glow);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* 4. MAIN CONTENT GRID (2 COLUMNS) */
.main-content {
  width: 100%;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 20px;
}

.panel-area {
  width: 100%;
}

.tool-panel {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
}

.tool-panel.active {
  display: block;
}

.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.panel-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.badge-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(168, 85, 247, 0.15);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.badge-pill.privacy {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Drag & Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-glow);
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.drop-content h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.highlight {
  color: var(--text-secondary);
  text-decoration: underline;
}

.drop-content p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Form Container */
.form-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input-header-row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

textarea, select, input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.control-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.selector-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selector-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.chip-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.chip-btn.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Metrics Row */
.metrics-row {
  display: flex;
  gap: 16px;
  margin: 14px 0;
}

.metric-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
}

.m-label { color: var(--text-secondary); }
.m-val { font-weight: 800; color: var(--text-primary); margin-left: 4px; }

.formatted-output {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-md);
  min-height: 100px;
  font-size: 13px;
}

/* Mode Chips & Studio Grid */
.mode-chips {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.mode-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mode-chip.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.studio-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.glass-preview-box, .wave-preview-box {
  background: var(--bg-input);
  padding: 24px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.preview-inner-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 20px;
  color: white;
}

.controls-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.slider-group input[type="range"] {
  accent-color: var(--accent-primary);
}

.color-picker-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* SIDEBAR CARDS */
.sidebar-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.support-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-badge {
  align-self: flex-start;
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 800;
}

.support-card h3 {
  font-size: 16px;
  font-weight: 800;
}

.support-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* FOOTER STYLING */
.main-footer {
  text-align: center;
  padding: 24px 0 12px;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 12px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.full { width: 100%; }

.hidden { display: none !important; }

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 16px; right: 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.toast-notification {
  position: fixed;
  bottom: 20px; right: 20px;
  background: var(--accent-primary);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  z-index: 10000;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}

@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .studio-grid { grid-template-columns: 1fr; }
  .tool-nav { flex-direction: column; }
}
