/* redblue Custom Styles */

/* ===============================================
   DARK THEME FOUNDATIONS
   =============================================== */

/* Ensure dark theme is applied to all content areas */
:root {
  --rb-dark-bg: #0a0d12;
  --rb-dark-bg-secondary: #1a1d24;
  --rb-light-bg: #ffffff;
  --rb-light-bg-secondary: #f7f8fa;
}

/* ===============================================
   EPIC ANIMATED COVER PAGE BACKGROUND
   =============================================== */

/* Particles canvas - only visible inside cover section */
#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* ===============================================
   HERO - SMOOTH BLENDED GRADIENT (Red/Blue Dark)
   =============================================== */

/* Cover Page - Smooth flowing gradient */
section.cover,
section.cover.show {
  background: linear-gradient(
    -45deg,
    #08050a,    /* Near black */
    #0a0815,    /* Dark blue tint */
    #0d0510,    /* Dark purple */
    #050a12,    /* Dark navy */
    #0a0508,    /* Dark red tint */
    #050810,    /* Dark blue */
    #08050a     /* Loop back */
  ) !important;
  background-size: 400% 400% !important;
  animation: heroGradientFlow 15s ease infinite !important;
  position: relative;
  overflow: hidden;
}

/* Main gradient animation - smooth color flow */
@keyframes heroGradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Soft blended color clouds - no hard circles */
section.cover::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -20%;
  right: -20%;
  bottom: -20%;
  background:
    /* Large soft blue cloud - moves around */
    radial-gradient(ellipse 120% 80% at 70% 30%, rgba(20, 60, 150, 0.25) 0%, transparent 70%),
    /* Large soft red cloud */
    radial-gradient(ellipse 100% 100% at 20% 70%, rgba(150, 30, 50, 0.2) 0%, transparent 70%),
    /* Soft blue bottom */
    radial-gradient(ellipse 140% 60% at 80% 90%, rgba(30, 80, 180, 0.2) 0%, transparent 60%),
    /* Soft purple center blend */
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(80, 30, 120, 0.15) 0%, transparent 70%),
    /* Soft red accent top */
    radial-gradient(ellipse 90% 50% at 30% 20%, rgba(120, 20, 40, 0.18) 0%, transparent 65%),
    /* Blue mist */
    radial-gradient(ellipse 100% 70% at 60% 60%, rgba(40, 70, 140, 0.12) 0%, transparent 60%);
  animation: cloudsFloat 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
  filter: blur(40px);
}

/* Clouds floating animation */
@keyframes cloudsFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -20px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 15px) scale(0.98);
  }
}

/* Second overlay - subtle color wash */
section.cover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    /* Diagonal blue wash */
    linear-gradient(135deg, transparent 0%, rgba(30, 70, 150, 0.1) 30%, transparent 60%),
    /* Diagonal red wash */
    linear-gradient(-135deg, transparent 40%, rgba(140, 30, 50, 0.08) 70%, transparent 100%);
  animation: washShift 25s ease infinite;
  pointer-events: none;
  z-index: 1;
}

/* Color wash shifting */
@keyframes washShift {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Make cover content appear above effects */
section.cover .cover-main {
  position: relative;
  z-index: 10;
}

/* Animated glow on cover title */
section.cover .cover-main > h1,
section.cover .cover-main > div:first-child {
  text-shadow:
    0 0 20px rgba(229, 57, 53, 0.5),
    0 0 40px rgba(33, 150, 243, 0.3),
    0 0 60px rgba(139, 0, 139, 0.2);
  animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  0% {
    text-shadow:
      0 0 20px rgba(229, 57, 53, 0.5),
      0 0 40px rgba(33, 150, 243, 0.3),
      0 0 60px rgba(139, 0, 139, 0.2);
  }
  100% {
    text-shadow:
      0 0 30px rgba(33, 150, 243, 0.5),
      0 0 50px rgba(229, 57, 53, 0.3),
      0 0 70px rgba(75, 0, 130, 0.3);
  }
}

/* =============================================== */

/* Cover page buttons */
section.cover .cover-main > p:last-child a {
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 600;
  transition: all 0.3s ease;
}

section.cover .cover-main > p:last-child a:first-child {
  background: linear-gradient(135deg, #e53935, #c62828) !important;
  color: white !important;
  border: none !important;
}

section.cover .cover-main > p:last-child a:first-child:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(229, 57, 53, 0.4);
}

section.cover .cover-main > p:last-child a:last-child {
  background: transparent !important;
  color: #2196f3 !important;
  border: 2px solid #2196f3 !important;
}

section.cover .cover-main > p:last-child a:last-child:hover {
  background: rgba(33, 150, 243, 0.1) !important;
  transform: translateY(-2px);
}

/* Fix sidebar toggle position */
.sidebar-toggle {
  position: fixed !important;
  top: 1rem !important;
  left: 1rem !important;
  bottom: auto !important;
  width: 40px !important;
  height: 40px !important;
  z-index: 999 !important;
}

/* Sidebar styling */
.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav a {
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.sidebar-nav a:hover {
  color: #e53935 !important;
  padding-left: 5px;
}

.sidebar-nav a.active {
  color: #e53935 !important;
  border-left: 3px solid #e53935;
  padding-left: 10px;
}

/* Code blocks */
.markdown-section pre {
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.markdown-section code {
  border-radius: 4px;
}

/* Inline code */
.markdown-section p code,
.markdown-section li code {
  background: rgba(229, 57, 53, 0.1);
  color: #e53935;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Tables */
.markdown-section table {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-section table thead {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.2), rgba(33, 150, 243, 0.2));
}

.markdown-section table th {
  font-weight: 600;
  color: #e8ecf2;
}

.markdown-section table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Blockquotes */
.markdown-section blockquote {
  border-left: 4px solid #2196f3;
  background: rgba(33, 150, 243, 0.1);
  border-radius: 0 8px 8px 0;
  padding: 1em 1.5em;
}

/* Warning/Alert blockquotes */
.markdown-section blockquote p:first-child strong:first-child {
  color: #e53935;
}

/* Links */
.markdown-section a {
  color: #2196f3;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.markdown-section a:hover {
  border-bottom-color: #2196f3;
}

/* Headings */
.markdown-section h2 {
  border-bottom: 2px solid rgba(229, 57, 53, 0.3);
  padding-bottom: 0.5em;
}

.markdown-section h3 {
  color: #2196f3;
}

/* Lists */
.markdown-section ul li::marker {
  color: #e53935;
}

.markdown-section ol li::marker {
  color: #2196f3;
}

/* Search highlight */
.search .matching-post {
  border-left: 3px solid #e53935;
}

.search .matching-post .search-keyword {
  background: rgba(229, 57, 53, 0.3);
  color: #fff;
}

/* Docsify alerts */
.alert {
  border-radius: 8px;
}

.alert.callout-danger,
.alert.callout-warning {
  border-left-color: #e53935;
}

.alert.callout-info,
.alert.callout-tip {
  border-left-color: #2196f3;
}

/* Copy code button */
.docsify-copy-code-button {
  background: linear-gradient(135deg, #e53935, #2196f3) !important;
  border-radius: 4px !important;
}

/* Pagination */
.pagination-item-title {
  color: #e53935 !important;
}

.pagination-item:hover {
  background: rgba(229, 57, 53, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0d12;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e53935, #2196f3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c62828, #1565c0);
}

/* Selection */
::selection {
  background: rgba(229, 57, 53, 0.3);
  color: #fff;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .markdown-section h1 {
    font-size: 1.8em;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
  }
}
