/* -------- Layout -------- */
.chat-wrapper {
    display: flex;
    height: calc(100vh - 140px);
    min-height: 600px;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* -------- Messages -------- */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 75%;
    padding: 0.8rem 1rem;
    border-radius: 20px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: var(--shadow-sm);
}

.message.user {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 20px;
}

.message.ai {
    background: var(--bg-surface);
    border: 1px solid rgba(0,0,0,0.05);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 20px;
}

.message-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
    user-select: none;
    pointer-events: none;
}

/* -------- Code blocks -------- */
.code-block {
    background: rgba(0,0,0,0.05);
    border-left: 3px solid var(--primary-color);
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* -------- Input bar (floating) -------- */
.chat-input-area {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    width: 90%;
    max-width: 600px;
    background: var(--bg-surface);
    border-radius: 30px;
    padding: 0.3rem 0.6rem;
    display: flex;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.chat-input {
    flex: 1;
    min-height: 30px;
    max-height: 80px;
    resize: none;
    border-radius: 25px;
    border: 1px solid transparent;
    padding: 0.3rem 0.6rem;
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.chat-input-area button {
    flex-shrink: 0;
}

#clear-chat-btn {
    position: absolute;
    left: 10px;
    bottom: 50%;
    transform: translateY(50%);
    background: #e74c3c; /* أحمر داكن */
    border: none;
    border-radius: 50%; /* دائري بالكامل */
    width: 35px;
    height: 35px;
    cursor: pointer;
    z-index: 1001;
}

/* تأثير عند المرور */
#clear-chat-btn:hover {
    background: #c0392b; /* أحمر أغمق عند المرور */
}

#hi{
 color:
}
