﻿#topbar > :is(div, a) {
    opacity: 0;
}

#topbar.ready > :is(div, a) {
    opacity: 1;
}

#userInformation-wrapper {
    top: 14px;
    position: absolute;
    border-radius: 8px;
}

.topbar-wrapper {
    position: fixed;
    top: 0px;
    z-index: 9999;
    left: 0;
    right: 0;
    box-sizing: border-box;
}

.userInformation-wrapper:has(.um-pic-loading) {
    background: white;
}

body.dark .userInformation-wrapper:has(.um-pic-loading) {
    background: var(--cod-gray);
}

.userInformation-wrapper {
    padding: 0px;
    margin: 4px;
    transform-origin: center;
    align-self: center;
    text-align: end;
    justify-content: flex-end;
    font-size: 12px;
    position: absolute;
    right: 7px;
    background: #4640f570;
    transition: padding 0.2s linear, margin 0.2s linear, border-radius 0.2s linear;
}

:not(.admintopbar) .userInformation-wrapper {
    right: 20px;
}

.admintopbar .userInformation-wrapper {
    right: 15px;
}

.userInformation-wrapper:hover:not(:has(#toggle-user-menu[type='checkbox']:checked)) {
    background: #4640f570;
    padding: 4px;
    margin: 0;
    border-radius: 12px;
}

#userImage.um-pic-loading {
    opacity: 0;
}

#userImage {
    opacity: 1;
    transition: opacity 0.3s linear;
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.front-user-pic {
    display: flex;
}

#userInformation-wrapper {
    z-index: 9999;
    top: 15px;
    position: fixed;
    border-radius: 8px;
}

    #userInformation-wrapper::after {
        content: '';
        height: 12px;
        width: 12px;
        border-radius: 50%;
        background: var(--punch);
        position: absolute;
        right: 4px;
        top: 4px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.1s linear, right 0.5s ease, top 0.5s ease;
    }

    .mini-section.new-changelog-entry:before,
    #userInformation-wrapper::after {
        transform-origin: center;
        transform: scale(1);
        will-change: transform, opacity, right, top;
    }

@keyframes userPulse {
    0% {
        transform: scale(1);
    }

    10% {
        transform: scale(0.9);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    100% {
        transform: scale(1);
    }
}

.mini-section.new-changelog-entry > #changelog-anchor .changelog-web-label:before,
body:has(.new-changelog-entry) #userInformation-wrapper::after {
    animation: userPulse 2s ease-in-out infinite;
}

body:has(.new-changelog-entry) #userInformation-wrapper::after {
    right: -4px;
    top: -4px;
    opacity: 1;
}

body:has(.new-changelog-entry) #userInformation-wrapper:has(#toggle-user-menu:checked)::after {
    opacity: 0;
}


#label-for-toggle-user {
    cursor: pointer;
    margin: 0;
}

.front-user-pic > img {
    border: 0px solid transparent;
    transition: border-color 0.2s linear, border-width 0.2s ease;
}

html:has(#toggle-user-menu:checked),
body:has(#toggle-user-menu:checked) {
    overflow: hidden;
    overflow-y: hidden;
    scrollbar-gutter: unset;
}

#userInformation-wrapper:has(#toggle-user-menu:checked) .front-user-pic > img {
    border-color: #ffffffb3;
    border-width: 4px;
}

body.dark #userInformation-wrapper:has(#toggle-user-menu:checked) .front-user-pic > img {
    border-color: #ffffff38;
}

body:has(#toggle-user-menu:checked) .user-menu {
    opacity: 1 !important;
    max-height: 100vh;
    transition: max-height 0.3s ease-out, opacity 0.1s linear, transform 0.2s ease;
    pointer-events: auto;
    transform: scale(1);
    z-index: 10000
}

body:has(#toggle-user-menu) .user-menu {
    opacity: 0;
}

.user-menu {
    pointer-events: none;
    transition: max-height 0.5s ease-out, opacity 0.2s linear 0.15s, transform 0.3s ease;
    opacity: 1;
    overflow: hidden;
    max-height: 100vh;
    transform-origin: center;
    transform: scale(0.9);
    position: fixed;
    right: 16px;
    top: 88px;
    background: white;
    padding: 12px;
    border-radius: 12px;
    z-index: 1000;
    font-family: 'GalanoGrotesqueRegular', sans-serif;
    font-size: 14px;
    color: black;
    width: auto;
    text-align: start;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
    min-width: 350px;
}

body::before {
    content: '';
    height: 100dvh;
    top: 88px;
    position: fixed;
    inset: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, backdrop-filter 0.2s ease;
    z-index: 9999;
}

body:has(#toggle-user-menu:checked)::before {
    top: 88px;
    background: rgb(0 0 0 / 8%);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
    opacity: 1;
}

body.dark .user-menu {
    background: var(--cod-gray);
    color: white;
    box-shadow: 0 6px 18px rgb(255 255 255 / 8%);
}

.user-menu a {
    color: black;
    text-decoration: none;
}

body.dark .user-menu a {
    color: white;
}

.mini-user-info {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 6px;
}

body.dark .mini-user-info {
    background: var(--mine-shaft);
}

.mini-user-info .flex-column-mini {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.user-menu #name {
    font-size: 14px;
    color: black;
    font-family: 'GalanoGrotesqueSemibold', sans-serif;
}

body.dark .user-menu #name {
    color: white;
}


.user-menu .user-menu-pic {
    border-radius: 50%;
    overflow: clip;
    height: 50px;
    width: 50px;
}

.mini-section {
    display: flex;
    flex-direction: column;
}

#changelog-section {
    position: relative;
}

.mini-section.new-changelog-entry > #changelog-anchor .changelog-web-label:before {
    content: '';
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: var(--punch);
    position: absolute;
    top: 4px;
    right: -16px;
    transition: left 0.3s ease;
    position: absolute;
}

#changelog-anchor .changelog-web-label {
    max-width: fit-content;
    position: relative;
}

.mini-section.new-changelog-entry:has(#changelog-anchor:hover):before {
    left: 11ch;
}


body:has(#toggle-user-menu:checked) .user-menu .um-item {
    padding: 8px;
}

.um-item {
    padding: 0px;
    cursor: pointer;
    background: transparent;
    border-radius: 8px;
    transition: background 0.3s linear, color 0.15s linear, padding 0.4s ease;
}

    .um-item.theme-item {
        cursor: default;
    }

    .um-item > :is(a, div, span) {
        max-width: calc(100% - 16px);
    }

#user-menu .um-item:is(.theme-item, .planet-switch) {
    cursor: default;
}

.um-item:not(.theme-item, .planet-switch):hover {
    background: rgb(248, 248, 248);
    color: var(--royal-blue);
    padding-left: 16px;
    transition: background 0.15s linear, color 0.15s linear, padding 0.4s ease;
}

body.dark .um-item:not(:is(.theme-item, .planet-switch)):hover {
    background: var(--mine-shaft);
    color: white;
    font-weight: 600;
}

a.um-item {
    height: auto;
    width: 100%;
}

.logout-icon {
    height: 12px;
    width: 12px;
}

.mini-section:not(:last-of-type):after {
    content: '';
    background: #80808082;
    width: calc(100%);
    margin: 8px auto;
    height: 2px;
    border-radius: 4px;
}

.mini-section:last-of-type {
    border: 0;
    padding: 10px;
}


.mini-section .logout-link {
    background: var(--punch);
    color: white;
    border-radius: 16px;
    padding: 4px 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s linear;
}

    .mini-section .logout-link:hover {
        opacity: 0.8;
    }

.theme-switch-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.iconos-mini-state {
    position: relative;
    height: 32px;
    width: 32px;
}

.theme-switch-container {
    display: grid;
    grid-template-columns: 1fr auto auto;
}

.mini-icon-container {
    height: 32px;
    width: 32px;
    transition: transform 0.5s ease, opacity 0.25s linear;
    position: absolute;
    transform-origin: center;
}

    .mini-icon-container svg {
        overflow: visible;
    }

.switch-to {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

    .switch-to > span {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        transition: transform 0.5s ease, opacity 0.3s linear;
        opacity: 1;
    }

.theme-switch-container:has(#themeSwitch:checked) #to-dark-label {
    opacity: 0;
    transform: translateY(calc(-50% - 15px));
    transition: transform 0.5s ease, opacity 0.3s linear 0.2s;
}

.theme-switch-container:not(:has(#themeSwitch:checked)) #to-light-label {
    opacity: 0;
    transform: translateY(calc(-50% + 15px));
    transition: transform 0.5s ease, opacity 0.3s linear 0.2s;
}

.theme-switch-container:has(#themeSwitch:checked) .mini-icon-container.mini-sun {
    opacity: 0;
    transform: rotate(360deg);
}

.theme-switch-container:not(:has(#themeSwitch:checked)) .mini-icon-container.mini-moon {
    opacity: 0;
    transform: rotate(360deg);
}

/*planetary*/

.planet-switch .theme-switch-container:has(#planetary-root:checked) #to-planetary-label {
    opacity: 0;
    transform: translateY(calc(-50% - 15px));
    transition: transform 0.5s ease, opacity 0.3s linear 0.2s;
}

.planet-switch .theme-switch-container:not(:has(#planetary-root:checked)) #to-earth-label {
    opacity: 0;
    transform: translateY(calc(-50% + 15px));
    transition: transform 0.5s ease, opacity 0.3s linear 0.2s;
}

.planet-switch .theme-switch-container .mini-icon-container {
    transition: opacity 0.1s linear 0.15s, transform 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.planet-switch .theme-switch-container:has(#planetary-root:checked) .mini-icon-container.mini-planet {
    opacity: 0;
    transform: scale(0.5);
}

.planet-switch .theme-switch-container:not(:has(#planetary-root:checked)) .mini-icon-container.mini-galaxy {
    opacity: 0;
    transform: scale(2);
}

.mini-icon-container svg {
    stroke-width: 20;
}


@media only screen and (min-width: 1440px) {
    :not(.admintopbar) .userInformation-wrapper {
        right: auto;
        left: calc(50% + 670px);
        transform: translateX(-50%);
    }

    body:has(.admintopbar) #userInformation-wrapper {
        top: 15px;
        right: auto;
        left: 50%;
        transform: translate(calc(-50% + 670px), 0);
        transform-origin: center;
    }

    body #user-menu {
        right: auto;
        left: calc(50% + 370px);
    }
}


@media only screen and (max-width: 1010px) {
    .admintopbar .user-menu {
        top: 88px;
        right: 16px;
    }

    :not(.admintopbar) .userInformation-wrapper {
        right: 28px;
    }
}

@media only screen and (max-width: 820px) {
    .user-menu {
        right: 16px;
    }

    :not(.admintopbar) .userInformation-wrapper {
        right: 95px;
    }

    @media only screen and (max-width: 600px) {
        :is(.admintopbar, body) .user-menu {
            border-radius: 0 0 12px 12px;
            position: fixed;
            min-width: 0;
            width: 100%;
            right: 0;
            left: 0;
            top: 88px;
        }
    }
}
