/*
 * RenegadeInc Software — Official Visual Identity & Design System
 * Based on RenegadeCMM (Civitai-manager-ComfyUI)
 * Theme: Quark 2 (Blades CSS)
 */

:root,
:root[data-theme="dark"] {
  /* Core Dark Canvas & Void Surfaces */
  --bg-dark: #07090e;
  --q2-bg: #07090e;
  --q2-bg-elev: #0e1322;
  --q2-bg-muted: #141b2d;
  --q2-bg-inverse: #f8fafc;

  /* Typography Colors */
  --q2-text: #f8fafc;
  --q2-text-strong: #ffffff;
  --q2-text-muted: #94a3b8;
  --q2-text-inverse: #07090e;

  /* Borders & Dividers */
  --q2-border-ring: rgba(168, 85, 247, 0.2);
  --q2-border-strong: rgba(168, 85, 247, 0.35);
  --q2-divider: rgba(255, 255, 255, 0.08);

  /* Primary Violet Accents */
  --q2-accent: #a855f7;
  --q2-link: #c084fc;
  --q2-focus-ring: rgba(168, 85, 247, 0.4);

  /* Navigation Bar Frosted Glass */
  --q2-nav-bg: rgba(7, 9, 14, 0.82);
  --q2-nav-border: rgba(255, 255, 255, 0.08);

  /* Pico / Blades CSS token re-mapping */
  --pico-background-color: var(--q2-bg);
  --pico-color: var(--q2-text);
  --pico-h1-color: var(--q2-text-strong);
  --pico-h2-color: var(--q2-text-strong);
  --pico-h3-color: var(--q2-text-strong);
  --pico-h4-color: var(--q2-text-strong);
  --pico-h5-color: var(--q2-text-strong);
  --pico-h6-color: var(--q2-text-strong);
  --pico-muted-color: var(--q2-text-muted);
  --pico-muted-border-color: var(--q2-divider);
  --pico-card-background-color: rgba(22, 30, 48, 0.65);
  --pico-card-border-color: rgba(255, 255, 255, 0.08);
}

/* Base Body Styling */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--q2-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent unwanted word slicing / hyphenation across the entire document */
body, h1, h2, h3, h4, h5, h6, p, span, a, div, .hero-title, .gradient-text {
  hyphens: none !important;
  -webkit-hyphens: none !important;
  word-break: normal !important;
}

/* Fluid Responsive Typography */
.hero-title {
  font-size: clamp(1.35rem, 5vw, 2.75rem) !important;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
  text-wrap: balance;
  word-break: normal !important;
}

.hero-tagline {
  font-size: clamp(0.95rem, 2.5vw, 1.2rem) !important;
  color: #cbd5e1;
  max-width: 680px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.card-title {
  font-size: clamp(1.2rem, 3.5vw, 1.65rem) !important;
  font-weight: 800;
  line-height: 1.3;
}

/* Responsive Helper Classes */
@media (max-width: 768px) {
  .br-desktop {
    display: none !important;
  }
}

/* Header & Navigation Bar Frosted Glass Effect */
#header {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--q2-nav-bg) !important;
  border-bottom: 1px solid var(--q2-nav-border);
  transition: all 0.3s ease;
}

/* Allow brand SVG colors and gradients to render faithfully */
.navbar-brand svg.brand-logo,
.navbar-brand svg.brand-logo path,
.navbar-brand svg.brand-logo rect,
.navbar-brand svg.brand-logo circle,
.navbar-brand svg.brand-logo text {
  fill: initial !important;
  stroke: initial !important;
}

.navbar-brand img,
.navbar-brand svg {
  height: 38px !important;
  width: auto;
}

/* Glassmorphism Panels & Cards */
.glass-panel {
  background: rgba(13, 18, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
}

.glass-card {
  background: rgba(22, 30, 48, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.5rem;
}

.glass-card:hover {
  background: rgba(28, 38, 60, 0.85);
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(139, 92, 246, 0.25), 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Modern Text Gradients */
.gradient-text {
  background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

.gradient-text-blue {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

/* Glow Accents */
.glow-purple {
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.35);
}

.glow-emerald {
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}

.glow-amber {
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.35);
}

/* Ambient Backdrops */
.ambient-glow-wrapper {
  position: relative;
  overflow: hidden;
}

.ambient-glow-purple {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  background: rgba(168, 85, 247, 0.15);
  border-radius: 9999px;
  filter: blur(80px);
  pointer-events: none;
}

.ambient-glow-indigo {
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 320px;
  height: 320px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 9999px;
  filter: blur(80px);
  pointer-events: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge-blue {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Action Buttons */
.btn-renegade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  text-decoration: none;
}

.btn-renegade-primary {
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  color: #ffffff !important;
  border: 1px solid rgba(216, 180, 254, 0.3);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.35);
}

.btn-renegade-primary:hover {
  background: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.55);
  transform: translateY(-2px);
  color: #ffffff !important;
  text-decoration: none;
}

.btn-renegade-secondary {
  background: rgba(22, 30, 48, 0.8);
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-renegade-secondary:hover {
  background: rgba(30, 41, 64, 0.95);
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateY(-2px);
  color: #ffffff !important;
  text-decoration: none;
}

/* Responsive Grid Layouts */
.renegade-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.renegade-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.renegade-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.renegade-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(7, 9, 14, 0.8);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.7);
}

/* Code & Markdown Enhancements */
pre, code {
  background-color: #0b0e17 !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  color: #e2e8f0;
}

blockquote {
  border-left: 3px solid #a855f7 !important;
  background: rgba(168, 85, 247, 0.06);
  padding: 1rem 1.25rem;
  border-radius: 0 0.75rem 0.75rem 0;
}

/* Footer Styling */
#footer {
  background: rgba(7, 9, 14, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2.5rem 0 2rem;
  color: #94a3b8;
}

#footer a {
  color: #c084fc;
}

#footer a:hover {
  color: #e9d5ff;
}

/* ---------- Mobile Layout & Touch Screen Optimizations ---------- */
@media (max-width: 768px) {
  .ambient-glow-wrapper.glass-panel {
    padding: 2rem 1.25rem !important;
    margin-bottom: 2rem !important;
  }

  .ambient-glow-purple,
  .ambient-glow-indigo {
    width: 180px !important;
    height: 180px !important;
    filter: blur(50px) !important;
  }

  .glass-card {
    padding: 1.25rem 1rem !important;
  }

  .glass-card > div[style*="display: flex"] {
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
  }

  .glass-card > div[style*="display: flex"] > div[style*="display: flex"] {
    justify-content: center !important;
  }

  .renegade-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin: 1.25rem 0 !important;
  }

  .btn-renegade {
    width: 100% !important;
    max-width: 320px;
    padding: 0.75rem 1.25rem !important;
  }
}
