﻿/* ══════════════════════════════════════════════════════════════════════════════
   ULTRA NO-CODE SUITE CSS — IA ARCHITECTE STUDIO ULTRA v2.0
   Clean, modern, glassmorphic UI for No-Code App Creation & Visual Editing
   Strictly Bilingual EN / FR
══════════════════════════════════════════════════════════════════════════════ */

/* ── 1. TOPBAR & TOOLBAR NO-CODE BUTTONS ─────────────────────────────────── */
.tb-btn-wizard {
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(236,72,153,0.3)) !important;
  border: 1px solid rgba(236,72,153,0.5) !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 14px rgba(236,72,153,0.25) !important;
  transition: all .2s ease !important;
}
.tb-btn-wizard:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 20px rgba(236,72,153,0.45) !important;
  border-color: #f472b6 !important;
}

.device-btn.active-tool {
  background: linear-gradient(135deg, rgba(139,92,246,0.4), rgba(56,189,248,0.4)) !important;
  border-color: #38bdf8 !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(56,189,248,0.3) !important;
}

/* Voice dictation button in prompt area */
.btn-voice {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.35);
  color: #f87171;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .2s;
}
.btn-voice:hover {
  background: rgba(239,68,68,0.22);
  color: #fff;
  border-color: #ef4444;
}
.btn-voice.listening {
  background: #ef4444 !important;
  color: #fff !important;
  border-color: #fca5a5 !important;
  box-shadow: 0 0 16px rgba(239,68,68,0.6);
  animation: voicePulse 1.2s infinite ease-in-out;
}
@keyframes voicePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

/* ── 2. MULTI-SCREEN & PAGE MANAGER BAR ──────────────────────────────────── */
#ultra-screen-bar {
  display: flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #090e1c;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
  flex-shrink: 0;
  min-height: 36px;
}
.screen-tab {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
  white-space: nowrap;
}
.screen-tab:hover {
  background: rgba(139,92,246,0.15);
  color: #e2e8f0;
  border-color: rgba(139,92,246,0.3);
}
.screen-tab.active {
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(6,182,212,0.3));
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56,189,248,0.25);
}
.screen-btn-add {
  background: rgba(16,185,129,0.12);
  border: 1px dashed rgba(16,185,129,0.4);
  color: #34d399;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.screen-btn-add:hover {
  background: rgba(16,185,129,0.25);
  color: #fff;
  border-style: solid;
}

/* ── 3. VISUAL INSPECTOR FLOATING POPOVER & BADGE ────────────────────────── */
#ultra-inspector-popover {
  position: absolute;
  top: 48px;
  right: 14px;
  width: 320px;
  max-width: 90%;
  background: rgba(12, 19, 36, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56,189,248,0.45);
  border-radius: 14px;
  box-shadow: 0 16px 45px rgba(0,0,0,0.85), 0 0 20px rgba(56,189,248,0.2);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: popoverFadeIn .18s ease-out;
}
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(56,189,248,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.inspector-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inspector-tag {
  background: rgba(139,92,246,0.3);
  color: #c084fc;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}
.inspector-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 70vh;
  overflow-y: auto;
}
.inspector-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inspector-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.inspector-input, .inspector-textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.82rem;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.inspector-input:focus, .inspector-textarea:focus {
  border-color: #38bdf8;
}
.inspector-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inspector-color-picker {
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  background: none;
}
.inspector-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.btn-insp-action {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all .15s;
}
.btn-insp-apply {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.btn-insp-dup {
  background: rgba(139,92,246,0.25);
  border: 1px solid rgba(139,92,246,0.4);
  color: #c084fc;
}
.btn-insp-del {
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.4);
  color: #f87171;
}

/* ── 4. VISUAL APP ARCHITECT WIZARD MODAL ────────────────────────────────── */
#modal-wizard .modal-box {
  max-width: 860px;
  width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(13,20,38,0.7);
  border-bottom: 1px solid var(--border2);
}
.wizard-step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all .2s;
}
.wizard-step-item.active {
  color: #38bdf8;
}
.wizard-step-item.completed {
  color: #10b981;
}
.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}
.wizard-step-item.active .step-num {
  background: #38bdf8;
  color: #000;
  border-color: #38bdf8;
  font-weight: 900;
  box-shadow: 0 0 12px rgba(56,189,248,0.5);
}
.wizard-step-item.completed .step-num {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.wizard-content {
  padding: 20px 24px;
  flex: 1;
  overflow-y: auto;
}
.wizard-page {
  display: none;
}
.wizard-page.active {
  display: block;
  animation: pageFade .2s ease;
}
@keyframes pageFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Archetype Cards Grid */
.archetype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.archetype-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.archetype-card:hover {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.4);
  transform: translateY(-2px);
}
.archetype-card.selected {
  background: rgba(56,189,248,0.15);
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56,189,248,0.25);
}
.archetype-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}
.archetype-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}
.archetype-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
}
.archetype-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  color: #cbd5e1;
  align-self: flex-start;
}

/* Feature Checkbox Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.feature-toggle-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}
.feature-toggle-card:hover {
  border-color: rgba(139,92,246,0.3);
  background: rgba(139,92,246,0.08);
}
.feature-toggle-card.checked {
  background: rgba(16,185,129,0.12);
  border-color: #10b981;
}
.feature-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #fff;
  transition: all .15s;
}
.feature-toggle-card.checked .feature-checkbox {
  background: #10b981;
  border-color: #10b981;
}

/* Theme Palette Cards */
.theme-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.theme-palette-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.theme-palette-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.25);
}
.theme-palette-card.selected {
  border-color: #38bdf8;
  background: rgba(56,189,248,0.12);
  box-shadow: 0 0 16px rgba(56,189,248,0.2);
}
.palette-swatches {
  display: flex;
  gap: 6px;
  height: 22px;
  border-radius: 6px;
  overflow: hidden;
}
.palette-swatch {
  flex: 1;
  height: 100%;
}

/* ── 5. VISUAL DATABASE & LOCALSTORAGE ENGINE MODAL ──────────────────────── */
#modal-data-engine .modal-box {
  max-width: 960px;
  width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.data-engine-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(12,18,34,0.8);
  border-bottom: 1px solid var(--border2);
  flex-wrap: wrap;
}
.data-table-wrap {
  flex: 1;
  overflow: auto;
  min-height: 280px;
  max-height: 55vh;
  background: #080d1a;
}
.ultra-data-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: #e2e8f0;
}
.ultra-data-grid th {
  background: #0d152b;
  color: #94a3b8;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  border-bottom: 2px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.04);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
.ultra-data-grid td {
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-right: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}
.ultra-data-grid tr:hover td {
  background: rgba(139,92,246,0.08);
}
.editable-cell {
  cursor: text;
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
}
.editable-cell:focus {
  background: rgba(56,189,248,0.2);
  box-shadow: 0 0 0 1px #38bdf8;
}

/* ── 6. COMPONENT BLOCK LIBRARY MODAL ────────────────────────────────────── */
#modal-blocks .modal-box {
  max-width: 900px;
  width: 95vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding: 16px;
  overflow-y: auto;
  max-height: 60vh;
}
.block-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all .2s;
}
.block-card:hover {
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.1);
  transform: translateY(-2px);
}
.block-preview-box {
  background: #080d1c;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.btn-insert-block {
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
}
.btn-insert-block:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

/* Topbar No-Code Suite Navigation Buttons */
.tb-btn-nocode {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 5px 10px !important;
  border-radius: 8px !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all .2s ease !important;
  white-space: nowrap !important;
}
.tb-btn-nocode.insp {
  background: rgba(56,189,248,0.12) !important;
  border: 1px solid rgba(56,189,248,0.4) !important;
  color: #38bdf8 !important;
}
.tb-btn-nocode.insp:hover, .tb-btn-nocode.insp.active {
  background: rgba(56,189,248,0.28) !important;
  box-shadow: 0 0 12px rgba(56,189,248,0.4) !important;
  color: #fff !important;
}

.tb-btn-nocode.screens {
  background: rgba(139,92,246,0.12) !important;
  border: 1px solid rgba(139,92,246,0.4) !important;
  color: #c084fc !important;
}
.tb-btn-nocode.screens:hover, .tb-btn-nocode.screens.active {
  background: rgba(139,92,246,0.28) !important;
  box-shadow: 0 0 12px rgba(139,92,246,0.4) !important;
  color: #fff !important;
}

.tb-btn-nocode.data {
  background: rgba(16,185,129,0.12) !important;
  border: 1px solid rgba(16,185,129,0.4) !important;
  color: #34d399 !important;
}
.tb-btn-nocode.data:hover {
  background: rgba(16,185,129,0.28) !important;
  box-shadow: 0 0 12px rgba(16,185,129,0.4) !important;
  color: #fff !important;
}

.tb-btn-nocode.blocks {
  background: rgba(245,158,11,0.12) !important;
  border: 1px solid rgba(245,158,11,0.4) !important;
  color: #fbbf24 !important;
}
.tb-btn-nocode.blocks:hover {
  background: rgba(245,158,11,0.28) !important;
  box-shadow: 0 0 12px rgba(245,158,11,0.4) !important;
  color: #fff !important;
}

/* Floating Banner when Visual Inspector is active */
#insp-active-banner {
  display: none;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 6px 25px rgba(0,0,0,0.6), 0 0 16px rgba(56,189,248,0.5);
  z-index: 999;
  pointer-events: none;
  animation: voicePulse 1.8s infinite ease-in-out;
}
