/* Import IranSans Font */
@font-face {
    font-family: 'IranSans';
    src: url('iransans/IRANSansX-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* General Styles */
body {
    font-family: 'IranSans';
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    direction: rtl; 
}

#main-chat {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85); 
    box-sizing: border-box;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    background: linear-gradient(90deg, #2980b9 0%, #0d99ff 100%); 
    color: white;
    padding: 15px 25px; 
    font-size: 28px; 
    font-weight: 600; 
    border-bottom: 3px solid #0d99ff; 
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

header div {
    display: flex;
    align-items: center;
}

header div img {
    height: 60px; 
    width: auto;
    vertical-align: middle;
    margin-left: 10px;
}

header div h1 {
    margin: 0; 
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px; 
}

#chat-container {
    flex: 1;
    padding-top: 70px;
    padding-bottom: 70px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    background: rgba(255, 255, 255, 0.8);
    margin: 70px 0;
}

.message-container {
    display: flex;
    margin: 10px;
}

.bot-message-container {
    justify-content: flex-end; 
}

.message {
    word-wrap: break-word;
    font-size: 16px;
    max-width: 40%;
}

.user-message {
    background-color: #3dacf6;
    color: white;
    border-radius: 10px;
    padding: 10px 15px;
    align-self: flex-end;
}

.bot-message {
    align-self: flex-end;
    background-color: #f1f0f0;
    border-radius: 10px;
    padding: 10px 15px;
    text-align: justify;
}

.loader-message {
    max-width: 50px;
    background-color: #f1f0f0;
    border-radius: 10px;
    padding: 10px 15px;
}

.user-message-container {
    justify-content: flex-start; 
}

.bot-icon-container {
    margin-right: 10px; 
}

.bot-icon {
    width: 40px; 
    height: 40px;
    border-radius: 50%; 
    object-fit: cover;
}

.bot-icon {
    width: 30px; 
    height: 30px;
    border-radius: 25px; 
    object-fit: cover;
    margin-left: 10px; 
    background-color: #3dacf6; 
    border: 2px solid #dadde4; 
    padding: 2px; 
}

#input-container {
    display: flex;
    position: fixed;
    width: 100%;
    bottom: 0;
    padding: 0 5px;
    border-top: 2px solid #ccc;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background-color: #f9f9f9;
}

#input-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
}

#user-input {
    flex: 1;
    padding: 10px 40px 10px 40px; 
    border-radius: 20px;
    border: 1px solid rgb(244, 244, 244);
    box-sizing: border-box;
    overflow-y: auto;
    resize: none;
    height: 50px; /* Reduced height */
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 16px;
    text-align: justify;
    text-justify: inter-word;
    font-family: 'IranSans';
    text-align: justify; 
    text-justify: inter-word;
    font-weight: normal; 
    
}

.buttons {
    display: flex;
    gap: 10px;
    margin-left: 10px;
    margin-top: 4px;
}

#send-button {
    position: absolute;
    left: 10px;
}
.active-send {
    color: #007bff;
    cursor: pointer;
}

.inactive-send {
    color: #ccc;
    cursor: inherit;
}

#reset-button  {
    border: none;
    cursor: pointer;
    color: #a9a9a9;
    font-size: 18px;
    padding: 0 10px;
}

#reset-button:hover  {
    color: #007bff;
}

.loader {
    width: 50px;
    height: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.loader span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #3498db; 
    animation: loader-animation 0.8s infinite ease-in-out;
}

.loader span:nth-child(2) {
    animation-delay: 0.2s; 
}

.loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes loader-animation {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    header div h1 {
        font-size: 20px; 
    }
    .message {
        word-wrap: break-word;
        text-align: justify;
        font-size: 16px;
    }
    
    .user-message {
        background-color: #3dacf6;
        color: white;
        border-radius: 10px;
        padding: 10px 15px;
        align-self: flex-start;
        max-width: 40%;
    }
    
    .bot-message {
        align-self: flex-end;
        background-color: #f1f0f0;
        border-radius: 10px;
        padding: 10px 15px;
        align-self: flex-end;
        max-width: 60%;
    }
    
    header div img {
        height: 40px; 
    }
}

@media (max-width: 480px) {
    header div h1 {
        font-size: 18px; 
    }

    header div img {
        height: 30px; 
    }
}