.navbar {
    background-color: var(--primary-light);

    position: sticky;
    top: -1px;
    z-index: 100;
    
    padding: 20px 40px;
    padding-top: 21px;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    transition: 0.2s ease;
}
.navbar.is-sticky {
    padding: 20px 80px;
    padding-top: 21px;
}
.navbar::after {
    content: '';
    border-bottom: 2px solid transparent;
    
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 80px);

    transition: 0.2s ease;
}
.navbar.is-sticky::after {
    border-bottom: 2px solid var(--primary-dark);
}

.nav-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.navbar img {
    width: 50px;
    height: 50px;
    margin: -10px;

    transition: 0.2s ease;
}
.navbar img:hover {
    cursor: pointer;
    transform: rotate(25deg);
}

.nav-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}
.nav-links a {
    position: relative;

    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1em;

    text-decoration: none;
}
.nav-links a::after {
    content: '';
    border-top: 3px solid var(--primary-dark);

    position: absolute;
    left: 1px;
    bottom: -2px;
    width: 0%;

    transition: 0.15s ease;
}
.nav-links a:hover::after {
    width: 99%;
}

.navbar .nav-action {
    border: 3px solid var(--primary-dark);
    border-radius: 5px;

    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1rem;

    padding: 5px;

    background: none;
    text-decoration: none;

    cursor: pointer;

    transition: 0.15s ease;
}
.navbar .nav-action:hover {
    color: var(--primary-light);
    background-color: var(--primary-dark);
}

/* /////////// */
/*   Account   */
/* /////////// */

.navbar .nav-logged-in-container {
    /* border: 1px solid red; */

    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    height: 100%;
    min-width: 120px;
}

.navbar .nav-logged-in-icon {
    background-color: grey;
    border-radius: 50%;

    position: relative;

    height: 30px;
    width: 30px;

    overflow: hidden;
    border: 1px solid rgba(var(--primary-dark-rgb), 0.1);

    display: flex;
    align-items: center;
    justify-content: center;
}
.navbar .nav-logged-in-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar .nav-logged-in-user {
    /* border: 1px solid red; */

    padding: 5px;

    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    color: black;
    font-weight: 600;
    text-decoration: none;

    gap: 5px;

    transition: 0.15s ease;
}
.navbar .nav-logged-in-user:hover {
    cursor: pointer;
}
/* Effect START */
.navbar .nav-logged-in-container:hover .nav-logged-in-username {
    margin-right: -35px;
}
.navbar .nav-logged-in-container:hover .nav-logged-in-icon {
    transform: scale(0);
}
/* Effect END */
.navbar .nav-logged-in-username {
    flex-grow: 1;
    text-align: center;

    transition: 0.25s ease;
}
.navbar .nav-logged-in-icon {
    transition: 0.15s ease;
}
.navbar .nav-logged-in-items {
    border-radius: 5px;

    pointer-events: none;
    opacity: 0;

    background-color: var(--primary-light);
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);

    position: absolute;
    right: 0;
    z-index: 999;
    top: 100%;
    width: 120px;
    transform: translateY(10%);

    transition: 0.3s ease-out;
}
.navbar .nav-logged-in-container:hover .nav-logged-in-items {
    pointer-events: all;
    opacity: 1;
    transform: translateY(0);
    transition: 0.15s ease-out;
}

.navbar .nav-logged-in-item {
    position: relative;

    padding: 20px 30px;

    height: 100%;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    gap: 5px;
}
.navbar .nav-logged-in-item::after {
    content: '';
    border-top: 2px solid var(--primary-dark);

    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
}
.navbar .nav-logged-in-item:nth-last-child(1)::after {
    display: none;
}
.navbar .nav-logged-in-item a {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1rem;

    text-decoration: none;
    position: relative;
}
.navbar .nav-logged-in-item a::after {
    content: '';
    border-top: 3px solid var(--primary-dark);

    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;

    transition: 0.15s ease;
}
.navbar .nav-logged-in-item a:hover::after {
    width: 100%;
}


/* //////////////////////// */
/*      Dialog styles       */
/* //////////////////////// */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    background-color: rgba(0, 0, 0, 0.3);

    visibility: hidden;
}
.modal form {
    border: 3px solid var(--primary-dark);
    border-radius: 5px;

    position: absolute;

    color: var(--primary-dark);
    background-color: var(--primary-light);
    opacity: 0;

    visibility: hidden;

    padding: 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    font-weight: 600;
}
.nav-login-modal input[type="submit"] {
    margin-top: 15px;
}
.nav-modal form div,
.nav-modal form span {
    display: flex;
    flex-direction: column;
}
.nav-modal form div {
    gap: 10px;
}
.nav-modal p {
    margin: 0;
    margin-top: 5px;
    font-size: 0.9rem;
    text-align: left;
    width: 100%;
}
.nav-modal button {
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 0.9rem;
    background: none;
    padding: 0;
    border: none;
    cursor: pointer;
}
.nav-modal button:hover {
    text-decoration: underline;
}
.modal .remember {
    flex-direction: row;
    font-size: 0.9rem;
}
.modal form input {
    padding: 5px;
    border: 3px solid var(--primary-dark);
    border-radius: 5px;

    background-color: var(--primary-light);
    color: var(--primary-dark);

    font-size: 1rem;
    font-weight: 500;

    transition: 0.15s ease;
}
.nav-modal form input:not([type="submit"]) {
    height: 18px;
}
.modal form input:not([type="submit"]):focus {
    outline: none;
    border: 3px solid var(--accent-dark);
    box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.3);
}
.modal form input[type="submit"] {
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: 0.15s ease;
}
.modal form input[type="submit"]:hover {
    color: var(--primary-light);
    background: var(--primary-dark);
}
.modal form input[type="checkbox"] {
    cursor: pointer;
}

.modal form .error {
    border-color: var(--error-dark);
    color: var(--error-dark);
    font-size: 0.9rem;
    font-weight: 600;
}

.open {
    animation: dialog-open 0.30s ease forwards;
}
.closing {
    animation: dialog-close 0.2s ease forwards;
}

/* Keyframes for opening */
@keyframes dialog-open {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Keyframes for closing */
@keyframes dialog-close {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}