/**
 * Fragus • Fragujemy.com • AI Agent Styles v2.0 (Elite Edition)
 */

:root {
    --ai-primary: #00d2ff;
    --ai-secondary: #0081ff;
    --ai-accent: #ff0055;
    --ai-bg: rgba(7, 11, 20, 0.94);
    --ai-glass: blur(20px) saturate(180%);
    --ai-border: rgba(0, 210, 255, 0.2);
    --ai-text-primary: #f0f0f0;
    --ai-text-secondary: #94a3b8;
    --ai-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* ═══ LAUNCHER BUTTON ═══ */
.ai-chat-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(0, 210, 255, 0.3);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: ai-float 4s ease-in-out infinite;
}

@keyframes ai-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ai-chat-launcher img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.ai-chat-launcher:hover {
    transform: scale(1.12) translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 210, 255, 0.7);
}

/* ═══ CHAT WINDOW ═══ */
.ai-chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 440px;
    height: 650px;
    background: var(--ai-bg);
    backdrop-filter: var(--ai-glass);
    -webkit-backdrop-filter: var(--ai-glass);
    border: 1px solid var(--ai-border);
    border-radius: 28px;
    display: flex;
    flex-direction: column;
    z-index: 9998;
    box-shadow: var(--ai-shadow);
    transform: translateY(30px) scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden;
    font-family: 'Inter', -apple-system, sans-serif;
}

.ai-chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* ═══ ACTION CARDS (Confirmations) ═══ */
.ai-action-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    text-align: center;
    animation: aiActionPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-action-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
    font-family: 'Poppins', sans-serif;
}

.ai-action-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.ai-act-btn {
    padding: 6px 20px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 1px;
}

.ai-act-confirm {
    background: #ff3c3c;
    border: 1px solid #ff3c3c;
    color: #fff;
}

.ai-act-confirm:hover {
    background: #ff5c5c;
    box-shadow: 0 0 15px rgba(255, 60, 60, 0.3);
}

.ai-act-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

.ai-act-cancel:hover {
    border-color: #fff;
    color: #fff;
}

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

/* ═══ HEADER ═══ */
.ai-chat-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-chat-header-text b {
    display: block;
    font-size: 14px;
    color: #fff;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ai-chat-header-text span {
    font-size: 11px;
    color: var(--ai-primary);
    font-weight: 600;
    text-transform: uppercase;
}

.ai-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.ai-close-btn:hover {
    color: #fff;
    background: rgba(255, 60, 60, 0.2);
}

.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.35);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
}

.ai-header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ai-header-btn.ai-discord-header-btn:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: rgba(88, 101, 242, 0.4);
    color: #5865F2;
}

.ai-header-btn svg {
    stroke-width: 1.8px;
}

/* ═══ MESSAGES AREA ═══ */
.ai-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.3);
    border-radius: 3px;
}

.ai-msg {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    animation: ai-slideIn 0.3s ease-out;
}

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

.ai-msg-bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.07);
    color: var(--ai-text-primary);
    border-bottom-left-radius: 4px;
}

.ai-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
    color: #fff;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.ai-msg a {
    color: var(--ai-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 1px solid transparent;
}

.ai-msg a:hover {
    color: #fff;
    border-bottom-color: var(--ai-primary);
}

/* ═══ SUGGESTED TOPICS ═══ */
.ai-suggested-topics {
    padding: 12px 16px;
    background: rgba(0, 210, 255, 0.03);
    border-top: 1px solid rgba(0, 210, 255, 0.1);
}

.ai-topics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ai-topic-btn {
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.2);
    color: var(--ai-primary);
    padding: 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-topic-btn:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: var(--ai-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* ═══ INPUT AREA ═══ */
.ai-chat-input-area {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
}

.ai-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.ai-input:focus {
    border-color: var(--ai-primary);
}

.ai-send-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
    border: none;
    border-radius: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-send-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    gap: 5px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    align-self: flex-start;
}

.ai-typing span {
    width: 7px;
    height: 7px;
    background: var(--ai-primary);
    border-radius: 50%;
    animation: ai-bounce 1.4s infinite ease-in-out;
    opacity: 0.7;
}

.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); }
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100% - 20px);
        bottom: 90px;
        right: 10px;
        height: 60vh;
    }
}
