/*! Squad UI — Bouygues Telecom Design System v1.0
 *  Based on ShadCN patterns with Bouygues brand identity.
 *  Copy this file into your project and link it:
 *    <link rel="stylesheet" href="squad-ui.css">
 *  Then add page-specific CSS in a <style> block.
 */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Backgrounds */
  --background: 210 20% 98%;
  --foreground: 222 47% 11%;

  /* Cards & surfaces */
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;

  /* Primary — Bouygues Blue */
  --primary: 199 100% 45%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 199 100% 38%;
  --primary-light: 199 60% 96%;

  /* Secondary — Bouygues Navy */
  --secondary: 203 100% 18%;
  --secondary-foreground: 0 0% 100%;
  --secondary-light: 203 60% 92%;

  /* Accent — Bouygues Orange */
  --accent: 24 100% 50%;
  --accent-foreground: 0 0% 100%;
  --accent-light: 24 100% 96%;
  --accent-hover: 24 100% 43%;

  /* Muted */
  --muted: 210 20% 96%;
  --muted-foreground: 215 16% 47%;

  /* Border & input */
  --border: 214 20% 89%;
  --input: 214 20% 89%;
  --ring: 199 100% 45%;

  /* Semantic */
  --success: 152 69% 31%;
  --success-light: 152 69% 95%;
  --warning: 38 92% 50%;
  --warning-light: 38 92% 95%;
  --destructive: 348 83% 47%;
  --destructive-light: 348 83% 96%;

  /* Radius */
  --radius: 0.625rem;

  /* Layout (overridable per-page) */
  --sidebar-width: 260px;
  --header-height: 56px;
  --content-max: 1280px;

  /* Code blocks */
  --code-bg: #1a1d23;
  --code-surface: #22252d;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #f5f7fa;
  background-image: radial-gradient(circle, #c8cdd5 1px, transparent 1px);
  background-size: 20px 20px;
  color: hsl(var(--foreground));
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient accent glows — creates depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 0%, hsla(var(--primary), 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 100%, hsla(var(--accent), 0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

code, pre, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

a {
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: hsl(var(--primary-hover));
}

img, svg {
  display: block;
  max-width: 100%;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  color: hsl(var(--foreground));
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1 { font-size: 2.25rem; font-weight: 800; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; font-weight: 600; }

p {
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-accent { color: hsl(var(--accent)); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* ============================================================
   4. LAYOUT
   ============================================================ */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.section {
  padding: 5rem 0;
  position: relative;
  z-index: 1;
}

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: calc(var(--radius) - 2px);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  text-decoration: none;
  line-height: 1.4;
}

.btn i, .btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-primary:hover {
  background: hsl(var(--primary-hover));
  border-color: hsl(var(--primary-hover));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsla(var(--primary), 0.35);
}

.btn-accent {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  border-color: hsl(var(--accent));
}

.btn-accent:hover {
  background: hsl(var(--accent-hover));
  border-color: hsl(var(--accent-hover));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px hsla(var(--accent), 0.35);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--secondary));
}

.btn-secondary:hover {
  background: hsl(203, 100%, 14%);
  transform: translateY(-1px);
}

.btn-outline {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.btn-outline:hover {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary-light));
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.btn-ghost:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

/* ============================================================
   6. CARDS
   ============================================================ */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow:
    0 1px 2px hsla(var(--foreground), 0.04),
    0 4px 8px hsla(var(--foreground), 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow:
    0 1px 3px hsla(var(--foreground), 0.06),
    0 8px 24px hsla(var(--foreground), 0.04);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

/* Card with colored top accent stripe */
.card-accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent)));
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-accent-primary::before {
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--primary-hover)));
}

.card-accent-accent::before {
  background: linear-gradient(90deg, hsl(var(--accent)), hsl(var(--accent-hover)));
}

/* ============================================================
   7. BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: hsl(var(--primary-light));
  color: hsl(var(--primary));
}

.badge-accent {
  background: hsl(var(--accent-light));
  color: hsl(var(--accent));
}

.badge-secondary {
  background: hsl(var(--secondary-light));
  color: hsl(var(--secondary));
}

.badge-success {
  background: hsl(var(--success-light));
  color: hsl(var(--success));
}

.badge-warning {
  background: hsl(var(--warning-light));
  color: hsl(var(--warning));
}

.badge-destructive {
  background: hsl(var(--destructive-light));
  color: hsl(var(--destructive));
}

.badge-solid {
  background: hsl(var(--accent));
  color: #fff;
}

/* ============================================================
   8. NAVIGATION — Header / Navbar
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: hsla(210, 20%, 98%, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid hsl(var(--border));
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

/* Glowing bottom line on header */
.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsla(var(--primary), 0.3), hsla(var(--accent), 0.2), transparent);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: hsl(var(--foreground));
  text-decoration: none;
}

.header-brand img {
  height: 28px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.header-nav a {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  border-radius: calc(var(--radius) - 2px);
  transition: all 0.2s ease;
}

.header-nav a:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

.header-nav a.active {
  color: hsl(var(--primary));
  font-weight: 600;
}

/* ============================================================
   9. SIDEBAR (for dashboards, docs)
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  z-index: 50;
}

.sidebar-dark {
  background: linear-gradient(180deg, hsl(var(--secondary)) 0%, hsl(203, 100%, 12%) 100%);
  color: hsl(var(--secondary-foreground));
  border-right: none;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  padding: 0 0.5rem;
  margin: 1.25rem 0 0.5rem;
}

.sidebar-dark .sidebar-section-title {
  color: hsla(0, 0%, 100%, 0.35);
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--muted-foreground));
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-link:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.sidebar-link.active {
  background: hsl(var(--primary-light));
  color: hsl(var(--primary));
  font-weight: 600;
  box-shadow: inset 3px 0 0 hsl(var(--primary)), 0 0 8px hsla(var(--primary), 0.1);
}

.sidebar-link i, .sidebar-link svg {
  width: 16px; height: 16px; flex-shrink: 0;
}

.sidebar-dark .sidebar-link {
  color: hsla(0, 0%, 100%, 0.6);
}

.sidebar-dark .sidebar-link:hover {
  background: hsla(0, 0%, 100%, 0.06);
  color: hsla(0, 0%, 100%, 0.9);
}

.sidebar-dark .sidebar-link.active {
  background: hsla(0, 0%, 100%, 0.1);
  color: #fff;
  box-shadow: none;
}

/* ============================================================
   10. TABLES
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  border-bottom: 2px solid hsl(var(--border));
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: top;
}

.table tr:hover td {
  background: hsla(var(--primary), 0.02);
}

.table code {
  background: hsl(var(--accent-light));
  color: hsl(var(--accent));
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* ============================================================
   11. FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: hsl(var(--accent));
  margin-left: 0.15rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  font-family: inherit;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary-light));
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: hsl(var(--muted-foreground));
  opacity: 0.6;
}

.form-hint {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.35rem;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* ============================================================
   12. CODE BLOCKS
   ============================================================ */
pre {
  background: var(--code-bg);
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
  position: relative;
}

/* Futuristic left accent bar on code blocks */
pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--accent)));
  border-radius: 3px 0 0 3px;
  z-index: 1;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Inline code */
:not(pre) > code {
  background: hsl(var(--accent-light));
  color: hsl(var(--accent));
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.82em;
}

/* ============================================================
   13. SECTION DIVIDERS & DECORATIONS
   ============================================================ */
.divider {
  height: 1px;
  background: hsl(var(--border));
  border: none;
  margin: 2rem 0;
}

.divider-glow {
  height: 1px;
  background: linear-gradient(90deg, transparent, hsla(var(--primary), 0.2), hsla(var(--accent), 0.15), transparent);
  border: none;
  margin: 2rem 0;
}

/* Top accent bar across the page */
.accent-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent)), hsl(var(--primary)));
  z-index: 9999;
}

/* ============================================================
   14. AVATAR
   ============================================================ */
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 1rem; }

/* ============================================================
   15. SEARCH BAR
   ============================================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary-light));
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: hsl(var(--foreground));
  flex: 1;
}

.search-bar i, .search-bar svg {
  width: 16px; height: 16px;
  color: hsl(var(--muted-foreground));
}

/* ============================================================
   16. ANIMATIONS & TRANSITIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-in {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.animate-delay-1 { animation-delay: 100ms; }
.animate-delay-2 { animation-delay: 200ms; }
.animate-delay-3 { animation-delay: 300ms; }
.animate-delay-4 { animation-delay: 400ms; }

/* Scroll-triggered animation via IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .animate-in,
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   17. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .sidebar { display: none; }
  .container { padding: 0 1.25rem; }
}

@media (max-width: 768px) {
  .grid-4,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }
  .section { padding: 3rem 0; }
  .header-nav { display: none; }
  .btn-lg { padding: 0.6rem 1.25rem; font-size: 0.875rem; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .container { padding: 0 1rem; }
}

/* ============================================================
   18. UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.relative { position: relative; }
.z-1 { z-index: 1; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 999px; }
.border { border: 1px solid hsl(var(--border)); }
.shadow-sm { box-shadow: 0 1px 3px hsla(var(--foreground), 0.06); }
.shadow-md { box-shadow: 0 4px 12px hsla(var(--foreground), 0.08); }
.text-center { text-align: center; }
.list-none { list-style: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
