/* AI Assistant Styles - SDIT Darussalam */

:root {
    --ai-primary: #f43f5e;
    --ai-secondary: #fb7185;
    --ai-glass-bg: rgba(255, 255, 255, 0.85);
    --ai-shadow: 0 15px 35px rgba(244, 63, 94, 0.2);
}

/* Floating Button */
#ai-chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: var(--ai-shadow);
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ai-chat-toggle:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 20px 40px rgba(244, 63, 94, 0.4);
}

/* Chat Container */
#ai-chat-container {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: var(--ai-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#ai-chat-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ai-header-text h6 {
    margin: 0;
    font-weight: 700;
}

.ai-header-text span {
    font-size: 11px;
    opacity: 0.8;
}

/* Chat Body */
#ai-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
}

/* Message Styles */
.ai-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message.bot {
    align-self: flex-start;
    background: white;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.ai-message.user {
    align-self: flex-end;
    background: var(--ai-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Chat Footer */
.ai-chat-footer {
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-input-group {
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ai-input-group input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
}

.ai-send-btn {
    background: var(--ai-primary);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.ai-send-btn:hover {
    background: var(--ai-secondary);
}

/* Quick Replies */
.ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 5px;
}

.ai-quick-reply-btn {
    background: white;
    border: 1px solid var(--ai-primary);
    color: var(--ai-primary);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.ai-quick-reply-btn:hover {
    background: var(--ai-primary);
    color: white;
}

/* Typing Animation */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 14px;
}

.ai-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    display: inline-block;
    animation: ai-bounce 1.4s infinite ease-in-out both;
}

.ai-typing span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Markdown Support Styles */
.ai-message ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.ai-message a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
    #ai-chat-container {
        width: 100%;
        right: 0;
        bottom: 0;
        height: 100%;
        border-radius: 0;
    }

    #ai-chat-toggle {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }
}