/* =====================================================
   m3mora — Univers Pages Styles
   ===================================================== */

/* Active nav link */
.nav-link--active {
  color: var(--text) !important;
  background: var(--bg-card) !important;
}

/* ---- UNIVERS HERO ---- */
.univers-hero {
  position: relative;
  height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.univers-hero-bg {
  position: absolute;
  inset: 0;
}

.univers-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.03);
  transition: transform 8s ease;
}

.univers-hero:hover .univers-hero-img {
  transform: scale(1);
}

.univers-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(8, 13, 20, 0.97) 0%,
    rgba(8, 13, 20, 0.6) 40%,
    rgba(8, 13, 20, 0.25) 70%,
    rgba(8, 13, 20, 0.15) 100%
  );
}

[data-theme="light"] .univers-hero-overlay {
  background: linear-gradient(
    to top,
    rgba(246, 248, 251, 0.95) 0%,
    rgba(246, 248, 251, 0.5) 40%,
    rgba(246, 248, 251, 0.1) 100%
  );
}

.univers-hero-content {
  position: relative;
  z-index: 2;
  padding-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Back link */
.univers-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  margin-bottom: 0.5rem;
}

.univers-back:hover {
  color: var(--text);
  gap: 0.6rem;
}

/* Badge univers */
.univers-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: fit-content;
  backdrop-filter: blur(8px);
}

.univers-badge--decodia {
  background: rgba(139, 92, 246, 0.2);
  color: hsl(262, 83%, 80%);
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.univers-badge--cuisine {
  background: rgba(234, 108, 31, 0.2);
  color: hsl(25, 90%, 80%);
  border: 1px solid rgba(234, 108, 31, 0.35);
}

.univers-badge--voyage {
  background: rgba(14, 165, 233, 0.2);
  color: hsl(195, 85%, 80%);
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.univers-badge--tech {
  background: rgba(34, 197, 94, 0.2);
  color: hsl(140, 70%, 75%);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.univers-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
}

.univers-hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.65;
}

.univers-hero-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.univers-hero-tags span {
  padding: 0.25rem 0.7rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  backdrop-filter: blur(4px);
}

[data-theme="light"] .univers-hero-tags span {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

/* ---- UNIVERS ARTICLES ---- */
.univers-articles {
  padding: 4rem 0 5rem;
}

.univers-articles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.univers-articles-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.univers-articles-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 99px;
}

/* ---- UNIVERS CARD GRID ---- */
.univers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* ---- UCARD (article card in univers pages) ---- */
.ucard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.ucard:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.ucard--featured {
  grid-column: span 2;
}

.ucard-img {
  height: 160px;
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: 0.75rem;
  overflow: hidden;
  transition: transform 0.5s ease;
}

.ucard--featured .ucard-img {
  height: 220px;
}

.ucard:hover .ucard-img {
  transform: scale(1.02);
}

/* Decorative shimmer on card images */
.ucard-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.ucard-cat {
  position: relative;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
}

.ucard-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.ucard-body time {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 500;
}

.ucard-body h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.ucard--featured .ucard-body h3 {
  font-size: 1.15rem;
}

.ucard-body h3 a:hover {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ucard-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.ucard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.read-time {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.ucard-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-purple);
  transition: var(--transition);
}

.ucard-link:hover {
  color: var(--accent-teal);
  gap: 0.5rem;
}

/* Univers-specific link colors */
.univers-cuisine .ucard-link { color: var(--cuisine); }
.univers-voyage .ucard-link { color: var(--voyage); }
.univers-tech .ucard-link { color: var(--tech); }

/* ---- OTHER UNIVERS SECTION ---- */
.other-univers {
  padding: 4rem 0 5rem;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}

.other-univers .section-title {
  text-align: left;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.other-univers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.other-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  display: block;
  aspect-ratio: 16/9;
}

.other-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.other-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.other-card:hover img {
  transform: scale(1.05);
}

.other-card-info {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,13,20,0.88) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  padding: 1rem 1.25rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  gap: 0.4rem;
  transition: var(--transition);
}

.other-card:hover .other-card-info {
  background: linear-gradient(to top, rgba(8,13,20,0.95) 0%, rgba(8,13,20,0.2) 65%);
}

/* =====================================================
   HOME — Univers cards avec vraie image
   ===================================================== */
.univers-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
  transition: opacity 0.4s ease, transform 0.5s ease;
  z-index: 0;
  border-radius: var(--radius-lg);
}

.univers-card:hover .univers-card-img {
  opacity: 0.35;
  transform: scale(1.05);
}

/* =====================================================
   HOME — Articles section avec vraie image
   ===================================================== */
.article-img-real {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-img-real {
  transform: scale(1.05);
}

.article-img-wrap {
  position: relative;
  overflow: hidden;
}

/* =====================================================
   RESPONSIVE — Univers pages
   ===================================================== */
@media (max-width: 1024px) {
  .univers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ucard--featured {
    grid-column: span 2;
  }
  .other-univers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .univers-hero {
    height: 420px;
  }
  .univers-grid {
    grid-template-columns: 1fr;
  }
  .ucard--featured {
    grid-column: span 1;
  }
  .other-univers-grid {
    grid-template-columns: 1fr;
  }
}

/* Visit site button on Hero */
.btn-univers-visit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 1rem;
  width: fit-content;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-univers-visit svg {
  transition: transform 0.3s ease;
}

.btn-univers-visit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-univers-visit:hover svg {
  transform: translate(2px, -2px);
}

.btn-univers-visit--decodia {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  border: 1px solid rgba(139, 92, 246, 0.4);
}
.btn-univers-visit--decodia:hover {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
}

.btn-univers-visit--cuisine {
  background: linear-gradient(135deg, #ea6c1f, #c2410c);
  color: #fff;
  border: 1px solid rgba(234, 108, 31, 0.4);
}
.btn-univers-visit--cuisine:hover {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
}

.btn-univers-visit--voyage {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #fff;
  border: 1px solid rgba(14, 165, 233, 0.4);
}
.btn-univers-visit--voyage:hover {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
}

.btn-univers-visit--tech {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.btn-univers-visit--tech:hover {
  background: linear-gradient(135deg, #4ade80, #16a34a);
  color: #fff;
}

/* =====================================================
   NETWORK TELEMETRY DASHBOARD
   ===================================================== */
.telemetry-section {
  padding: 6rem 0;
  background: var(--bg);
  position: relative;
}

.telemetry-console {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .telemetry-console {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.console-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  animation: pulse-live 1.8s ease-in-out infinite;
}

.status-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.console-timestamp {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 500;
}

.console-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.console-stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition);
}

.console-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .console-stat-card {
  background: rgba(255, 255, 255, 0.9);
}

.c-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.c-stat-val {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
}

.c-stat-val--mrr {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.c-stat-desc {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-weight: 500;
}

.console-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.console-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  white-space: nowrap;
}

.console-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .console-table th {
  background: rgba(0, 0, 0, 0.02);
}

.console-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

.console-table tr:last-child td {
  border-bottom: none;
}

.console-table tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

[data-theme="light"] .console-table tr:hover td {
  background: rgba(0, 0, 0, 0.01);
}

.table-loading {
  text-align: center;
  padding: 3rem !important;
  color: var(--text-muted);
  font-style: italic;
}

.table-site-name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700 !important;
}

.table-site-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ─── Console Section Label ───────────────────────────────────────────────── */
.console-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-top: 0.25rem;
}

/* ─── Health Score Block ───────────────────────────────────────────────────── */
.health-score-block {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
}

[data-theme="light"] .health-score-block {
  background: rgba(0, 0, 0, 0.02);
}

.health-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.health-score-title {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.health-score-formula {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

.health-score-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.health-score-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.health-score-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.health-gauge-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  overflow: hidden;
}

[data-theme="light"] .health-gauge-track {
  background: rgba(0, 0, 0, 0.08);
}

.health-gauge-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #a78bfa, #34d399);
  transition: width 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ─── AI Export Block ─────────────────────────────────────────────────────── */
.ai-export-block {
  background: rgba(167, 139, 250, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius);
  margin-top: 1.75rem;
  overflow: hidden;
}

.ai-export-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(167, 139, 250, 0.15);
  flex-wrap: wrap;
}

.ai-export-title {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.ai-export-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ai-export-copy-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #a78bfa;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 1.2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.ai-export-copy-btn:hover {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.6);
}

.ai-export-json {
  display: block;
  padding: 1.25rem 1.5rem;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.6;
  color: #a3e635;
  background: rgba(0, 0, 0, 0.35);
  max-height: 340px;
  overflow-y: auto;
  overflow-x: auto;
  white-space: pre;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  tab-size: 2;
}

[data-theme="light"] .ai-export-json {
  background: rgba(0, 0, 0, 0.05);
  color: #16a34a;
}

/* scrollbar styling for export JSON */
.ai-export-json::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.ai-export-json::-webkit-scrollbar-track {
  background: transparent;
}
.ai-export-json::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.3);
  border-radius: 3px;
}
