/* Agent-Tunnel - Styles globaux */

:root {
  --color-bg: #020617;
  --color-surface: #0f172a;
  --color-border: #1e293b;
  --color-accent: #6366f1;
  --color-text: #f1f5f9;
  --color-muted: #64748b;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Animations */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }
@keyframes fadeInUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideInRight { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }

.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }
.animate-fade-in { animation: fadeInUp 0.3s ease-out; }
.animate-slide-in { animation: slideInRight 0.25s ease-out; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

/* Focus styles */
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Transitions globales */
a, button { transition: all 0.15s ease; }

/* Card hover effect */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -8px rgba(99,102,241,0.25);
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Status indicator */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.status-online { background-color: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.25); }
.status-offline { background-color: #475569; }
.status-error { background-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.25); }
.status-maintenance { background-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.25); }

/* Glassmorphism */
.glass {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.05);
}

/* Code style */
code {
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  font-size: 0.85em;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Table styles */
table { border-collapse: collapse; width: 100%; }
th { font-weight: 500; }

/* Line clamp */
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Responsive */
@media (max-width: 1023px) {
  #sidebar { position: fixed; z-index: 30; height: 100vh; }
}

/* PWA install prompt */
.pwa-install-banner {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: #1e293b; border: 1px solid #334155;
  border-radius: 1rem; padding: 1rem 1.5rem;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
  z-index: 100; display: flex; align-items: center; gap: 1rem;
  max-width: calc(100vw - 2rem);
}

/* Chart.js dark mode */
canvas { max-width: 100%; }

/* Notification badge */
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  background: #ef4444;
  border-radius: 8px;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 600;
}

/* Sidebar transition */
#sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip (custom CSS only) */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%; transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  border: 1px solid #334155;
}
[data-tooltip]:hover::after { opacity: 1; }

/* Print styles */
@media print {
  #sidebar, header, .no-print { display: none !important; }
  #main-content { padding: 0 !important; }
  body { background: white !important; color: black !important; }
}
