/* ===== Sidebar (Desktop default) ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 60px;
    background: linear-gradient(90deg,rgba(0, 0, 0, 1) 80%, rgba(82, 82, 82, 1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: width 0.25s ease, transform 0.25s ease;
    z-index: 1000;
}

.nav-top {
    display: flex;
    flex-direction: column;
}

.nav-bottom {
    display: flex;
    flex-direction: column-reverse;
    z-index: 101;
}

.nav-bottom:has(.nav-item:hover) .manageAccount {
    visibility: visible;
    top: 0;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    padding: 15px;
    white-space: nowrap;
    cursor: pointer;
}

.nav-link {
    color: #fff;
    text-decoration: none;
}

.nav-item i {
    width: 24px;
    font-size: 18px;
    text-align: center;
}

.nav-item span {
    opacity: 0;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

/* Desktop collapsed */
.sidebar .nav-item {
    justify-content: center;
    gap: 0;
}

.nav-item:hover {
    background: #333;
    color: #0FA0CE;
    .nav-link {
        text-decoration: none;
        color: #0FA0CE
    }
}

main {
    margin-left: 60px;
}

/* Dropdown */
.has-dropdown {
    position: relative;
}

.has-dropdown .dropdown {
    position: absolute;
    top: 15%;
    left: 75%;
    display: flex;
    flex-direction: column;
    background: #333;
    min-width: 150px;
    padding: 5px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 4px;
    z-index: 2000;
    border: solid #2A2A2AFF 2px;
    transform: translateY(-40px);
}

.dropdown-item {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: #444;
}

/* Desktop hover */
@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
    .nav-bottom .has-dropdown .dropdown {
    transform: translateY(40px);
    }

    #order-form > * {
        min-width: 500px;
    }

    .sidebar:hover {
        width: 180px;
    }
    .sidebar:hover .nav-item {
        justify-content: start;
        gap: 12px;
    }
    .sidebar:hover .nav-item span {
        opacity: 1;
        width: auto;
    }
    .has-dropdown:hover .dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-bottom .has-dropdown:hover .dropdown {
    transform: translateY(-40px);
    }

    .has-dropdown > .nav-link > span {
    padding-left: 8px;
    }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 64px;
        flex-direction: row;
        justify-content: space-between;
        transform: translateY(0);
        background: linear-gradient(0deg,rgba(0, 0, 0, 1) 90%, rgba(82, 82, 82, 1) 100%);
    }

    .nav-top, .nav-bottom {
        flex-direction: row;
        flex: 1;
    }

    .nav-top {
        justify-content: flex-start;
    }

    .nav-bottom {
        justify-content: flex-end;
    }

    .nav-item {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        justify-items: center;
        gap: 4px;
        padding: 8px 12px;
        flex: 1;
        min-width: 60px;
        max-width: 120px;
    }

    .nav-item span {
        opacity: 1;
        width: auto;
        font-size: 12px;
    }

    .nav-item i {
        font-size: 20px;
    }

    .nav-item:hover {
        background: #333;;
    }

    main {
        margin-left: 0;
        margin-bottom: 64px;
    }

    /* Mobile dropdown hidden by default */
    .has-dropdown .dropdown {
        top: auto;          /* 🔴 WICHTIG */
        left: 50%;
        transform: translateX(-50%);

        bottom: 100%;
        margin-bottom: 8px;

        display: none;
        flex-direction: column;
        visibility: visible;
        opacity: 1;

        min-width: unset;
        max-width: 90%;
        width: max-content;
    }

    .has-dropdown.open .dropdown {
        display: flex;
        padding: 5px;
    }

    .dropdown-item {
        padding: 6px;
        font-size: 12px;
        border-radius: 5px;
    }

    /* Scroll hide */
    .sidebar.hidden {
        transform: translateY(100%);
    }

    .nav-item.has-dropdown .nav-link {
        display: grid;
        grid-template-rows: auto auto;
        justify-items: center;
        gap: 5px;
        padding-top: 1px;
    }

    #order-form > * {
        width: 100%;
    }
}














/* Modal Grundstruktur */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px); /* Hintergrund blur */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: black;
    padding: 20px 40px;
    border-radius: 8px;
    max-width: 300px;
    position: relative;
    box-shadow: 10px 5px 5px rgba(82, 82, 82, 1);
}

/* Tabs */
.modal-tabs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.tab-button {
    flex: 1;
    padding: 10px 0;
    cursor: pointer;
    border: none;
    background:  white;
    font-weight: bold;
    font-size: 16px;
    color: black;
    transition: color 0.1s, background 0.1s;
    line-height: 50%;
}

#loginButton {
    border-radius: 5px 0 0 5px;
}

#signUpButton {
    border-radius: 0 5px 5px 0;
}

.tab-button:hover {
    background: #444;
    color: #0FA0CE;
}

.tab-button.active {
    background: #444;
    color: #0FA0CE;
}

/* Inhalte */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Inputs */
.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="submit"] {
    width: 100%;
    margin: 8px 0;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.modal-content input[type="submit"] {
    background:  #444;
    color:  white;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: color 0.1s;
    font-size: 16px;
    line-height: 50%;
}

.modal-content input[type="submit"]:hover {
    color:  #0FA0CE;
}

/* Close Button */
.close {
    position: absolute;
    top: 8px; right: 12px;
    font-size: 22px;
    cursor: pointer;
    color: white;
}

.close:hover {
    color: #0FA0CE;
}










