/* Shared subpage header bar (used by <x-subpage-header>) */
body,
html {
    background: var(--color-background);
    color: var(--color-text);
    padding: 0 !important;
    margin: 0 !important;
    scrollbar-color: var(--color-secondary) var(--color-background);
}

.sub-header-section {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    position: relative;
    min-height: 20vh;
    /* allow background to be fully visible */
    overflow: hidden;
}

.sub-header-section-2 {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    position: relative;
    min-height: 60vh;
    /* allow background to be fully visible */
    overflow: hidden;
}

.sub-header-section-3 {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    position: relative;
    min-height: 60vh;
    /* allow background to be fully visible */
    overflow: hidden;
}

.sub-top-bar {
    position: relative;
    display: flex;
    width: 70vw;
    height: 5vh;
    right: 0;
    border-radius: 0px 30px 30px 0px;
    background: var(--color-background);
    box-shadow: -5px -5px 15px 10px var(--color-secondary), 5px 5px 15px 7px var(--color-primary);
    align-items: center;
    margin-top: 5vh;
    margin-bottom: 5vh;
    z-index: 1;
    /* keep above background */
}

.sub-top-bar-2 {
    position: absolute;
    left: 0;
    /* force left edge */
    margin-left: 0;
    margin-right: auto;
    /* push width to the right */

    width: 70vw;
    /* extend to the right */
    height: 5vh;

    border-radius: 0 30px 30px 0;
    background: var(--color-background);

    box-shadow:
        -5px -5px 15px 10px var(--color-secondary),
        5px 5px 15px 7px var(--color-primary);

    display: flex;
    align-items: center;

    margin-top: 5vh;
    margin-bottom: 5vh;

    z-index: 2;
    /* ABOVE both backgrounds */
}

.sub-top-bar .back-btn {
    display: flex;
    align-items: center;
    padding-left: 12px;
}

.sub-top-bar-2 .back-btn {
    display: flex;
    align-items: center;
    padding-left: 12px;
}

.sub-top-bar-2 .back-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.sub-top-bar .back-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.sub-top-title {
    color: var(--color-text);
    font-family: AquireLight, sans-serif;
    margin-left: 10px;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
}

.full-page-background {
    position: absolute;
    top: 0;
    /* stick to top */
    left: 50%;
    /* horizontal center */
    transform: translateX(-50%);

    width: 60vw;
    height: 100vh;

    background-image: url('../images/settings/background.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: contain;

    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* Dedicated class for the subpage header background to avoid clashes with other pages */
.subpage-header-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    /* target header height */
    min-height: 320px;
    /* keep a reasonable floor */
    max-height: 100vh;
    /* never exceed viewport */
    background-image: url('../images/settings/background.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    /* show full image, scale as needed */
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;

    filter: grayscale(100%);
    display: block;
    overflow: hidden;
    box-shadow:
        inset 0 -80px 140px rgba(0, 0, 0, 5.65),
        0 60px 120px rgba(0, 0, 0, .6),
        0 100px 200px rgba(0, 0, 0, .4);
}

.subpage-header-background-2 {
    position: absolute;
    top: 0;
    right: 0;
    /* anchor to right */
    width: 60%;
    /* take 60% toward the left */
    height: 60vh;
    min-height: 320px;
    max-height: 100vh;

    background-image: url('../images/settings/background.png');
    background-repeat: no-repeat;
    background-position: right top;
    background-size: cover;
    border-radius: 0 0 0 100px;

    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
    overflow: hidden;

    box-shadow:
        inset 60px -80px 140px rgba(0, 0, 0, .65),
        /* inner shadow toward bottom-left */
        -60px 60px 120px rgba(0, 0, 0, .6),
        /* main outer bottom-left */
        -100px 100px 200px rgba(0, 0, 0, .4);
}

.subpage-header-background-3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 15%;
    height: 60vh;
    margin-left: 10%;
    margin-top: 7%;
    background-image: url('../images/settings/background.png');
    background-repeat: no-repeat;
    background-position: right right;
    /* mirror image anchoring */
    background-size: contain;

    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(100%);
    overflow: hidden;
}

.go-top-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: var(--color-text);
    font-size: 1.2rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    box-shadow: -5px -5px 15px 6px rgba(0, 0, 0, 0.18), 5px 5px 15px 10px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.go-top-btn:hover {
    transform: translateY(-2px);
    box-shadow: -5px -5px 20px 10px rgba(0, 0, 0, 0.2), 5px 5px 20px 12px rgba(0, 0, 0, 0.16);
}

.go-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Extra small devices (xs) – phones */
@media (max-width: 575.98px) {

    .container {
        font-size: small;
    }

    .sub-header-section-3 {
        min-height: 30vh;
        /* allow background to be fully visible */

    }

    .subpage-header-background-2 {
        /* anchor to right */
        width: 60vw;
        /* take 60% toward the left */
        height: 10vh;
        min-height: 30vh;

    }

    .subpage-header-background-3 {
        margin-top: 15vh;
        width: 25vw;
        height: 25vh;

    }
}

/* Small devices (sm) – phones landscape */
@media (min-width: 576px) and (max-width: 767.98px) {

    .container {
        font-size: small;
    }

    .sub-header-section-3 {
        min-height: 40vh;
        /* allow background to be fully visible */

    }

    .subpage-header-background-2 {
        /* anchor to right */
        width: 50vw;
        /* take 60% toward the left */
        height: 10vh;

    }

    .subpage-header-background-3 {
        margin-top: 15vh;
        width: 20vw;
        height: 25vh;

    }
}

/* Medium devices (md) – tablets */
@media (min-width: 768px) and (max-width: 991.98px) {

    .sub-header-section-3 {
        min-height: 40vh;
        /* allow background to be fully visible */

    }

    .subpage-header-background-2 {
        /* anchor to right */
        width: 60%;
        /* take 60% toward the left */
        height: 30vh;

    }

    .subpage-header-background-3 {
        margin-top: 15vh;
        width: 15vw;
        height: 20vh;

    }
}

/* Large devices (lg) – laptops */
@media (min-width: 992px) and (max-width: 1199.98px) {

    .subpage-header-background-2 {
        /* anchor to right */
        width: 60%;
        /* take 60% toward the left */
        height: 50vh;

    }

    .subpage-header-background-3 {
        margin-top: 15vh;
        width: 20vw;
        height: 60vh;

    }
}

/* Extra large devices (xl) – desktops */
@media (min-width: 1200px) and (max-width: 1399.98px) {

    .subpage-header-background-3 {
        margin-top: 15vh;
        width: 20vw;
        height: 60vh;

    }
}

/* Extra extra large devices (xxl) – large screens */
@media (min-width: 1400px) {
    /* ≥1400px */
}
