/**
 * Majaarh Copilot - Styles
 * نظام تصميم عصري وجميل
 */

/* ============================================
   الزر العائم (Floating Button)
   ============================================ */
#copilot-button {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8B0000, #DC143C);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

#copilot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(139, 0, 0, 0.6);
}

#copilot-button i {
    color: white;
    font-size: 28px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(139, 0, 0, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(139, 0, 0, 0.7);
    }
}

/* ============================================
   نافذة الشات (Chat Window)
   ============================================ */
#copilot-window {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

#copilot-window.open {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* الهيدر */
#copilot-header {
    background: linear-gradient(135deg, #8B0000, #DC143C);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#copilot-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

#copilot-header-title i {
    font-size: 24px;
}

#copilot-header-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#copilot-header-title p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

#copilot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#copilot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* منطقة الرسائل */
#copilot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.copilot-message {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.copilot-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.copilot-message.user .copilot-message-avatar {
    background: #2F4F4F;
    color: white;
}

.copilot-message.assistant .copilot-message-avatar {
    background: linear-gradient(135deg, #8B0000, #DC143C);
    color: white;
}

.copilot-message-content {
    flex: 1;
    background: white;
    padding: 12px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    line-height: 1.6;
}

.copilot-message.user .copilot-message-content {
    background: #2F4F4F;
    color: white;
}

.copilot-message-content p {
    margin: 0 0 10px 0;
}

.copilot-message-content p:last-child {
    margin-bottom: 0;
}

.copilot-message-content strong {
    font-weight: 600;
}

.copilot-message-content ul {
    margin: 10px 0;
    padding-right: 20px;
}

.copilot-message-content li {
    margin: 5px 0;
}

/* مؤشر الكتابة */
.copilot-typing {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
}

.copilot-typing.active {
    display: flex;
}

.copilot-typing-dots {
    display: flex;
    gap: 5px;
}

.copilot-typing-dot {
    width: 8px;
    height: 8px;
    background: #8B0000;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.copilot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.copilot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* منطقة الإدخال */
#copilot-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

#copilot-input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

#copilot-input:focus {
    border-color: #8B0000;
}

#copilot-send {
    background: linear-gradient(135deg, #8B0000, #DC143C);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#copilot-send:hover {
    transform: scale(1.05);
}

#copilot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    #copilot-window {
        width: calc(100% - 20px);
        height: calc(100vh - 120px);
        left: 10px;
        bottom: 80px;
    }
    
    #copilot-button {
        left: 20px;
        bottom: 20px;
    }
}

/* Scrollbar */
#copilot-messages::-webkit-scrollbar {
    width: 6px;
}

#copilot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#copilot-messages::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 3px;
}

#copilot-messages::-webkit-scrollbar-thumb:hover {
    background: #DC143C;
}
