/* Guarantee layout background override */
body.bg-custom {
  background-color: #f8fafc !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.08) 0px, transparent 50%) !important;
  background-attachment: fixed !important;
}
/* ==========================================================================
   Modern Glassmorphic Light Theme (design.css)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --border-color: rgba(226, 232, 240, 0.8);
  --border-hover: rgba(203, 213, 225, 0.9);

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-subtle: rgba(79, 70, 229, 0.08);
  --primary-glow: rgba(79, 70, 229, 0.25);

  --text-main: #0f172a;
  --text-muted: #64748b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-pill: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.6;
}

/*BLOG NAME*/
.brand-title {
  font-family: 'Orbitron', -apple-system, sans-serif !important;
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  background: linear-gradient(135deg, #98949d 0%, var(--primary, #6366f1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 0.3s ease;
}

.brand-title:hover {
  text-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
  transform: translateY(0px);
}

/* Header & Floating Navbar */
.site-header {
  position: sticky;
  top: 1rem;
  z-index: 1030;
  margin-bottom: 2rem;
}

.floating-navbar {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  padding: 0.6rem 1.2rem;
  transition: var(--transition);
}

.navbar-brand {
  font-weight: 800;
  color: var(--text-main) !important;
  font-size: 1.15rem;
}

.nav-link {
  color: rgb(18, 11, 58) !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-pill);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary) !important;
  background: var(--primary-subtle);
}

/* MOBILE RESPONSIVE NAVBAR */
/* Mobile Responsive Navbar Improvements */
@media (max-width: 767.98px) {
    /* Adjust pill container on mobile */
    .floating-navbar {
        border-radius: var(--radius-lg, 16px);
        padding: 0.75rem 1rem;
    }

    /* Style the collapsible menu wrapper */
    .floating-navbar .navbar-collapse {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }

    /* Stack nav links neatly with touch-friendly spacing */
    .floating-navbar .nav-link {
        border-radius: 8px;
        padding: 0.6rem 0.75rem !important;
        margin-bottom: 0.25rem;
        display: block;
    }

    /* Align right-side actions (New Post, Account, Theme Toggle) on mobile */
    .floating-navbar .navbar-nav.align-items-center {
        align-items: flex-start !important;
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Ensure primary action button spans cleanly */
    .floating-navbar .btn.btn-primary {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }

    /* Fix theme switcher button alignment in mobile menu */
    #theme-toggle {
        margin-left: 0 !important;
        margin-top: 0.5rem;
        padding: 0.5rem 0.75rem;
        width: 100%;
        text-align: left;
    }
}
/* Card Sections */
.content-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

article.content-section:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.article-title {
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.35rem;
  text-decoration: none;
  transition: var(--transition);
}

.article-title:hover {
  color: var(--primary);
  text-decoration: none;
}

.article-content {
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.7;
}

/* Forms & Inputs */
.form-control {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 500;
  padding: 0.75rem 1rem;
  transition: var(--transition);
}

.form-control:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-subtle);
  color: var(--text-main);
}

.form-control-label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  transition: var(--transition);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  transform: translateY(-1px);
}

/* Avatars & Sidebar */
.article-img, .account-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-sm);
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
/* Modal Glassmorphism Overrides */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
}

/* Badge Styling */
.badge-primary {
  background-color: var(--primary-subtle) !important;
  color: var(--primary) !important;
  border: 1px solid var(--border-color);
  font-weight: 600;
}


/* ==========================================================================
   Gradient Glassmorphic Footer (Light Mode)
   ========================================================================== */
.footer-gradient-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(238, 242, 255, 0.8) 50%, rgba(243, 232, 255, 0.9) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.12);
}

.brand-icon-wrapper {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tracking-wider {
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary) !important;
  text-decoration: none;
  padding-left: 4px;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
}

.social-btn:hover {
  background: var(--primary);
  color: #ffffff !important;
  transform: translateY(-2px);
  border-color: var(--primary);
}

.footer-divider {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
/* ==========================================================================
   Error Page Glassmorphic Animations
   ========================================================================== */
.z-index-1 {
  z-index: 1;
}

.max-w-md {
  max-width: 440px;
}

/* 404 & 500 Graphic Components */
.error-code-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.error-digit {
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.error-icon-orb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-pill);
  background: var(--primary-subtle);
  border: 1px solid var(--border-color);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow-md);
}

/* Floating Animation Keyframes */
.float-anim {
  animation: floatMotion 4s ease-in-out infinite;
}

.float-anim-delayed {
  animation: floatMotion 4s ease-in-out 1s infinite;
}

.gear-pulse {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes floatMotion {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px 6px rgba(99, 102, 241, 0.2);
  }
}

/* Background Glowing Aura */
.error-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
}

.aura-404 {
  background: radial-gradient(circle, #6366f1 0%, #a855f7 100%);
}

.aura-500 {
  background: radial-gradient(circle, #f59e0b 0%, #ef4444 100%);
}

/* Floating Scroll Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #ffffff;
  border: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 1000;
}

.scroll-top-btn.show {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn:hover {
  transform: translateY(-3px);
  background: var(--primary-hover);
}

/* Custom Text Selection */
::selection {
  background: var(--primary-subtle);
  color: var(--primary);
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   Glassmorphic Preloader Overlay
   ========================================================================== */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.2) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  padding: 2.5rem 3.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.loader-orb {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  animation: pulseGlow 2s ease-in-out infinite;
}

.loader-bar {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.loader-progress {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: var(--radius-pill);
  animation: loadingBar 1.2s ease-in-out infinite;
}

@keyframes loadingBar {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* DASIS CODES Orbitron Brand Link */
.dasis-brand-link {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary) !important;
  text-decoration: none;
  transition: var(--transition);
  text-transform: uppercase;
}

.dasis-brand-link:hover {
  color: var(--primary-hover) !important;
  text-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
  text-decoration: none;
}

/* ==========================================================================
   Featured Hero Card
   ========================================================================== */
.featured-hero-card {
  position: relative;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 16px);
  padding: 2.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
}

.featured-hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 30px -10px rgba(99, 102, 241, 0.15);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.hero-title a {
  color: var(--text-main, #ffffff);
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero-title a:hover {
  color: #6366f1;
}

.hero-meta {
  font-size: 0.875rem;
  color: var(--text-muted, #94a3b8);
}

.hero-excerpt {
  color: var(--text-muted, #94a3b8);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-btn {
  border-radius: 50px;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.text-gradient {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-soft-primary {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 0.4em 0.8em;
}

/*ADDITION*/
/* Custom Glassmorphic Pagination */
.glass-pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px !important;
  background: var(--bg-glass, rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  color: var(--text-main, #ffffff) !important;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 0 4px;
}

.glass-pagination .page-link:hover:not(.active):not(.disabled) {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  transform: translateY(-2px);
}

.glass-pagination .page-link.active {
  background: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.glass-pagination .page-link.disabled {
  opacity: 0.5;
  background: transparent;
  border: none;
}

/*USERNAME STYLING*/
.article-metadata {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* FIX: Ensure author username links use white text instead of default blue */
.article-metadata a {
  color: var(--text-main, #f1f5f9) !important;
  text-decoration: none;
  transition: var(--transition);
}

.article-metadata a:hover {
  color: var(--primary-hover, #818cf8) !important;
  text-decoration: none;
}

/*LOADING PAGE*/
/* ==========================================================================
   Smooth Page Transition Fade-In
   ========================================================================== */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main.container {
  animation: pageFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   NProgress Top Bar Custom Styling
   ========================================================================== */
#nprogress .bar {
  background: linear-gradient(90deg, #6366f1, #a855f7) !important;
  height: 3px !important;
  z-index: 10000 !important;
}

#nprogress .peg {
  box-shadow: 0 0 10px #6366f1, 0 0 5px #a855f7 !important;
}

#nprogress .spinner {
  display: none !important; /* Keep it clean without extra spinners */
}

/* ==========================================================================
   Summernote Modal & Image Pop-up Z-Index Fix
   ========================================================================== */
.note-modal-backdrop {
  z-index: 1040 !important;
}

.note-modal {
  z-index: 1050 !important;
}

/* Ensure inputs, buttons, and popover dialogs inside the modal are clickable */
.note-modal .modal-dialog {
  z-index: 1060 !important;
  position: relative !important;
}

.note-modal .modal-content {
  background: var(--bg-card, #151c28) !important;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)) !important;
  color: var(--text-main, #f1f5f9) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
}

.note-modal .form-control {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Ensure Summernote fullscreen overlay stays above footer and navbar */
.note-editor.note-frame.fullscreen {
    z-index: 10500 !important;
    background-color: var(--bg-color, #ffffff) !important; /* Prevents background elements from showing through */
}

/* Hide the site footer completely when Summernote is in fullscreen mode */
body:has(.note-editor.note-frame.fullscreen) footer,
.note-editor.note-frame.fullscreen ~ footer {
    z-index: 1 !important;
    display: none !important;
}

/* Elevate Summernote Fullscreen above fixed Navbars and UI elements */
.note-editor.note-frame.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10500 !important; /* Forces it above navbar */
    background-color: var(--bg-color, #ffffff) !important;
}

/* Hide fixed/sticky Navbars while in Summernote Fullscreen */
body:has(.note-editor.note-frame.fullscreen) navbar,
body:has(.note-editor.note-frame.fullscreen) .navbar,
body:has(.note-editor.note-frame.fullscreen) header {
    display: none !important;
}

/* Ensure Bootstrap modal always stays in front of its dark backdrop */
.modal-backdrop {
    z-index: 1040 !important;
}
.modal {
    z-index: 1050 !important;
}

/* Responsive rich content styling inside posts */
.article-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 1rem 0;
}

.article-content h1, 
.article-content h2, 
.article-content h3, 
.article-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

/* Summernote Modal Input Fixes */
.note-modal .modal-content {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.note-modal .form-control,
.note-modal input[type="text"],
.note-modal input[type="url"] {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
}

.note-modal .form-control:focus,
.note-modal input[type="text"]:focus,
.note-modal input[type="url"]:focus {
    background-color: #ffffff !important;
    color: #212529 !important;
    border-color: #80bdff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

.note-modal .form-group label {
    color: #333333 !important;
}

/*GREY PAGE FIX */
/* Ensure Summernote modals sit above all backdrops */
.note-modal-backdrop {
    display: none !important; /* Disables Summernote's internal duplicate backdrop */
}

.modal-backdrop {
    z-index: 1040 !important;
}

.note-modal, 
.modal.note-modal {
    z-index: 1055 !important;
    background: rgba(0, 0, 0, 0.5); /* Replaces Bootstrap's broken backdrop cleanly */
}