:root {
    --bg-color: #343541;
    --sidebar-bg-color: #202123;
    --input-bg-color: #40414f;
    --border-color: rgba(255, 255, 255, 0.2);
    --text-color: #ececf1;
    --secondary-text-color: #a9a9b3;
    --card-hover-bg: #4c4d5b;
}

.ES{
    position: absolute;
    right: 690px;
    top: 200px;

    text-align: center;
    font-size: 55px;


}
body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    direction: rtl;
}

.page-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg-color);
    display: flex;
    flex-direction: column;
    padding: 10px;
    flex-shrink: 0;
}
.sidebar-header .new-chat-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 5px;
    text-align: right;
    cursor: pointer;
    font-size: 0.9em;
}
.new-chat-btn i { margin-left: 10px; }
.chat-history { flex-grow: 1; margin-top: 20px; overflow-y: auto; }
.chat-history p { font-size: 0.8em; color: var(--secondary-text-color); padding: 0 10px; }
.chat-history ul { list-style: none; padding: 0; margin: 0; }
.chat-history li { padding: 10px 15px; border-radius: 5px; cursor: pointer; display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-history li.active, .chat-history li:hover { background-color: var(--input-bg-color); }
.sidebar-footer { border-top: 1px solid var(--border-color); padding-top: 10px; }
.user-profile { padding: 10px 15px; cursor: pointer; display: flex; align-items: center; gap: 10px; }

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 150px;
}

/* Welcome Screen */
.welcome-screen { text-align: center; padding-top: 15vh; }
.welcome-screen .logo { font-size: 3rem; font-weight: 800; }
.example-cards { display: flex; justify-content: center; gap: 15px; margin-top: 40px; flex-wrap: wrap; }
.card { background-color: transparent; border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; width: 220px; cursor: pointer; transition: background-color 0.3s; }
.card:hover { background-color: var(--card-hover-bg); }
.card h4 { margin: 0 0 10px 0; }
.card p { margin: 0; font-size: 0.9em; color: var(--secondary-text-color); }

/* Chat Messages */
.message { display: flex; gap: 20px; padding: 20px; max-width: 800px; margin: 0 auto; }
.message .icon { font-size: 1.8rem; width: 30px; text-align: center; flex-shrink: 0; }
.message .text { line-height: 1.7; word-wrap: break-word; overflow-wrap: break-word; width: 100%;}
.ai-message { background-color: #444654; }

/* Styles for formatted code blocks */
.ai-message pre {
    background-color: #202123;
    color: #d1d5db;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    position: relative;
}
.ai-message code {
    font-family: 'Courier New', Courier, monospace;
    direction: ltr;
    text-align: left;
}
.copy-code-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #555;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Chat bubbles and timestamps */
.message.user-message {
    justify-content: flex-end;
    text-align: right;
}
.message.ai-message {
    justify-content: flex-start;
    text-align: left;
}

.message .text {
    background-color: #444654;
    border-radius: 16px;
    padding: 12px 15px;
    display: inline-block;
    max-width: 75%;
    position: relative;
}
.user-message .text {
    background-color: #4caf50; /* Softer green */
    color: white;
}
.message .timestamp {
    font-size: 0.75em;
    color: var(--secondary-text-color);
    margin-top: 5px;
}

/* Light mode support */
body.light-mode {
    --bg-color: #fdfdfd;
    --text-color: #222;
    --sidebar-bg-color: #e8e8e8;
    --input-bg-color: #eee;
    --border-color: rgba(0, 0, 0, 0.1);
    --secondary-text-color: #666;
    --card-hover-bg: #e0e0e0;
}


.chat-container::-webkit-scrollbar {
    display: none;
}
.chat-container {
    -ms-overflow-style: none;  /* IE 10+ */
    scrollbar-width: none;     /* Firefox */
}



pre:hover .copy-code-btn { opacity: 1; }

/* Input Area */
.chat-input-area { position: absolute; bottom: 0; width: 100%; padding: 20px 0; background: linear-gradient(to top, rgba(52, 53, 65, 1) 80%, rgba(52, 53, 65, 0));}
.input-form { max-width: 800px; margin: 0 auto; background-color: var(--input-bg-color); border-radius: 8px; border: 1px solid var(--border-color); display: flex; align-items: center; padding: 0 15px;}
#userInput { flex-grow: 1; background: transparent; border: none; outline: none; color: var(--text-color); resize: none; font-size: 1.1em; padding: 15px 10px; max-height: 200px; }
#userInput::placeholder { color: var(--secondary-text-color); }
.input-form button { background: transparent; border: none; color: var(--secondary-text-color); font-size: 1.2rem; cursor: pointer; padding: 10px;}
#mic-btn.is-listening { color: #19c37d; }
.disclaimer { text-align: center; font-size: 0.8em; color: var(--secondary-text-color); margin-top: 10px; }

/* Typing Indicator */
.typing-indicator { display: flex; gap: 5px; align-items: center; }
.typing-indicator span { width: 8px; height: 8px; background-color: #999; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }