@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;700&display=swap');

body,
html {
    font-family: 'Vazirmatn', Tahoma, Arial, "Segoe UI", sans-serif !important;
    background: #f4f4f4;
    margin: 0;
    padding: 0;
    direction: rtl;
}

.login-box {
    background: #fff;
    padding: 22px 22px 12px 22px;
    border-radius: 10px;
    margin: 40px auto 24px auto;
    max-width: 380px;
    min-width: 240px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    font-family: inherit;
    direction: rtl;
}

@media (max-width: 600px) {
    .login-box {
        max-width: 97vw;
        margin: 18px 2vw 8px 2vw;
        padding: 12px 3vw 10px 3vw;
    }
}

.login-box input,
.login-box button {
    width: 100%;
    min-width: 0;
    margin: 0 0 14px 0;
    font-size: 1rem;
    box-sizing: border-box;
}

.login-box input {
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 5px;
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.login-box button {
    padding: 12px 0;
    background: #0077bb;
    color: #fff;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    font-family: inherit;
    margin-bottom: 6px;
    transition: background 0.2s;
}

.login-box button:active,
.login-box button:focus {
    outline: none;
    background: #005fa3;
}

.login-box .helper-text {
    display: block;
    font-size: 14px;
    color: #555;
    margin-top: 8px;
    margin-bottom: 2px;
    text-align: right;
    line-height: 1.6;
    font-family: inherit;
}

.top-bar,
.chat-box,
.search-form,
ul.user-list,
h2,
form,
label,
div,
span,
input,
button,
a,
li {
    font-family: 'Vazirmatn', Tahoma, Arial, "Segoe UI", sans-serif !important;
    direction: rtl;
    box-sizing: border-box;
}

h2{
    font-size: 1.2rem;
}

.top-bar {
    background: #0077bb;
    color: #fff;
    border-radius: 7px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 999;
    height: 4.5rem;
    min-height: 4.5rem;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar a {
    text-decoration: none !important;
}


@media (max-width: 600px) {
    .top-bar {
        max-width: 100vw;
        padding: 10px 3vw;
        margin-bottom: 8px;
    }
}

.user-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: right;
    direction: rtl;
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.user-list li {
    padding: 8px 0;
    direction: rtl;
}

.user-list a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    word-break: break-all;
    direction: rtl;
    font-family: inherit;
}

.mine,
.theirs {
    text-align: right;
    margin: 5px;
    border-radius: 5px;
    padding: 5px 12px 5px 5px;
    direction: rtl;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-line;
    max-width: 98%;
    box-sizing: border-box;
}

.mine {
    background: #dcf8c6;
}

.theirs {
    background: #eee;
}

.t {
    font-size: 11px;
    color: #666;
    margin-left: 8px;
    margin-right: 0;
    direction: rtl;
}

.error {
    color: red;
    margin: 10px 0;
    text-align: center;
    direction: rtl;
}

h2 {
    text-align: center !important;
    direction: rtl;
    font-family: inherit;
    margin-bottom: 18px;
    margin-top: 0;
}

label {
    font-family: inherit;
    direction: rtl;
}

form {
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.search-form {
    max-width: 400px;
    margin: 0 auto 18px auto;
    text-align: right;
}

.search-form {
    max-width: 440px;
    margin: 32px auto 22px auto;
    display: flex;
    flex-direction: row;
    gap: 0;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 16px 14px 16px 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    font-family: inherit;
}

.search-form input[type="text"] {
    flex: 1 1 auto;
    font-size: 1.05rem;
    padding: 12px 10px;
    border: 1px solid #bbb;
    border-radius: 8px 0 0 8px;
    margin: 0;
    font-family: inherit;
    direction: rtl;
    text-align: right;
    outline: none;
    transition: border 0.2s;
    background: #fafbfc;
}

.search-form input[type="text"]:focus {
    border: 1.5px solid #0077bb;
    background: #fff;
}

.search-form button {
    padding: 12px 0;
    width: 110px;
    border-radius: 8px;
    border: none;
    background: #0077bb;
    color: #fff;
    font-size: 1.1rem;
    font-family: inherit;
    cursor: pointer;
    margin: 0;
    transition: background 0.2s;
}

.search-form button:active,
.search-form button:focus {
    outline: none;
    background: #005fa3;
}

@media (max-width: 600px) {
    .search-form {
        flex-direction: column;
        padding: 12px 4vw 12px 4vw;
        gap: 8px;
        max-width: 97vw;
    }
    .search-form input[type="text"],
    .search-form button {
        border-radius: 8px !important;
        width: 100% !important;
    }
}

.start-chat-btn {
    display: block;
    margin: 30px auto 0 auto;
    padding: 15px 0;
    width: 92%;
    max-width: 350px;
    background: #22c55e;
    color: #fff;
    border-radius: 10px;
    border: none;
    font-size: 1.15rem;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(34,197,94,0.07);
    text-decoration: none;
    transition: background 0.18s, box-shadow 0.18s;
}
.start-chat-btn:active,
.start-chat-btn:focus {
    background: #16a34a;
    outline: none;
}

#chat-bar {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 10px auto 10px auto;
    background: #fff;
    border-radius: 10px;
    padding: 12px 10px 8px 10px;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

#chat-bar textarea {
    flex: 1 1 auto;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    font-size: 1.08rem;
    padding: 10px 8px 10px 8px;
    border: 1px solid #bbb;
    border-radius: 8px;
    direction: rtl;
    text-align: right;
    font-family: inherit;
    margin-left: 8px;
    margin-right: 0;
    outline: none;
    transition: border 0.17s;
    background: #fafbfc;
    box-sizing: border-box;
}

#chat-bar textarea:focus {
    border: 1.5px solid #0077bb;
    background: #fff;
}

#chat-bar button {
    background: #0077bb;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.55rem;
    margin-right: 0;
    margin-left: 4px;
    transition: background 0.18s;
    padding: 0;
}

#chat-bar button:active,
#chat-bar button:focus {
    background: #005fa3;
    outline: none;
}

#chat-bar button svg {
    width: 27px;
    height: 27px;
    fill: #fff;
    display: block;
}

@media (max-width: 600px) {
    #chat-bar {
        max-width: 97vw;
        padding: 9px 2vw 7px 2vw;
    }
    #chat-bar textarea {
        font-size: 1rem;
    }
    #chat-bar button {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }
    #chat-bar button svg {
        width: 22px;
        height: 22px;
    }
}

.chat-container {
    display: flex;
    flex-direction: column;
    min-height: 95vh;
    height: 95vh;
    background: #f4f4f4;
    box-sizing: border-box;
}

#chat-bar {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 99;
    max-width: 100vw;
    width: 100vw;
    border-radius: 0;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.09);
    margin: 0;
}

@media (max-width: 600px) {
    #chat-bar {
        padding: 9px 2vw 7px 2vw;
    }
}

.chat-box {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    font-size: 1rem;
    direction: rtl;
    margin: 0;
    max-width: 100vw;
    width: 100%;
    background: #fff;
    border-radius: 7px;
    padding-top: 56px;
    padding-bottom: 88px;
}
@media (max-width: 600px) {
    .chat-box {
        padding-top: 4.7rem;
        padding-bottom: 3.5rem;
        max-width: 100vw;
        max-height: none;
        min-height: 0;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 600px) {
    .chat-container {
        min-height: 100vh;
        height: 100vh;
        max-height: 100vh;
        padding-bottom: 8px;
    }
}

.better-list {
    list-style-type: disc;
    list-style-position: outside;
    padding-right: 28px;
    font-size: 15px;
    line-height: 2;
    margin-top: 18px;
    margin-bottom: 0;
    direction: rtl;
}

.better-list li {
    text-align: justify;
    direction: rtl;
    padding-right: 0;
    margin-bottom: 6px;
}

.unread-badge {
    position: absolute;
    top: -15px;
    left: 2px;
    background: #ee2345;
    color: #fff;
    border-radius: 50%;
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.93rem;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.13);
    border: 2px solid #fff;
}


