/* ============================================================
   KERKITO v8.8.0 — Global Styles (Header, Footer, Base)
   Neo-Industrial Lab Design System
   ============================================================ */

/* Import theme variables from builder.css */
:root {
  --slate-950: #0f1115;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;

  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --blue-500: #3b82f6;
  --green-500: #10b981;
  --orange-500: #f97316;
  --red-500: #ef4444;

  --bg-body: var(--slate-950);
  --bg-panel: rgba(30, 41, 59, 0.4);
  --border-subtle: rgba(148, 163, 184, 0.1);
  --border-medium: rgba(148, 163, 184, 0.2);
  --text-primary: var(--slate-200);
  --text-secondary: var(--slate-400);
  --text-muted: var(--slate-500);

  --header-height: 56px;
  --footer-height: 32px;

  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.page {
  flex: 1;
  width: 100%;
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
  /* v8.8.1 FIX: Assurer visibilité par défaut */
  display: block;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* ============================================================
   COMMAND BAR (Header) — Glassmorphism Sticky
   ============================================================ */

.command-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: transform var(--transition-base);
}

.command-bar.hidden {
  transform: translateY(-100%);
}

.command-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand */
.command-left {
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
}

.brand-icon {
  font-size: 1.25rem;
}

.brand-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.brand-badge {
  background: rgba(99, 102, 241, 0.15);
  color: var(--indigo-500);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* Navigation */
.command-nav {
  display: none;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-primary);
}

.nav-icon {
  font-size: 1rem;
}

.nav-label {
  font-family: 'Inter', sans-serif;
}

/* Zen Toggle */
.command-right {
  display: flex;
  align-items: center;
}

.zen-toggle {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition-base);
}

.zen-toggle:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--indigo-500);
  color: var(--indigo-500);
}

.zen-toggle.active {
  background: var(--indigo-500);
  border-color: var(--indigo-500);
  color: white;
}

.zen-icon {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Responsive */
@media (min-width: 768px) {
  .command-nav {
    display: flex;
  }

  .brand-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .brand-text {
    display: none;
  }

  .brand-badge {
    font-size: 0.6rem;
  }
}

/* ============================================================
   STATUS BAR (Footer) — IDE Style
   ============================================================ */

.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background: var(--slate-900);
  border-top: 1px solid var(--border-subtle);
  z-index: 999;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  transition: transform var(--transition-base);
}

.status-bar.hidden {
  transform: translateY(100%);
}

.status-bar-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-dot.warning {
  background: var(--orange-500);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
}

.status-dot.error {
  background: var(--red-500);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.status-text {
  color: var(--text-secondary);
  font-weight: 600;
}

.status-info {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.status-item {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.status-divider {
  color: var(--border-medium);
}

/* Responsive */
@media (max-width: 768px) {
  .status-right .status-item:first-child {
    display: none;
  }
}

@media (max-width: 480px) {
  .status-info {
    display: none;
  }

  .status-bar-inner {
    padding: 0 12px;
    gap: 8px;
  }

  .status-left,
  .status-right {
    gap: 6px;
  }
}

/* ============================================================
   ZEN MODE (Focus Mode)
   ============================================================ */

body.zen-mode .command-bar {
  transform: translateY(-100%);
}

body.zen-mode .status-bar {
  transform: translateY(100%);
}

body.zen-mode .page {
  padding-top: 0;
  padding-bottom: 0;
}

body.zen-mode .hero,
body.zen-mode .faq-wrap {
  display: none !important;
}

/* ============================================================
   LAYOUT IMPROVEMENTS (v8.8.1 HOTFIX)
   ============================================================ */

/* Hero Section: Ajouter espacement et visibilité */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  line-height: 1.2;
}

.hero .kicker {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.hero .lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

/* Mode Switch: Améliorer visibilité */
.mode-switch {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.mode-hint {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Stepper: Améliorer contraste */
.pont-stepper {
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

/* Builder Wrap: Conteneur visible */
.builder-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  background: rgba(15, 23, 42, 0.3);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

/* FAQ: Améliorer visibilité */
.faq-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.faq-card {
  padding: 32px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.faq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.faq-head h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-card details {
  margin-bottom: 16px;
  padding: 16px;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.faq-card summary {
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.faq-card summary:hover {
  color: var(--indigo-500);
}

.faq-card details p {
  margin-top: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Guided Nav: Visibilité améliorée */
.guided-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

/* Buttons (si pas déjà dans builder.css) */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: var(--bg-panel);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--indigo-500);
  border-color: var(--indigo-600);
  color: white;
}

.btn-primary:hover {
  background: var(--indigo-600);
  border-color: var(--indigo-600);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  background: var(--bg-panel);
  border-color: var(--border-medium);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* Responsive improvements */
@media (max-width: 768px) {
  .hero {
    padding: 32px 16px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .builder-wrap {
    padding: 16px;
  }

  .faq-wrap {
    padding: 32px 16px;
  }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: calc(var(--footer-height) + 16px);
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--slate-800);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none; /* Don't block clicks on buttons behind */
  animation: toastSlideIn 0.3s ease-out;
  backdrop-filter: blur(10px);
  font-family: 'Inter', sans-serif;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hiding {
  opacity: 0;
  transform: translateX(100%);
}

.toast.success {
  border-left: 3px solid var(--green-500);
}

.toast.error {
  border-left: 3px solid var(--red-500);
}

.toast.warning {
  border-left: 3px solid var(--orange-500);
}

.toast.info {
  border-left: 3px solid var(--blue-500);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  transition: color var(--transition-base);
  pointer-events: all; /* Allow clicking close button */
}

.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.removing {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Responsive Toasts */
@media (max-width: 480px) {
  .toast-container {
    right: 8px;
    left: 8px;
    max-width: none;
  }

  .toast {
    padding: 10px 12px;
  }

  .toast-title {
    font-size: 0.8rem;
  }

  .toast-message {
    font-size: 0.7rem;
  }
}

/* ============================================================
   KEYBOARD SHORTCUTS OVERLAY
   ============================================================ */

.shortcuts-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.shortcuts-overlay.visible {
  display: flex;
}

.shortcuts-panel {
  background: var(--slate-900);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.shortcuts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.shortcuts-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

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

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(148, 163, 184, 0.05);
  border-radius: 6px;
}

.shortcut-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.shortcut-keys {
  display: flex;
  gap: 4px;
}

.shortcut-key {
  background: var(--slate-800);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 2px 0 var(--slate-700);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.hidden {
  display: none !important;
}

.no-scroll {
  overflow: hidden !important;
}
