@import url('reset.v1.css');
@import url('root.v1.css');
@import url('base.v1.css');
@import url('card.v1.css');
@import url('auth-form.v1.css');
@import url('forms.v1.css');

.logo {
    user-select: none;
    color: var(--primary-accent);
    transform-style: preserve-3d;
    cursor: pointer;

    &:active { animation: spinX 0.6s ease-in-out; }
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    user-select: none;
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background-color 0.3s;

    &:hover {
        text-decoration: none;
        background: var(--primary-accent);
        color: var(--text-dark);
    }
}

.nav-right {
    position: relative;
}

.avatar-button {
    user-select: none;
    background: none;
    border: 1px solid var(--border-accent);
    border-radius: 50%;
    width: 2em;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;

    &:hover:not(:focus-within) {
        background-color: var(--primary-accent);
        color: var(--text-dark);
    }

    &:focus-visible {
        border-color: var(--highlight);
    }
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 120%;
    right: 1em;
    background: var(--background-light);
    border: 1px solid var(--border-accent);
    border-radius: 10px;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    z-index: 1001;
    overflow: hidden;
}

.dropdown-menu-animation {
    opacity: 0;
    transform: translateY(-10px);
    animation: dropdownAnimation 0.5s forwards;

    &:nth-child(n) {
        animation-delay: calc(0.1s * (n - 1));
    }
}

.dropdown-item-animation {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s ease-in-out;
    animation: dropdownItemAnimation 0.3s forwards;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    user-select: none;
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-size: 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.3s ease;

    &:hover {
        background-color: var(--primary-accent);
        color: var(--text-dark);
    }

    &:focus-visible {
        background-color: var(--highlight);
        color: var(--text-dark);
    }
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
}

.intro-body {
    font-size: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

.searchbar-form {
    display: flex;
    width: 100%;
    gap: 10px;
    margin-bottom: 1rem;
}

.searchbar {
    flex: 1;
    background-color: var(--background-light);
    color: var(--text-light);
    border: 1px solid var(--border-accent);
    border-radius: calc(0.5em + 10px);
    padding: 5px 10px;

    &:focus-visible {
        border-color: var(--highlight);
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;

        border-top: 2px solid var(--border-accent);
        background: var(--background-light);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem;
    }

    .nav-links.show {
        display: flex;
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);

        &:active { animation: none; }
    }

    .hamburger {
        width: fit-content;
        position: absolute;
        left: 1rem;
        top: 50%;
        right: 1rem;
        transform: translateY(-50%);
    }
}

@keyframes spinX {
    from { transform: rotateX(0deg); }
    to { transform: rotateX(360deg); }
}

@keyframes dropdownAnimation {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownItemAnimation {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}