* {
    box-sizing: initial;
    margin: 0;
    padding: 0;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 200px; /* Match sidebar width */
    width: calc(100% - 200px); /* Full width minus sidebar */
    height: 60px; /* Navbar height */
    background: #253b74;
    display: flex;
    align-items: center;
    justify-content: center; /* Center title */
    z-index: 1000; /* Ensure it stays on top */
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}  

.main-title {
    font-size: 20px;
    color: #91be3f;
    text-align: center;
    font-weight: bold;
    /* margin-top: 10px; */
}
body {
    font-family: 'Cairo', sans-serif;
    background: rgb(233, 233, 233); /* Grey Gradient */
    height: 100vh; /* Ensure the body height is the full viewport */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent the body from scrolling */
}
.logo {
    position: fixed;
    top: 20px;
    left: 40px;  /* Center within sidebar */
    width: 120px;
    height: auto;
    z-index: 101; /* Keep logo above sidebar */
    filter: drop-shadow(5px 5px 10px rgba(97, 96, 96, 0.5));
    background-color: transparent;
}
.info-button {
    right: 5%;
    display: flex;
    align-items: center;
    height: auto;
    position: absolute;
    text-decoration: none;
    font-size: 35px;
    font-weight:bolder ;
    background-color: transparent;
    color: rgb(255, 255, 255);
    border: none;
}
.info-button:hover {
    color: #91be3f;
}                   


.chat-messages {
    width: 900%; /* Full width relative to container */
    max-width: 800px; /* Limit the width for readability */
    flex-grow: 1; /* Allow messages to grow vertically */
    display: flex;
    flex-direction: column; /* Stack messages vertically */
    gap: 1rem; /* Space between messages */
    padding: 1rem; /* Space inside the messages area */ 
    height: 73%; /* Take up 73% of the remaining container height */
    overflow-x: hidden; /* Hide horizontal scrollbar */
    overflow-y: visible; /* Show content without vertical scrollbar */
}

/* Base message styling */
.message {
    margin: 15px 0;
    max-width: 80%;
    border-radius: 20px;
    animation: slideIn 0.3s ease-out;
    word-wrap: break-word;
    white-space: pre-wrap;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Bot Message Styling */
.bot-message {
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border-radius: 20px 20px 20px 0;
    margin-right: auto;
    padding: 15px 20px 15px 45px;
    position: relative;
}

.bot-message::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h2v3c0 .9 1.1 1.3 1.7.7l3.3-3.7h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-6 10c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zm-4 0c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zm7-2H7c-.55 0-1-.45-1-1s.45-1 1-1h10c.55 0 1 .45 1 1s-.45 1-1 1z"/></svg>');}

/* User Message Styling */
.user-message {
    background: linear-gradient(145deg, #91be3f, #a8d44d);
    color: white;
    padding: 15px 45px 15px 20px;
    margin-left: auto;
    border-radius: 20px 20px 0 20px;
    position: relative;
}

.user-message::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>') center/contain no-repeat;
}

/* Animation for messages */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.standard {
    padding: 20px;
 background: rgb(225, 225, 225);
 white-space: pre-line;
 border-radius: 20px 20px 20px 0;
 margin-right: auto;
}
/* Scrollbar styling for Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #91be3f, #82ab39);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, #82ab39, #739732);
}


#chat-messages {
    top: 60px; /* Height of navbar */
    position: fixed; /* Fix at the bottom */
    /* Spacing from the bottom */
    left: calc(100px + 50%); /* Start from the sidebar edge and center in remaining space */
    transform: translateX(-50%); /* Adjust to center */
    width: calc(100% - 240px); /* Total site width minus sidebar and padding */
    max-width: 1000px; /* Match chat messages width */
    padding: 1rem;
    display: flex;
    gap: 10px; /* Space between textarea and button */
    border-radius: 15px; /* Rounded corners */
    z-index: 1000; /* Keep above all elements */

}


/* Removed duplicate .main-title class */


.input-area {
    position: fixed;
    bottom: 20px;
    left: calc(100px + 50%);
    transform: translateX(-50%);
    background: #ffffff;
    width: calc(100% - 240px);
    max-width: 800px;
    padding: 0.5rem;
    display: flex;
    gap: 10px;
    border-radius: 15px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
 }
 
 .input-area textarea {
    flex-grow: 1;
    min-height: 50px;
    max-height: 300px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-size: 16px;
    font-family: 'Arial', sans-serif;
    line-height: 1.5;
    outline: none;
    resize: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s ease;
 }
 
 .input-area {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.input-area:focus-within {
    /* transform: translateY(-2px); */
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.input-area textarea {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.input-area textarea:focus {
    border-color: #91be3f;
    box-shadow: 0 0 0 3px rgba(145, 190, 63, 0.2);
}

#send-button {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    border: none;
    background: #91be3f;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 5px rgba(145, 190, 63, 0.3);
}
 
#send-button::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>') center/contain no-repeat;
}

#send-button:hover {
    background: #a8d44d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(145, 190, 63, 0.4);
}

#send-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(145, 190, 63, 0.3);
}
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(37, 59, 116, 0.95); /* Semi-transparent background */
    color: #fff;
    text-align: center;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

.typing-indicator {
    display: none;
    padding: 10px 20px;
    background: linear-gradient(145deg, #f0f0f0, #ffffff);
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    padding-left: 45px;
}

.typing-indicator::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2391be3f"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>') center/contain no-repeat;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #91be3f;
    border-radius: 50%;
    margin-right: 3px;
    animation: bounce 1.4s infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px) scale(1.1); }
}

.spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
}
.loading {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #00aef8;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.chat-container ul {
    /* list-style-type: disc;  */
    list-style-position: inside;
    /* padding-left: 0;  */
  }
  
  .chat-container li {
    margin-bottom: 10px;
    padding-left: 20px; 
  }
  table {
    border-collapse: collapse;
    width: 100%; /* Optional: Adjust width as needed */
  }
  
  table, th, td {
    border: 1px solid black; /* Defines the grid lines */
  }
  
  th, td {
    padding: 8px;
    text-align: left; /* Optional: Adjust alignment as needed */
  }
 .bot-message[dir="rtl"] {
    direction: rtl;
    text-align: right;
}
.bot-message[dir="ltr"] {
    direction: ltr;
    text-align: left;
  }
  .platform-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 200px;
    background: #253b74;
    padding: 100px 0 20px 0;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.platform-options {
    /* margin-top: 10px; */
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 20px;
    flex: 1;
    overflow-y: auto;
}

.platform-option {
    background: transparent;
    color: white;
    border: 2px solid #91be3f;
    padding: 2px 2px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: bold;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-option {
    background: linear-gradient(145deg, #2a4180, #233a70);
    border:solid 1px  ;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.platform-option:hover {
    transform: translateX(10px) scale(1.02);
    background: linear-gradient(145deg, #91be3f, #82ab39);
}

.platform-option.selected {
    background: linear-gradient(145deg, #91be3f, #82ab39);
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(145, 190, 63, 0.3);
}

.chat-history {
    top: 50%;
    padding: 0 20px;
    position: relative;
    z-index: 101;
    max-height: 50%;
    display: flex;
    flex-direction: column;
    animation: slideInFromTop 0.5s ease-out;
}

.history-title {
    color: yellowgreen;
    font-size: 18px;
    margin: 15px 0;
    text-align: center;
    flex-shrink: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.6s ease-out;
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    width: 170px;
    padding-right: 10px;
    flex: 1;
    animation: fadeIn 0.8s ease-out;
}

.thread-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    word-break: break-word;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideInFromLeft 0.5s ease-out;
}

.thread-item:hover {
    background: rgba(145, 190, 63, 0.2);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-color: rgba(145, 190, 63, 0.3);
}

.thread-item:active {
    transform: translateX(2px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.thread-list::-webkit-scrollbar {
    width: 5px;
}

.thread-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.thread-list::-webkit-scrollbar-thumb {
    background: rgba(145, 190, 63, 0.5);
    border-radius: 5px;
    transition: background 0.3s ease;
}

.thread-list::-webkit-scrollbar-thumb:hover {
    background: rgba(145, 190, 63, 0.7);
}

/* Animations */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
 p, ul {
    display: inline-block;
    vertical-align: top;
    margin: 0 5px;
    padding: 0;
    /* Adjust spacing as needed */
}

@media (max-width: 768px) {
    body {
        /* background: linear-gradient(135deg, #fcfcfc, #e6e6e6); */
        margin: 0;
        padding: 0;
        height: 100vh;
        overflow: hidden;
        background: #253b74;
    }
    .input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(37, 59, 116, 0.95);
        padding: 0.8rem;
        backdrop-filter: blur(10px);
        border-top: 2px solid #91be3f;
    }
    .chat-header {
        display: none;
        }
  /* First, make sure the navbar stays fixed */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e6e6e6;
    padding: 35px 20px;
    position: fixed;  /* Make navbar fixed */
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    width: 100px;
    height: auto;
    margin-top: -px;
    left: 2%;
    position: fixed;  /* Make logo fixed */
    filter: drop-shadow(5px 5px 10px rgba(97, 96, 96, 0.5));  
    background-color: transparent;
    z-index: 1000;
}

.info-button {
    right: 3%;
    display: flex;
    align-items: center;
    height: auto;
    position: fixed;  /* Make info button fixed */
    text-decoration: none;
    font-size: 35px;
    font-weight: bolder;
    background-color: transparent;
    color: #91be3f;
    border: none;
    z-index: 1000;
}

/* Adjust chat container to account for fixed navbar */

 .platform-sidebar {
        left: 50%;
        top: -300px;
        transform: translateX(-50%);
        width: 250px;
        border-radius: 0 0 20px 20px;
        transition: top 0.3s ease;
        padding-bottom: 45px; /* Added padding to prevent overlap */
    }



    .platform-option:hover {
        transform: translateY(5px);
    }

    .platform-option {
        padding: 10px 15px;
        font-size: 14px;
    }
    .bot-message {
        /* background: #91be3f; */
        white-space: pre-line;
        /* border-radius: 20px 20px 20px 0; */
        /* margin-right: auto; */
        align-self: flex-start;
    }
    .user-message {
        background: rgba(54, 162, 235, 0.8);
        margin-left: auto;
        padding: auto;
        white-space: pre-line;
        border-radius: 20px 20px 0 20px;
        align-self: flex-end;
    }
    }
/* Textarea Styling */
textarea {
    width: 100%; /* Adjust width as needed */
    height: 50px; /* Adjust height as needed */
    resize: none; /* Disable manual resizing */
    overflow: hidden; /* Hide the scrollbar when text exceeds container */
    font-family: Arial, sans-serif; /* Change font */
    font-size: 16px; /* Adjust font size */
    line-height: 1.5; /* Improve line spacing */
    padding: 10px; /* Add some padding for better appearance */
    box-sizing: border-box; /* Include padding in width/height */
}

/* Placeholder Styling */
textarea::placeholder {
    font-family: 'Courier New', Courier, monospace; /* Change placeholder font */
    font-size: 14px; /* Adjust placeholder font size */
    color: #999; /* Lighter color for placeholder */
}
