/* Import Ubuntu font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');

/* Define the animated background for the body.
  We use a keyframe animation to shift the background position over time,
  creating a slow, mesmerizing movement of the gradients.
*/
body {
    font-family: 'Ubuntu', sans-serif;
    color: #f0f0f0; /* Light text color for readability on dark background */
    
    /* Set a larger background size to allow for smooth animation without tiling */
    background-size: 400% 400%;
    
    /* The complex background gradient provided by the user */
    background-image: linear-gradient(140.54deg, #608D00 0%, #D30000 72.37%), 
                      linear-gradient(58.72deg, #0029FF 0%, #8FFF00 100%), 
                      radial-gradient(100% 164.72% at 100% 100%, #6100FF 0%, #00FF57 100%), 
                      radial-gradient(100% 148.07% at 0% 0%, #FFF500 0%, #51D500 100%);
    
    background-blend-mode: color-dodge, overlay, difference, normal;
    
    /* Apply the animation */
    animation: gradientShift 25s ease infinite;
}

/* Keyframes for the background animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Apply glassmorphism effect to the main content and sidebar.
  We target the specific classes that mdbook uses for its layout.
*/
.book .book-body .page-wrapper,
.book .book-summary {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background-color: rgba(17, 25, 40, 0.75) !important; /* Use !important to override default mdbook styles */
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.125);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Remove default background colors from mdbook elements to let the glass effect show */
.book .book-body,
.book .book-summary ul.summary {
    background: none !important;
}

/* Style the page content area for better layout with the glass effect */
.page {
    background: none !important;
    padding: 20px; /* Add some padding inside the glass container */
}

/* Improve readability of links */
a, a:hover, a:visited {
    color: #8cb4ff; /* A light blue that stands out */
}

/* Style code blocks to fit the theme */
code, pre {
    background-color: rgba(10, 20, 30, 0.5) !important;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cdd6f4; /* A soft color for code text */
}

/* Custom scrollbar to match the theme */
::-webkit-scrollbar {
    width: 10px;
    background-color: rgba(17, 25, 40, 0.75);
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4);
}
