:root {
    --body-color: rgb(12, 12, 12);
    --text-color: rgb(235, 235, 235);
    --field-background-hover: #00cff946;
    --stroke: #00CEF9;
    --backgroundstroke: #00cff9a9;
    --transparentbackground: rgba(0, 0, 0, 0.021);
}

body {
    background-color: black;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}

a {
    text-decoration: none;
}

::selection {
    background: var(--backgroundstroke);
    color: var(--text-color);
}

#bodycontent {
    display: flex;
    justify-content: center;
}

#loginform {
    background-color: var(--transparentbackground);
    backdrop-filter: blur(3px);
    text-align: center;
    margin-top: 250px;
    padding: 40px 95px;
    border-radius: 20px;
    border: 2px solid var(--stroke);
    transition: all 0.3s;
}

#loginform:hover {
    scale: 1.03;
    filter: drop-shadow(0 0 20px var(--backgroundstroke));
}

#loginform img {
    width: 40%;
    filter: drop-shadow(0 0 20px var(--backgroundstroke));
}

.centercontent {
    width: 100%;
    display: flex;
    justify-content: center;
}

#loginform #fields {
    display: grid;
}

#loginform #fields input {
    margin: 7px 5px;
}

.forminput {
    background-color: transparent;
    border: 2px solid var(--stroke);
    padding: 11px 17px;
    border-radius: 9px;
    color: var(--text-color);
    transition: all 0.3s;
    font-family: Consolas;
    width: 100%;
    box-sizing: border-box;
}

.forminput:focus {
    outline: none;
    background-color: var(--field-background-hover);
}

.forminput:hover {
    background-color: var(--field-background-hover);

}

.formbutton {
    background-color: transparent;
    border: 2px solid var(--stroke);
    padding: 11px 24px;
    border-radius: 9px;
    color: var(--text-color);
    transition: all 0.3s;
    font-family: Consolas;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}



.formbutton:hover {
    cursor: pointer;
    background-color: var(--field-background-hover);
}
#content {
    height: auto;
    margin: 20px 20px 40px 360px;
    transition: margin 0.3s ease;
}

#sidebar {
    width: 300px;
    height: calc(100vh - 40px);
    top: 20px;
    background-color: var(--transparentbackground);
    backdrop-filter: blur(3px);
    border: 2px solid var(--stroke);
    border-radius: 20px;
    position: fixed;
    left: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1100;
    transition: transform 0.3s ease;
}

#sidebar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    gap: 16px;
}

#sidebar-content button {
    background-color: transparent;
    border: 2px solid var(--stroke);
    padding: 11px 17px;
    border-radius: 9px;
    color: var(--text-color);
    font-family: Consolas;
    font-weight: 600;
    width: 100%;
    max-width: 240px;
    margin: 5px 0;
    transition: all 0.3s;
}



#sidebar-content button:hover {
    cursor: pointer;
    background-color: var(--field-background-hover);
}

#sidebar-content #logoutbtn,
#sidebar-content #createbtn {
    position: static;
    width: 100%;
}

#sidebar-content #contacts {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    margin-top: 10px;
}



#error_message {
    position: fixed;
    left: 50%;
    top: 40px;
    transform: translate(-50%, 0);
    background-color: var(--transparentbackground);
    backdrop-filter: blur(3px);
    border: 2px solid var(--stroke);
    z-index: 3;
    padding: 15px 100px;
    border-radius: 10px;
}

.contentdiv {
    background-color: var(--transparentbackground);
    backdrop-filter: blur(3px);
    border: 2px solid var(--stroke);
    border-radius: 20px;
    padding: 24px 32px;
    font-family: Consolas;
    width: 100%;
    max-width: 1000px;
    height: auto;
    box-sizing: border-box;
    margin: 0 auto;
}

.aindex {
    font-size: 10px;
    opacity: 0.7;
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--stroke);
    margin-bottom: 20px;
    transition: all 0.3s;
    position: absolute;
    left: 660px;
    top: 80px;
}

.profile-image:hover {
    cursor: pointer;
    scale: 1.05;
    filter: drop-shadow(0 0 20px var(--backgroundstroke));
}

#searchcontact {
    width: 240px;
}

.center {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

#inactive-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.5s ease;
    pointer-events: none;
    z-index: 9999;
}
#inactive-overlay.active {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(30px);
    pointer-events: all;
}

#relogindiv {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 99999999;
    background-color: var(--transparentbackground);
    backdrop-filter: blur(3px);
    border: 2px solid var(--stroke);
    border-radius: 20px;
    padding: 20px 50px 40px 50px;
    justify-content: center;
    text-align: center;
    transition: all 0.3s;
}

#relogindiv:hover {
    filter: drop-shadow(0 0 20px var(--backgroundstroke));
}

#relogindiv.active {
    display: grid;
}

.formbutton:focus-visible {
    outline: none;
    filter: drop-shadow(0 0 12px var(--backgroundstroke));
}

.formselect {
    background-color: rgba(0, 0, 0, 0.35);
    border: 2px solid var(--stroke);
    padding: 11px 45px 11px 17px;
    border-radius: 9px;
    color: var(--text-color);
    transition: all 0.3s;
    font-family: Consolas;
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--stroke) 50%),
                      linear-gradient(135deg, var(--stroke) 50%, transparent 50%),
                      linear-gradient(to right, var(--stroke), var(--stroke));
    background-position: calc(100% - 22px) calc(50% - 5px),
                         calc(100% - 16px) calc(50% - 5px),
                         calc(100% - 36px) 50%;
    background-size: 10px 10px, 10px 10px, 1px 58%;
    background-repeat: no-repeat;
    cursor: pointer;
}

.formselect:focus {
    outline: none;
    background-color: var(--field-background-hover);
}

.formselect option {
    color: #000;
}

#sidebar-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

#sidebar-actions .sidebar-action {
    width: 100%;
    display: flex;
    justify-content: center;
}

#sidebar-actions .sidebar-action button {
    max-width: 100%;
}

#sidebar-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--stroke);
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--text-color);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    z-index: 1200;
    transition: background-color 0.3s ease, filter 0.3s ease;
}

#sidebar-toggle span {
    width: 60%;
    height: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#sidebar-toggle:hover {
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.8);
}

#sidebar-toggle:focus-visible {
    outline: 2px solid var(--stroke);
    outline-offset: 3px;
}

body.sidebar-open #sidebar-toggle span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

body.sidebar-open #sidebar-toggle span:nth-child(2) {
    opacity: 0;
}

body.sidebar-open #sidebar-toggle span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

#sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

body.sidebar-open #sidebar-backdrop {
    opacity: 1;
    visibility: visible;
}

#sidebar-content #contacts::-webkit-scrollbar {
    display: none;
}

#sidebar-content #contacts::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar-content #contacts::-webkit-scrollbar-thumb {
    background-color: transparent;
}


@media (max-width: 1200px) {
    #content {
        margin: 20px 24px 40px 320px;
    }
    #loginform:hover {
        scale: 1.0;
    }
}

@media (max-width: 992px) {
    body.sidebar-open {
        overflow: hidden;
    }

    #sidebar {
        top: 0;
        left: 0;
        height: 100vh;
        border-radius: 0 20px 20px 0;
        transform: translateX(-110%);
        width: 100%;
        border: none;
    }

    #sidebar-content button {
        width: 240px;
    }

    #sidebar-content #logoutbtn,
    #sidebar-content #createbtn {
        position: static;
        width: 240px;
    }


    body.sidebar-open #sidebar {
        transform: translateX(0);
    }

    #sidebar-toggle {
        display: flex;
    }

    #content {
        margin: 88px 16px 40px 16px;
    }

    .contentdiv {
        padding: 20px;
    }

    .profile-image {
        position: static;
        width: min(220px, 80vw);
        height: auto;
        margin: 20px auto;
    }

    #h1-sidebar-header {
        margin-top: 50px;
    }

    #sidebar {
        width: 100%;
        height: 100%;
        top: 0px;
        background-color: var(--transparentbackground);
        backdrop-filter: blur(5px);
        position: fixed;
        left: 0px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        z-index: 1100;
        transition: transform 0.3s ease;
    }

    #sidebar-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
        height: 100%;
        padding: 20px;
        box-sizing: border-box;
        gap: 16px;
    }

    #sidebar-content button {
        background-color: transparent;
        border: 2px solid var(--stroke);
        padding: 11px 17px;
        border-radius: 9px;
        color: var(--text-color);
        font-family: Consolas;
        font-weight: 600;
        width: 80vw;
        margin: 5px 0;
        transition: all 0.3s;
        max-width: 95%;
    }

    #contacts::-webkit-scrollbar {
        display: none;
    }



    #sidebar-content button:hover {
        cursor: pointer;
        background-color: var(--field-background-hover);
    }

    #sidebar-content #logoutbtn,
    #sidebar-content #createbtn {
        position: static;
        width: 80vw;
    }

    #sidebar-content #contacts {
        width: 100%;
        flex: 1;
        overflow-y: auto;
        scrollbar-width: thin;
        -ms-overflow-style: none;
        margin-top: 10px;
    }

    #searchcontact {
        width: 80vw;
    }
    #sidebar-content button {
        width: 80vw;
    }
}

@media (max-width: 600px) {
    #content {
        margin: 76px 12px 32px 12px;
    }

    .contentdiv {
        padding: 18px 16px;
    }


}
