body, html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: "Titillium Web", sans-serif;
    background-color: #f9f7f2;
    overflow-y: auto; /* Allow vertical scrolling */
}

/* Riserva lo spazio della scrollbar: il banner centrato non si sposta tra pagine con e senza scroll. */
html {
    scrollbar-gutter: stable;
}

:root {
    --rl-neutral-dark: #1B304C;
    --rl-neutral-light: #E6E9F0;
    --rl-neutral-lightest: #FBFBFF;
}

body,
html {
    background-color: var(--rl-neutral-lightest);
}

/* Text banner header */
.banner-panel {
    position: relative;
    min-height: 96px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: var(--rl-neutral-lightest);
    border-top: 1px solid var(--rl-neutral-light);
    border-bottom: 1px solid var(--rl-neutral-light);
}

.banner-title {
    margin: 10px 0 0;
    color: var(--rl-neutral-dark);
    font-size: 30px;
    line-height: 1.1;
    font-weight: 700;
    text-align: center;
}

/* Banner navigation buttons */
.banner-nav-buttons {
    font-family: "Titillium Web", sans-serif;
    left: max(42px, calc(50% - 918px)) !important;
}

.nav-btn {
    padding: 5px 10px;
    border: none;
    background-color: #778b9b;
    color: white;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 1px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: pre-line;
    width: 100px;
    box-sizing: border-box;
}

.nav-btn:hover {
    background-color: #92a4b3;
}

.nav-btn.active {
    background-color: #cad5e1;
    color: #214b64;
    font-weight: 650;
}

.nav-btn:focus {
    outline: none;
}

.nav-btn {
    background-color: var(--rl-neutral-dark);
    color: var(--rl-neutral-lightest);
}

.nav-btn:hover,
.nav-btn.active {
    background-color: var(--rl-neutral-light);
    color: var(--rl-neutral-dark);
}

#banner-overlay-cards {
    top: 50px !important;
    right: 40px !important;
    bottom: auto !important;
    z-index: 10 !important;
}

#banner-overlay-cards .card-visualization {
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 6px !important;
}

#banner-overlay-cards .card-title,
#banner-overlay-cards .card-value {
    color: var(--rl-neutral-dark) !important;
    white-space: nowrap !important;
}

#banner-overlay-cards .card-title {
    font-size: 10px !important;
    font-weight: 400 !important;
}

#banner-overlay-cards .card-value {
    font-size: 11px !important;
    font-weight: 700 !important;
}

@media (max-width: 1700px) {
    .banner-panel {
        min-height: 130px;
    }

    .banner-title {
        font-size: 26px;
    }

}

/* Navbar is now a direct child of body, positioned at the top */
.navbar {
    position: relative;
    max-width: 1920px;
    margin: 0px auto;
    z-index: 2;
}

#viewers-container {
    max-height: 900px;
    position: relative;
    margin: 10px auto;
    min-width: 0;
    width: 100%;
    max-width: 1920px;
    display: flex;
    gap: 8px;
    z-index: 1;
    transition: height 0.3s ease;
}

@media (max-width: 800px) {
    #viewers-container {
        height: auto !important;
    }

    .viewer-wrapper:not(.collapsed-wrapper) {
        flex: none;
        height: 400px !important;
    }
}

.viewer-wrapper {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

.viewer-header {
    height: 30px;
    background-color: #f9f7f2;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid #ddd;
}

.viewer-header {
    background-color: #f9f7f2;
    border-bottom-color: var(--rl-neutral-light);
}

.collapse-btn {
    width: 30px;
    height: 22px;
    margin-left: 10px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: background-color 0.2s;
}

.collapse-btn {
    background-color: var(--rl-neutral-lightest);
    border-color: var(--rl-neutral-dark);
    color: var(--rl-neutral-dark);
}

.collapse-btn:hover {
    background-color: var(--rl-neutral-light);
}

.collapse-btn:hover {
    background-color: #d0d0d0;
}

.viewer {
    flex: 1;
    position: relative;
    width: 100%;
    height: calc(100% - 30px);
}

#overlay {
    z-index: 1;
    top: 20px;
    right: 20px;
    bottom: auto;
    width: 40%;
    height: 60%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1em;
    display: none;
}

#overlay > .notification {
    margin: auto;
    padding: 1em;
    max-width: 50%;
    background: white;
}

.arrow-icon {
    font-size: 10px;
    transition: transform 0.3s;
}

.collapsed .arrow-icon {
    transform: rotate(-90deg);
}
