﻿
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
}


header {
    background-color: #3d5f8d;
    color: white;
    display: flex;
    flex-direction: row;
    user-select: none;
}

.nav-bar {
    flex: 1 1 0;
    padding: 0.4em 0.8ch;
    cursor: default;
}

    .nav-bar > .nav-link {
        color: white;
        text-decoration: none;
        margin-right: 1em;
    }

header button {
    padding: 0.4em 0.8ch;
    cursor: pointer;
    background-color: unset;
    border: unset;
    color: unset;
    font-size: unset;
}

header > .user-email {
    flex: 0 0 auto;
    anchor-name: --user-email-button;
}

    header > .user-email::after {
        content: ' \25be';
    }

    header > .user-email:hover {
        background-color: #00000030;
    }

header > .login {
    flex: 0 0 auto;
    anchor-name: --user-email-button;
}

    header > .login:hover {
        background-color: #00000030;
    }


#email-popover {
    position: fixed;
    position-anchor: --user-email-button;
    top: anchor(bottom);
    left: anchor(left);
    right: anchor(right);
    margin: 0px;
    border: 1px solid #00000030;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    width: auto;
    background-color: #3d5f8d;
    color: white;
    user-select: none;
}

    #email-popover > button {
        padding: 0.4em 0.8ch;
        cursor: pointer;
        background-color: unset;
        border: unset;
        color: unset;
        font-size: unset;
        width: 100%;
    }

        #email-popover > button:hover {
            background-color: #00000030;
        }


.container {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    font-family: sans-serif;
    font-size: 10pt;
    --lightness: 60%;
    --chroma: 0.2;
    cursor: default;
    background-color: white;
    color: black;
    flex: 1 0 auto;
}
#subscription-selection:empty::after {
    content: "Loading subscriptions...";
    font-size: 150%;
    font-weight: bold;
    color: #555;
    align-self: center;
    margin: auto;
}

#subscription-selection {
    display: flex;
    flex-direction: row;
    gap: 0.5em;
    padding: 0.7em;
    background-color: #f5f5f5;
    border-right: 1px solid #e3e3e3;
    flex-shrink: 0;
    font-size: 13pt;
    justify-content: center;
}

.container > div {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    overflow: hidden;
}

#host {
    overflow-x: auto;
}

#treemap {
    flex: 1 1 0;
    display: flex;
    color: white;
}

    #treemap[data-loading] {
        color: #aaa;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 200%;
        font-weight: bold;
    }

        #treemap[data-loading]::after {
            content: attr(data-loading);
        }

.treemap {
    position: relative;
    overflow: hidden;
}

.treeitem {
    position: absolute;
    border: 1px solid white;
    box-sizing: border-box;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto 1fr;
    grid-template-columns: minmax(0, 1fr);
    background-color: oklch(var(--lightness) var(--chroma) var(--hue));
    padding: 2px;
}

    .treeitem > .treemapspace > .treemap {
        --parentlightness: var(--lightness);
    }

        .treeitem > .treemapspace > .treemap > .treeitem {
            --lightness: calc(var(--parentlightness) * 0.9);
        }

    .treeitem:has(> .treemapspace) > .first-line {
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .treeitem > .first-line {
        grid-row: 1;
        grid-column: 1;
        overflow: hidden;
        padding: 2px 2px 4px 2px;
    }

    .treeitem > .price {
        grid-row: 1;
        grid-column: 1;
        justify-self: end;
        align-self: start;
        background-color: oklch(var(--lightness) var(--chroma) var(--hue));
        padding: 2px 2px 4px 4px;
    }

    .treeitem > .second-line {
        grid-row: 2;
        grid-column: 1;
        margin: 0px 2px 4px 4px;
        color: #eee;
    }

    .treeitem > .treemapspace {
        grid-row: 3;
        grid-column: 1;
        margin: 0px 2px 4px 4px;
        display: flex;
        flex-direction: column-reverse;
    }

    .treeitem[title]:not(:has(> .treemapspace:hover)):hover {
        box-shadow: 0px 0px 0px 2px orange inset;
        border-color: orange;
    }

#days {
    height: 10em;
    background-color: white;
    overflow-x: auto;
    overflow-y: hidden;
}

    #days::part(bar-container)::before {
        border: 1px solid oklch(calc(var(--lightness) * 0.8) var(--chroma) 250);
        background-color: oklch(var(--lightness) var(--chroma) 250);
    }

    #days::part(bar-container):hover::after {
        background-color: oklch(calc(var(--lightness) * 0.8) var(--chroma) 250);
    }

    #days::part(selection-overlay) {
        background-color: oklch(calc(var(--lightness) * 1.5) calc(var(--chroma) / 4) 250);
        border: 1px solid oklch(calc(var(--lightness) * 4 / 3) calc(var(--chroma) / 4) 250);
        border-width: 0 1px;
    }

#topBar {
    display: flex;
    font-size: 12pt;
}



#cookie-crumb {
    flex: 1;
    background-color: #ececec;
    padding: 0.4em 0.8ch;
    padding-bottom: 0;
    color: black;
    user-select: none;
    border-bottom: 1px solid #e3e3e3;
    border-right: 1px solid #e3e3e3;
    display: flex;
    overflow-x: auto;
}

    #cookie-crumb::-webkit-scrollbar {
        height: 0.4em;
    }

    #cookie-crumb::-webkit-scrollbar-track {
        background: transparent;
    }

    #cookie-crumb::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.4);
        border-radius: 999px;
        border: 2px solid transparent;
        background-clip: content-box;
    }

        #cookie-crumb::-webkit-scrollbar-thumb:hover {
            background-color: rgba(0, 0, 0, 0.6);
        }


    #cookie-crumb > * {
        flex: 0 0 auto;
    }

    #cookie-crumb:empty::after {
        content: "...";
    }

    #cookie-crumb > .step {
        cursor: pointer;
        color: #0358be;
    }

    #cookie-crumb > .separator::after {
        content: " \23f5 ";
        padding: 0 4px;
        color: #464646;
    }

#comboBox {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: #ececec;
    padding: 0.4em 0.8ch;
    padding-bottom: 0px;
    color: black;
    user-select: none;
    border-bottom: 1px solid #e3e3e3;
    overflow-x: scroll;
}

    #comboBox::-webkit-scrollbar {
        height: 0.4em;
        color: transparent;
        background-color: transparent;
    }
#subs {
    
}

.sub {
    padding: 10px;
    font-size: 11pt;
}
li {
    padding: 2px;
}

a:visited {
    color: #030bfc;
}

#dates {
    overflow: auto;
    display: flex;
}

    #dates div {
        flex: 0 0 auto;
        padding: 0.4em 0.8ch;
        background-color: #f5f5f5;
        font-size: 13pt;
        cursor: pointer;
        flex-wrap: nowrap;
    }

/* Center the form on the page */
.center-container {
    display: flex;
    justify-content: center;
    height: 100%;
    align-items: center;
    background: #f5f7fa; /* light background */
}

/* Style the button */
.microsoft-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: #2f2f2f; /* Microsoft-like dark */
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    /* Hover effect */
    .microsoft-btn:hover {
        background: #1f1f1f;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    /* Optional: subtle click effect */
    .microsoft-btn:active {
        transform: translateY(0);
        box-shadow: none;
    }