* {
    box-sizing: border-box;
    font-family: Tahoma, sans-serif;
}

body {
    margin: 0;
    background: #f5f7f6;
}

/* الهيكل */
.chat-container {
    display: flex;
    height: 100vh;
}

/* القائمة الجانبية */
.sidebar {
    width: 280px;
    background: #009570;
    color: white;
    padding: 20px;
    position: relative;
}

.logo-box {
    text-align: center;
    margin-bottom: 20px;
}

.logo-box img {
    width: 90px;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: #0f8b6d;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

/* عناصر سجل المحادثات */
.chat-history {
    margin-top: 15px;
    max-height: calc(100vh - 260px);
    overflow-y: auto;
}

.chat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.15);
    padding: 8px 10px;
    border-radius: 6px;
    margin: 6px 0;
    cursor: pointer;
    font-size: 13px;
}

.chat-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-delete-btn {
    margin-right: 8px;
    background: transparent;
    border: none;
    color: #ffd1d1;
    cursor: pointer;
}

/* أزرار أسفل القائمة */
.sidebar-footer {
    position: absolute;
    bottom: 20px;
    width: 85%;
}

.sidebar-footer button {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #0f8b6d;
    cursor: pointer;
}

/* المحتوى */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.chat-header {
    padding: 15px;
    background: #009570;
    color: white;
    text-align: center;
    font-size: 18px;
}

.chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    max-width: 70%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 10px;
    line-height: 1.6;
    font-size: 14px;
}

.message.user {
    margin-left: auto;
    background: #e6f6f1;
    color: #0f8b6d;
}

.message.model {
    margin-right: auto;
    background: #f1f1f1;
}

.input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
}

#user-input {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    resize: none;
}

#send-btn {
    margin-right: 10px;
    background: #0f8b6d;
    border: none;
    padding: 0 18px;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

#send-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Modal الإعدادات */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.modal-content input {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.modal-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

#saveSettingsBtn {
    background: #0f8b6d;
    color: white;
}

#cancelSettingsBtn {
    background: #ccc;
    color: #333;
}

.disclaimer {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin: 8px 15px 15px;
}
