* {
    box-sizing: border-box;
    margin:0;
    padding:0;
}
@font-face{
    src:url('iran.ttf');
    font-family:parsa;
}
.row{
    width:100%;
    display:flex;
    justify-content:center;
    margin-bottom:20px;
}

body {
    direction:rtl;
    margin: 0;
    background: #f5f8fa;
    font-family:parsa;
}
input, button, textarea{
        font-family:parsa;
    &::placeholder{
            font-family:parsa;

    }
}

.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid #ddd;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar h2 {
    margin-bottom: 15px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    flex: 1;
}

.sidebar li {
    padding: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 6px;
}

.sidebar li:hover,
.sidebar li.active {
    background: #e8f5fd;
}

.logout {
    text-align: center;
    padding: 10px;
    background: #ffeded;
    color: #900;
    text-decoration: none;
    border-radius: 6px;
}

/* Chat */
.chat {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.messages {

    span{
        font-size:16px !important;
    }
    small{
        display: block;
        width: 100%;
        color:gray;
    }
    >div{
    
        font-size:12px;
    
}
}

.message {
    background: #ffffff;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

.message .name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size:10px !important;
}

.message .time {
    font-size: 12px;
    color: #777;
}

/* Form */
.chat-form {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
    background: #fff;
}

.chat-form textarea {
    flex: 1;
    resize: none;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.chat-form button {
    margin-left: 10px;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    background: #1da1f2;
    color: #fff;
    cursor: pointer;
}
.chat-title {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background: #ffffff;
    font-weight: bold;
    display:flex;
    align-items:center;
    b{
        font-size:15px;
        margin-right:10px;
    }
}
body {
    background: #f0f2f5;
}

.auth-container {
    display: flex;
    flex-wrap:wrap;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.auth-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    width: 350px;
    text-align: center;
}

.auth-box h2 {
    margin-bottom: 20px;
    color: #333;
}

.auth-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
}

.auth-box button {
    width: 100%;
    padding: 12px;
    background: #4caf50;
    border: none;
    color: white;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
}

.auth-box button:hover {
    background: #45a049;
}

.auth-box p {
    margin-top: 10px;
    font-size: 14px;
}

.auth-box a {
    color: #4caf50;
    text-decoration: none;
}

.auth-box a:hover {
    text-decoration: underline;
}

.error {
    color: red;
    margin-bottom: 10px;
}

.success {
    color: green;
    margin-bottom: 10px;
}


.container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid #ccc;
    padding: 20px;
    box-sizing: border-box;
}

.sidebar h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1da1f2;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    padding: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar ul li:hover, .sidebar ul li.active {
    background: #1da1f2;
    color: #fff;
}

.user-box {
    margin-top: 20px;
    font-size: 14px;
}

.logout {
    display: block;
    margin-top: 10px;
    color: red;
    text-decoration: none;
}

/* Main Chat */
.chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f8fa;
}

.chat-title {
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
}



.message {
    background: #fff;
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    word-wrap: break-word;
}

.chat-form {
    display: flex;
    padding: 10px 20px;
    border-top: 1px solid #ccc;
    background: #fff;
}

.chat-form textarea {
    flex: 1;
    resize: none;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.chat-form button {
    margin-left: 10px;
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    background: #1da1f2;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

.chat-form button:hover {
    background: #0d8ddb;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    text-align: center;
}

.hidden { display: none; }

.modal-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.modal-box button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    margin: 5px;
    cursor: pointer;
}

.modal-box button:first-of-type { background: #1da1f2; color: #fff; }
.modal-box button:last-of-type { background: #ccc; }

.stats-box{
    margin-top:15px;
    padding:10px;
    font-size:13px;
    background:#f5f8fa;
    border-radius:8px;
    color:#333;
}
    #hamburger{
        display:none;
    }
    #emojiBox{
        >span{
            cursor:pointer;
        }
    }
    .message span {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ==========================
   Mobile Responsive
   ========================== */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
    }
    #hamburger{
        font-size:25px;
        cursor:pointer;
        position:fixed;
        top:10px;
        right:10px;
        z-index:1999;
        display:block;
    }
 
    /* Sidebar جمع میشه بالای صفحه و کوچیک میشه */
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
    }
     .sidebar{
    position: fixed;
    top:0;
    right:-100%;
    z-index:999;
    transition:.3s;
  }
  .sidebar.open{
    right:0;
  }

    .sidebar h2 {
        width: 100%;
        margin-bottom: 10px;
        font-size: 16px;
                padding-right: 35px;
    }

    .sidebar ul {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }

    .sidebar li {
        flex: 1 1 45%;
        margin: 5px;
        padding: 8px;
        font-size: 14px;
                        background: #e4e4e4;

    }

    .user-box, .logout, .stats-box {
        width: 100%;
        margin-top: 5px;
        font-size: 13px;
    }

    /* Chat */
    .chat {
        width: 100%;
        height: calc(100vh - 200px);
    }

    .chat-title {
        padding: 10px;
        font-size: 16px;
        margin-top: 40px;
    }
    #messages {
        height:100vh;
    }
    .messages {

        padding: 10px 10px 140px 10px;
    }

    .message {
        padding: 8px 10px;
        font-size: 14px;
        
    }

    .chat-form {
        flex-direction: column;
        padding: 10px;
        position: fixed !important;
        bottom: 0;
        left: 0;
        /* flex-wrap: wrap; */
        width: 100%;
    }

    .chat-form textarea {
        width: 100%;
        margin-bottom: 10px;
    }

    .chat-form button {
        width: 100%;
        margin-left: 0;
        padding: 10px;
    }

    /* Modal */
    .modal-box {
        width: 90%;
        padding: 15px;
    }

    .modal-box input {
        padding: 8px;
    }

    .modal-box button {
        padding: 8px 10px;
        margin: 3px;
    }

    .chat-form textarea, .chat-form button {
        font-size: 14px;
    }
    .auth-box{
        width: 70% !important;
        transform: translateY(-100%);
    }
    #emojiBtn{
        left: 16px !important;
    bottom: 78px !important;
    }
    #emojiBox{
        position:fixed !important;
    }

}

 
    
