:root {
    /* Primary Colors */
    --primary: #E8916B;
    /* Warm Terracotta */
    --secondary: #2A3342;
    /* Deep Blue-Grey */

    /* Background Colors */
    --bg-primary: #FDFBF9;
    /* Warm White */
    --bg-secondary: #F5F1EE;
    /* Light Warm Grey */

    /* Text Colors */
    --text-primary: #2A3342;
    /* Deep Blue-Grey */
    --text-secondary: #5F6C7E;
    /* Medium Grey */

    /* Accent Colors */
    --accent-warm: #D4A298;
    /* Dusty Rose */
    --accent-cool: #8293AB;
    /* Muted Blue */

    /* Layout */
    --header-height: 90px;
    --subnav-height: 50px;
    --header-height-compressed: 65px;
    --max-width: 1000px;
    --z-header: 10000;

    /* Header & Navigation Themes (Override these in your app for custom branding) */
    --bdl-header-bg: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
    --bdl-header-bg-compressed: var(--bg-secondary);
    --bdl-subnav-bg: var(--bg-primary);
    --bdl-nav-active-bg: rgba(232, 145, 107, 0.1);
    --bdl-nav-active-text: var(--primary);
}

/* Top bar styles */
.top-bar {
    background: var(--bdl-header-bg);
    padding: 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: var(--z-header);
    transition: all 0.3s ease;
    box-shadow: 0 2px 16px rgba(var(--shadow-secondary, 42, 51, 66), 0.07);
    border-radius: 0 0 16px 16px;
    overflow: visible;
}

/* Remove rounding when sub-nav is present to make them flush */
body.has-sub-nav .top-bar {
    border-radius: 0;
}

.top-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: height 0.3s ease;
}

.logo-img,
.parent-logo-img,
.app-name {
    transition: transform 0.2s, color 0.2s, opacity 0.2s, height 0.3s;
}

/* Logo styles */
.logo-img {
    height: 60px;
    width: auto;
}

.logo-img:hover,
.parent-logo-img:hover {
    transform: scale(1.07);
    opacity: 1;
}

/* Header Compression Styles */
.header-compressed {
    background: var(--bdl-header-bg-compressed);
}

.header-compressed .top-container {
    height: var(--header-height-compressed);
}

.header-compressed .logo-img {
    height: 45px;
}

.header-compressed .parent-logo-img {
    height: 35px;
}

/* Social links styles */
.social-links-top {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.social-links-top .social-icon {
    color: var(--text-primary);
    font-size: 1.2rem;
    opacity: 0.8;
    transition: transform 0.2s, color 0.2s, opacity 0.2s;
}

.social-links-top .social-icon:hover {
    opacity: 1;
    color: var(--primary);
    transform: scale(1.15);
}

.nav-links-wrapper {
    display: none;
    /* Hidden on desktop */
    align-items: center;
    gap: 1.5rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    margin: 0;
    /* Use a utility class for padding to avoid forcing it on everyone */
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 17px;
    font-weight: 400;
}

/* Utility to add space for the fixed header */
.has-fixed-header {
    padding-top: var(--header-height);
}

/* Extra space for apps with sub-navigation */
.has-sub-nav.has-fixed-header {
    padding-top: calc(var(--header-height) + var(--subnav-height) + 20px);
}


/* Main Site Layout (Scoped to avoid conflicts with apps) */
.bdl-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    padding: 4rem 0;
    margin: 2rem 0 3rem 0;
    border-radius: 12px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.hero-section .hero-bg-accent {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 620px;
    height: 320px;
    background: radial-gradient(circle at 60% 40%, rgba(var(--shadow-primary, 232, 145, 107), 0.10) 0%, rgba(var(--shadow-accent-cool, 139, 190, 220), 0.08) 60%, rgba(255, 255, 255, 0) 100%);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
    filter: blur(2px);
    border-radius: 50%;
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    z-index: 1;
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-primary);
    margin: 0;
    padding: 0 1rem;
}

/* Legacy BDL styles - scoped or removed */
.bdl-internal-header {
    display: none;
}


/* Section styles */
.section {
    margin: 6rem 0;
    position: relative;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 2.5rem;
    color: var(--secondary);
    border-bottom: 3px solid;
    border-image: linear-gradient(to right, var(--primary), var(--accent-cool)) 1;
    padding-bottom: 0.7rem;
    display: flex;
    align-items: center;
    opacity: 0.95;
    letter-spacing: 0.02em;
}

.section-title i {
    color: var(--primary);
    margin-right: 0.5rem;
}

/* List container for dashboards and mini-books */
.list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Open Data Hub specific style */
#data-hub .list-container {
    grid-template-columns: 1fr;
}

.list-item {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 1.75rem;
    border: 1px solid #ececec;
    box-shadow: 0 2px 8px rgba(42, 51, 66, 0.07);
    transition: transform 0.18s, box-shadow 0.18s, background 0.25s;
}

.list-item:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 6px 18px rgba(232, 145, 107, 0.12);
    background: linear-gradient(120deg, var(--bg-primary) 70%, var(--accent-warm) 100%);
}

.list-item.selected {
    box-shadow: 0 0 0 2px rgba(232, 145, 107, 0.15);
    border-color: var(--accent-warm);
    position: relative;
}

.list-item.selected::after {
    content: '';
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 18px;
    height: 18px;
    background: var(--accent-warm);
    border-radius: 50%;
    opacity: 0.35;
    box-shadow: 0 2px 8px rgba(var(--shadow-primary, 232, 145, 107), 0.10);
    pointer-events: none;
}

.list-item h3 {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.list-item h3 a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.list-item h3 a:hover {
    color: var(--primary);
}

.list-item p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Badge styles */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    font-weight: 500;
    vertical-align: middle;
}

.badge-platform {
    background-color: var(--accent-cool);
    color: white;
}

.badge-independent {
    background-color: var(--text-secondary);
    opacity: 0.7;
    color: white;
}

/* Tools list */
.tools-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.tools-list li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.tools-list li:before {
    content: "•";
    color: var(--primary);
    position: absolute;
    left: 0;
}

.tools-list a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.tools-list a:hover {
    color: var(--primary);
}

/* Social links */
.social-links {
    text-align: center;
    margin: 4rem 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.social-icon {
    font-size: 1.5rem;
    color: var(--accent-cool);
    transition: color 0.2s;
}

.social-icon:hover {
    color: var(--primary);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    margin-top: 4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: none;
    box-shadow: none;
}

/* App Header Specific Styles */
.app-header-main {
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.app-sub-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: var(--subnav-height);
    background: var(--bdl-subnav-bg);
    /* Match page background for classy floating look */
    z-index: calc(var(--z-header) - 1);
    box-shadow: none;
    /* Let it float naturally */
    border-bottom: none;
    border-radius: 0 0 16px 16px;
    transition: top 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
}

body.header-scrolled .app-sub-nav {
    top: var(--header-height-compressed);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    display: flex;
    justify-content: center;
    /* Center tabs for better UX */
}

/* Removed sibling selector to move toward body-class based logic */

.logos-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.01em;
    text-decoration: none;
}

.app-name:hover {
    opacity: 0.8;
}

.divider {
    width: 1px;
    height: 30px;
    background: var(--accent-cool);
    margin: 0 0.5rem;
    opacity: 0.3;
}

.parent-logo-img {
    height: 50px;
    width: auto;
    opacity: 0.8;
}

/* Mobile Menu Button - Hidden on Desktop by default */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

/* App Navigation Tabs */
.app-nav {
    display: flex;
    gap: 0.5rem;
}

.app-nav .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    /* Pill style */
}

.app-nav .nav-link:hover {
    color: var(--primary);
    background: rgba(var(--shadow-primary, 232, 145, 107), 0.05);
}

.app-nav .nav-link:hover:not(.active) {
    background: rgba(0, 0, 0, 0.03);
    color: var(--secondary);
}

.app-nav .nav-link.active {
    background: var(--bdl-nav-active-bg);
    color: var(--bdl-nav-active-text);
    font-weight: 600;
}

/* Updated Responsive Styles */
@media screen and (max-width: 768px) {
    .app-nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-right: 0;
        margin-bottom: 1rem;
        text-align: center;
    }

    .app-nav .nav-link {
        width: 100%;
        padding: 0.8rem;
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 768px) {

    .container {
        padding: 1rem;
    }

    .list-container {
        grid-template-columns: 1fr;
    }

    .top-container {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
        /* Compact padding */
    }

    /* Header Mobile Layout */
    .mobile-menu-btn {
        display: none;
        /* Hidden by default, shown via JS if links exist */
    }

    /* Only show hamburger if we actually have links to show */
    body.has-nav .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* If no nav, keep social links visible on the right */
    .nav-links-wrapper {
        display: flex;
        width: auto;
        flex-direction: row;
        padding: 0;
        background: transparent;
        border: none;
        margin-top: 0;
    }

    /* Fixed social links overlapping issue in 1st image */
    @media screen and (max-width: 500px) {
        body.has-nav .header-right-desktop {
            display: none;
        }

        body.has-nav .logos-container {
            max-width: 100%;
            flex: 1;
        }

        body.has-nav .app-name {
            font-size: 1rem;
        }
    }

    /* When nav exists, hide the sub-nav bar on mobile and move links to hamburger menu */
    body.has-nav .app-sub-nav {
        display: none !important;
    }

    body.has-nav .nav-links-wrapper {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
        background: var(--bg-primary);
        z-index: 10002;
        /* Above the header bar */
    }

    body.has-nav .nav-links-wrapper.active {
        display: flex;
    }

    /* Target the mobile menu content specifically */
    .mobile-nav-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
        margin-bottom: 3rem;
        text-align: center;
    }

    .mobile-nav-content .nav-link {
        display: block;
        font-size: 1.8rem;
        /* Large, premium menu font */
        font-weight: 600;
        color: var(--secondary);
        text-decoration: none;
        padding: 0.5rem;
        transition: color 0.2s;
    }

    .mobile-nav-content .nav-link.active {
        color: var(--primary);
    }

    .mobile-socials {
        display: flex;
        justify-content: center;
        width: 100%;
        gap: 2.5rem;
        padding-top: 2rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    .mobile-socials .social-icon {
        font-size: 1.8rem;
        color: var(--secondary);
        opacity: 0.8;
    }

    .social-links-top {
        margin-top: 0;
        justify-content: center;
        width: 100%;
        gap: 2rem;
        padding: 1rem 0;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .tools-list {
        grid-template-columns: 1fr;
    }

    .hero-section {
        padding: 2rem 0;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .divider {
        display: none;
        /* Hide divider on mobile */
    }

    .logos-container {
        flex: 1;
        justify-content: flex-start;
        max-width: 80%;
    }

    .logo-img {
        height: 45px;
    }

    .parent-logo-img {
        height: 35px;
    }

    /* Ensure footer stacks */
    #footer .container {
        flex-direction: column;
        text-align: center;
    }
}

@media screen and (max-width: 1240px) {
    .top-container {
        max-width: 100%;
        padding: 0.8rem 1.5rem;
    }
}