html {
    font-size: 14px; /* Reduced from browser default of 16px for a zoomed-out look */
    min-height: 100vh;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
    -webkit-overscroll-behavior: none;
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat; 
    width: fit-content;
    min-width: 100%;
}

/* Dark mode overrides for html */
html.theme-dark-mode {
    background: #121212 !important;
    background-image: none !important;
    background-color: #121212 !important;
}

body {
    min-height: 100vh;
    height: 100%;
    width: fit-content;
    min-width: 100%;
    opacity: 0;
    background: transparent;
    transition: opacity 0.3s ease;
    color: var(--bs-light);
    overflow-y: auto;
    overflow-x: auto;
    padding-top: 6.5rem;
    padding-bottom: 0;
    margin: 0;
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}

/* Dark mode overrides for body */
html.theme-dark-mode body {
    background: #121212 !important;
    background-image: none !important;
    background-color: #121212 !important;
}

body.content-loaded {
    opacity: 1;
    width: fit-content;
    min-width: 100%;
/*    background: linear-gradient(rgba(33, 37, 41, 0.4), rgba(33, 37, 41, 0.4)), url('/static/background1.jpg');  */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    position: relative;
    z-index: 0;
}

/* Dark mode overrides for body.content-loaded */
html.theme-dark-mode body.content-loaded {
    background: #121212 !important;
    background-image: none !important;
    background-color: #121212 !important;
}

/* Create a fixed background wrapper */
body.content-loaded::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
/*    background: linear-gradient(rgba(33, 37, 41, 0.4), rgba(33, 37, 41, 0.4)), url('/static/background1.jpg'); */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
/*    background-attachment: fixed; */
}

/* Dark mode overrides for body.content-loaded::before */
html.theme-dark-mode body.content-loaded::before {
    background: #121212 !important;
    background-image: none !important;
    background-color: #121212 !important;
}

/* Base header styles (without background) */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0 1.5rem;
    padding-left: 1.25rem;
/*    z-index: 1000; */
    height: 80px;
    display: flex;
    align-items: center;
    background: transparent;
}

/* Add smooth transition for header children */
header > * {
    transition: opacity 0.3s ease;
}

/* Add background when content-loaded class is applied */
header.content-loaded {
    position: fixed; /* Keep as fixed to maintain layout */
    background: transparent; 
}

/* Create a fixed background for the header */
header.content-loaded::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
/*    width: 100%; Removing this fixes the header appearance in full web mode 
    height: 100%;
    background: linear-gradient(rgba(33, 37, 41, 0.4), rgba(33, 37, 41, 0.4)), url('/static/background1.jpg');
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat; */
    z-index: -1;
}

h1 {
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.95) 0%,
        var(--bs-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(var(--bs-primary-rgb), 0.3);
    position: relative;
    font-weight: 600;  /* Make it slightly bolder */
    letter-spacing: 0.5px;  /* Add slight letter spacing */
}

/* Add a subtle underline effect */
h1::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--bs-primary) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

h2 {
    color: var(--bs-light);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.container {
    max-width: none;
    width: auto;
    margin: 0;
    padding: 0 1.5rem;
}

.container-wrapper {
    padding-top: 0;
    overflow-x: auto;
}

/* Make container-fluid transparent and expand with content */
.container-fluid {
    background: transparent !important;
    min-width: 100%;
    width: fit-content;
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in, visibility 0.3s ease-in;
}

body.content-loaded .container-fluid {
    opacity: 1;
    visibility: visible;
}

/* Safari-specific fix for background image jittering during scroll */
@supports (-webkit-backdrop-filter: blur(1px)) {
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: inherit;
        background-attachment: fixed;
        z-index: -1;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
    }
    
    body {
        background: none !important;
    }
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .container-wrapper {
        padding-top: 3rem;
    }
    
    header {
        height: auto;
        min-height: 80px;
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        background: linear-gradient(rgba(33, 37, 41, 0.4), rgba(33, 37, 41, 0.4)), url('/static/background1.jpg');
        background-size: cover;
        background-position: top;
        background-attachment: fixed;
/*        transform: translateZ(0); */
    } 

    body {
        padding-top: 10rem; /* Increased padding for mobile to account for taller header */
    }
}

h1 span[onclick*="resetBoardScroll"] {
    background: linear-gradient(180deg,
        #ffffff 0%,
        var(--bs-primary) 85%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: all 0.3s ease;
    position: relative;
}

h1 span[onclick*="resetBoardScroll"]:hover {
    transform: scale(1.02);  /* Subtle grow effect */
    text-shadow: 0 0 25px rgba(var(--bs-primary-rgb), 0.5);  /* Enhanced glow on hover */
}

/* Add a subtle underline effect */
h1 span[onclick*="resetBoardScroll"]::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--bs-primary) 50%,
        transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

h1 span[onclick*="resetBoardScroll"]:hover::after {
    opacity: 0.5;
}

.board-loading-placeholder {
    min-height: 300px;
    width: 100%;
    background: transparent;
}
