/**
 * CodeIQ Footer Bar
 * Fixed footer containing RiQ chatbot
 */

:root {
    --footer-height: 100px;
    --footer-bg: rgba(255, 255, 255, 0.98);
    --footer-border: rgba(65, 105, 225, 0.1);
    --footer-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* Main Footer Container */
#codeiq-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: var(--footer-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--footer-border);
    box-shadow: var(--footer-shadow);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center; /* Keep RiQ centered */
    padding: 0;
    transition: all 0.3s ease;
}

/* RiQ Chatbot in Footer */
#riq-footer-chatbot-wrapper {
    position: relative;
}

/* Override chatbot positioning for footer */
#riq-chatbot-container.footer-mode {
    position: absolute;
    bottom: calc(var(--footer-height) + 10px);
    right: 20px;
    left: auto;
    top: auto;
    width: 420px;
    height: 650px;
    animation: slideUpFromFooter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* RiQ Open Button in Footer */
#riq-open-chatbot.footer-mode {
    position: static;
    width: 90px;
    height: 90px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#riq-open-chatbot.footer-mode:hover {
    transform: translateY(-5px);
}

#riq-open-chatbot.footer-mode img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(65, 105, 225, 0.25));
}

/* Speech Bubble in Footer */
#riq-speech-bubble.footer-mode {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: white;
    color: #4169E1;
    padding: 12px 18px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.9em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#riq-speech-bubble.footer-mode::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

#riq-speech-bubble.footer-mode.show {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    #codeiq-footer {
        height: 80px;
    }

    :root {
        --footer-height: 80px;
    }

    #riq-open-chatbot.footer-mode {
        width: 70px;
        height: 70px;
    }

    #riq-open-chatbot.footer-mode img {
        width: 70px;
        height: 70px;
    }

    #riq-chatbot-container.footer-mode {
        width: 100%;
        height: 500px;
        left: 0;
        right: 0;
        border-radius: 20px 20px 0 0;
    }
}

/* Main Content Padding */
body.codeiq-with-footer #codeiq-app {
    padding-bottom: calc(var(--footer-height) + 20px);
}

body.codeiq-with-footer .codeiq-dashboard {
    min-height: calc(100vh - var(--footer-height) - 20px);
    /* Override gradient in padding zone - solid white background */
    background: #ffffff;
}

/* Hide the purple radial gradients when footer is present */
body.codeiq-with-footer .codeiq-dashboard::before {
    display: none;
}
