@font-face {
    font-family: 'Rodchenko';
    src:
        url('/static/fonts/Rodchenko-Bold8.ttf') format('truetype');
    font-weight: normal;
}

:root {
  --font-color: #3b4b41;
  --main-accent: #1b745e;
  --main-medium: #bfd9bf;
  --main-color: #d1dfd0;
  --main-light: #e0eadf;
  --white-color: #f0f0e9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Rodchenko;
    //font-family: Arial;
    color: var(--font-color);
    text-decoration: none;
}

body {
    background: var(--main-light);
    height: 100vh;
}



/* стили */
.page_container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    margin: 0 auto;
    //padding: 0px 10px 0px 10px;
}

header {
    background: var(--main-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    z-index: 1000;
}

nav {
    background: var(--main-medium);
    height: 30px;
}

.nav-links {
    list-style-type: none;
    height: 100%;
    display: flex;
    justify-content: center;
}

.nav-links li {
    background: var(--main-color);
    margin: 0 5px;
    height: 100%;
}

.nav-links li a {
    height: 100%;
    width: 100%;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links li a.nselected {
    border-bottom: 2px solid var(--main-accent);
    font-weight: bold;
}

.nav-links li a:hover {
    border-bottom: 2px solid var(--main-accent);
}

#top_header {
    height: 40px;
    display: flex;
    align-items: center;
    padding-right: 10px;
    padding-left: 10px;
}

#top_header > :first-child {
    width: 120px;
}
#top_header > :nth-child(2) {
    margin: 0 auto;
}

#top_header > :last-child {
    width: 120px;
}
.page_header {
    white-space: nowrap;
    font-size: clamp(18px, 4vw, 22px);
}

.custom_button, #profile_info button, #profile_info input#id_avatar::file-selector-button, button {
    font-size: clamp(14px, 3vw, 18px);
    display: grid;
    place-items: center;
    //margin: 5px 5px;
    //padding: 2px 5px;
    //padding-top: 0px;
    font-family: Rodchenko;
    color: var(--font-color);
    text-decoration: none;
    height: 25px;
    background: var(--main-light);
    border: 1px solid var(--main-accent);
}

.custom_button:hover, #profile_info button:hover, #profile_info input#id_avatar::file-selector-button:hover {
    background: var(--main-color);
}

.page_body {
    background: var(--white-color);
    //flex-grow: 1;
    padding: 5px;
    width: min(95% , 800px);
    height: calc(100vh - 70px);
    overflow-y: auto;
    margin-left: auto;
    margin-right: auto;
    margin-top: 70px;
}

#messages {
    position: relative;
    padding: 0px 10px;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
}

.message {
    min-width: 100px;
    max-width: 600px;
    width: auto;
    padding: 5px 10px 7px 10px;
    background: var(--main-color);
    overflow-wrap: break-word;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: auto;
    border: 1px solid var(--main-medium);
}

.my {
    border: none;
    background: var(--main-medium);
    margin-left: auto;
    margin-right: 0;
}


.messageHeader {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.message:not(.my) .username {
    margin: 0;
    flex-grow: 1;
}

.message:not(.my) .date_send {
    margin: 0;
    text-align: right;
    font-size: 14px;
}

.my .avatar {
    order: 3;
}

.my .username {
    margin: 0;
    text-align: right;
    flex-grow: 1;
    order: 2;
}

.my .date_send {
    margin: 0;
    order: 1;
    font-size: 14px;
}

.content {
    margin-top: 6px;
}

footer {
    background: var(--main-color);
    //position: fixed;
    //bottom: 0;
    //left: 0;
    //right: 0;
    width: 100%;
    height: 70px;
    padding: 5px 0;
    z-index: 1000;
}

#message_send_form {
    display: flex;
    gap: 10px;
    padding-left: 30px;
    padding-right: 30px;
    height: 100%;
    width: min(800px, 90%);
    margin: 0 auto;
}

#message_field {
    outline: none;
    font-family: Arial;
    font-weight: 500;
    font-size: 18px;
    background: var(--main-medium);
    resize: none;
    box-sizing: border-box;
    padding: 1px 5px;
    flex-grow: 1;
    border-color: var(--main-accent);
}

#message_send_button {
    background: var(--main-accent);
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    width: 120px;
    height: 100%;
    color: var(--white-color);
    border: 2px dashed var(--main-accent);
    background-clip: padding-box;
    font-size: 18px;
}


#chats {
    padding: 0px 10px 0px 10px;
    display: flex;
    flex-direction: column;
}

.chat, .friend, .search_field {
    width: 100%;
    height: 90px;
    min-height: 80px;
    padding: 5px 10px;
    background: var(--main-light);
    margin-top: 10px;
    margin-bottom: 10px;
    border: 2px solid var(--main-medium);
}

.chat:hover, .friend:hover {
    background: var(--main-medium);
}

.friend {
    height: 50px;
    min-height: 62px;
    display: flex;
    gap: 10px;
}

.chat_header {
    width: 100%;
    height: 50px;
    display: flex;
    gap: 10px;
}

.chat .username {
    opacity: 80%;
}

.chat .firstlastname {
    font-size: clamp(16px, 4vw, 20px);
    height: 20px;
    white-space: nowrap;
    overflow: hidden;
}

.last_message {
    width: 80%;
    display: flex;
    gap: 10px;
    margin-top: 4px;
}
.last_message p {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
.last_message p:first-child {
    flex: 0 0 auto;
}
#profile_icon p {
    margin-right: 6px;
}

.names {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.names :first-child {
    display: flex;
    min-height: 20px;
}

.postname_icon {
    padding: 2px;
    margin-left: 3px;
}

#profile_icon {
    width: 120px;
    max-width: 150px;
    display: flex;
    align-items: center;
}

#profile_icon .username {
    font-size: clamp(18px, 3vw, 22px);
    width: 100%;
    text-align: right;
}

#profile_icon .avatar {
    width: 35px;
}

#profile_info {
    padding: 10px 10px 0px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    gap: 10px;
}

#edit_profile_button {
    width: 150px;
}

.tab_content:not(.fselected) {
    display: none;
}

.friend_tabs {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 5px;
}

.friend_tab {
    padding: 3px 5px;
    font-size: 18px;
    background: var(--main-light);
    color: var(--font-color);
    border: 1px solid var(--main-accent);
}

.friend_tab:hover {
    background: var(--main-color);
}

.friend_tab.tselected {
    background: var(--main-accent);
    color: var(--white-color);
}

/* todo Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат     Чат      */

.chat_header_userinfo {
    display: flex;
    gap: 7px;
    align-items: center;
}
.chat_header_userinfo .firstlastname {
    font-size: clamp(16px, 3vw, 20px);
    white-space: nowrap;
    overflow: hidden;
}
.chat_header_userinfo .names {
    height: 40px;
}
.chat_header_userinfo .names > :first-child {
    height: 40px;
    display: flex;
    align-items: center;
}
.chat_header_userinfo .names {
    height: 40px;
}
.chat_header_userinfo .username {
    opacity: 80%;
    font-size: clamp(14px, 3vw, 16px);
}
.chat_header_userinfo .lastonline {
    font-size: 16px;
}
#scroll_bottom {
    position: absolute;
    bottom: 70px;
    right: calc((100vw - min(95%, 800px)) / 2 - 50px - 5px);
    display: none;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border: 1px solid var(--main-accent);
    background: var(--main-color);
}
#scroll_bottom path {
    fill: var(--font-color);
}
#scroll_bottom:hover {
    background: var(--main-light);
}
#scroll_bottom svg {
    width: 80%;
}
@media (max-width: 910px) {
    #scroll_bottom {
        opacity: 70%;
        right: calc((100vw - min(95%, 800px)) / 2 + 20px);
    }
}
.search_field {
    min-height: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 5px;
    margin-bottom: 5px;
}
.search_field button {
    background: none;
    border: none;
    height: 24px;
}
.search_input {
    background: transparent;
    border: none;
    height: 100%;
    width: 100%;
    outline: none;
    font-size: 16px;
    font-family: Arial;
    font-weight: 550;
}
.icon {
    fill: var(--font-color);
}


/* todo Приветственная страница    Приветственная страница    Приветственная страница    Приветственная страница    Приветственная страница    Приветственная страница     */

#welcome{
    height: auto;
}
#welcome header {
    height: 40px;
}
#welcome #top_header :nth-child(1) {
    margin-right: auto;
    width: 220px;
}
#welcome #top_header :nth-child(2), #welcome .top_header :nth-child(3) {
    margin: 0;
    margin-right: 10px;
}
#welcome .page_body {
    background: none;
    width: min(99%, 960px);
    height: auto;
    overflow-y: hidden;
    margin-top: 40px;
    padding-bottom: 200px;
}
#welcome .custom_button {
    width: 160px;
    background: var(--main-medium);
    margin: 5px auto;
}
#welcome .custom_button:hover {
    background: var(--main-accent);
    color: var(--white-color);
}
#preview {
    height: max(70vh, 600px);
    padding-top: 140px;
}
#preview_content {
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    gap: 30px;
    padding-right: 50px;
}
#preview_img_div img {
    width: 100%;
    object-fit: contain;
    box-shadow: -20px 10px 70px var(--main-accent);
}
#preview_content > :first-child {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#preview_content > * {
    width: 50%;
}
@media (max-width: 630px) {
    #preview_content {
        flex-direction: column;
    }
    #preview_img_div {
        width: 90%;
        padding-left: 50px;
        padding-right: 30px;
    }
    #preview_img_div img {
        box-shadow: 0px 0px 70px var(--main-accent);
    }
    #preview_content > * {
        width: 100%;
    }
}
#welcome_description {
    width: min(85%, 850px);
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.5s ease;
}
#welcome_description ul, #welcome_description h2 {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* todo Авторизация и регистрация      Авторизация и регистрация      Авторизация и регистрация      Авторизация и регистрация      Авторизация и регистрация      */

.center_alignment {
    width: 100vw;
    height: 100vh;
    display: grid;
    place-items: center;
}

.auth_form_element {
    background: var(--main-medium);
    width: min(85%, 500px);
    display: flex;
    flex-direction: column;
    //margin: 0 auto;
}
.auth_tabs {
    width: 100%;
    height: 80px;
    display: flex;
}
.auth_tab{
    width: 50%;
    height: 100%;
    font-size: 22px;
    display: grid;
    place-items: center;
}
.auth_input_group * {
    font-size: 20px;
    outline: none;
}
.double_auth_input_group {
    display: flex;
    gap: min(20px, 3vw);
}
.double_auth_input_group * {
    width: 50%;
}
.double_auth_input_group :first-child {
    padding-right: min(20px, 3vw);
}
.auth_input {
    width: 100%;
    border: 1px solid var(--main-accent);
    height: 30px;
    font-family: Arial;
    font-weight: 600;
    font-size: 18px;
    padding: 0 3px;
}
.auth_header{
    text-align: center;
}
.auth_form_element .custom_button{
    width: 160px;
    height: auto;
    font-size: 20px;
    margin-top: 20px;
}
.auth_form{
    width: 80%;
    margin: 0 auto;
}
.auth_form * :not(.auth_label) {
    margin-bottom: 5px;
}
.auth_tab:not(.aselected) {
    background: var(--main-color);
}
#to_home{
    opacity: 80%;
    text-decoration: underline;
    margin-bottom: 10px;
    margin-left: auto;
    margin-right: 35px;
    padding: 0 15px 15px 20px;
}

/* todo Профиль Профиль Профиль Профиль Профиль Профиль Профиль Профиль Профиль Профиль Профиль Профиль  */

#profile_info input:not(#profile_info input#id_avatar), #profile_info textarea, #search_form input {
    border: 1px solid var(--main-accent);
    height: 26px;
    font-family: Arial;
    font-weight: 600;
    font-size: 18px;
    padding: 0 3px;
    outline: none;
}
#profile_info textarea {
    height: 60px;
    font-size: 16px;
}
#profile_info input#id_avatar {
    border: none;
}
#profile_info #edit_form p {
    width: 100%;
    display: flex;
    gap: 10px;
    margin: 0 auto;
    height: auto;
}
#profile_info select {
    border: 1px solid var(--main-accent);
    height: 26px;
    font-size: 18px;
    outline: none;
}
#profile_info #edit_form button {
    width: 150px;
}
#profile_info .helptext {
    display: none;
}
#profile_info #edit_form p label {
    width: 40%;
    text-align: right;
}
#profile_info #edit_form p input, #profile_info #edit_form p textarea, #profile_info #edit_form p select {
    width: 50%;
}
#profile_info #edit_form p:text {
    color: red;
}
#profile_info #edit_form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 auto;
}
#profile_info #edit_form button {
    margin: 0 auto;
    margin-top: 10px;
}

