/**
 * OpticoBD AI Assistant - Frontend Styles
 * Version: 1.0.0
 */

:root {
    --optic-blue: #0D3A6A;
    --optic-gold: #D4AF37;
    --bot-bg: #F0F2F5;
}

#ai-trigger-btn {
    position: fixed;
    bottom: 120px;
    right: 12px;
    width: 50px;
    height: 50px;
    background: #fff;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    box-shadow: 0 4px 15px rgba(13, 58, 106, 0.3);
    border: 2px solid var(--optic-blue);
    overflow: hidden;
    animation: botBouncePulse 2.5s infinite;
}

#ai-trigger-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes botBouncePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 58, 106, 0.5);
    }
    30% {
        transform: scale(1.05) translateY(-5px);
        box-shadow: 0 0 0 10px rgba(13, 58, 106, 0);
    }
    100% {
        transform: scale(1);
    }
}

#optic-ai-widget {
    position: fixed;
    bottom: 60px;
    right: 12px;
    width: 360px;
    max-width: 90vw;
    height: 580px;
    max-height: 75vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000000;
    overflow: hidden;
    border: 1px solid rgba(13, 58, 106, 0.1);
    font-family: 'Noto Serif Bengali', sans-serif;
    animation: slideUp 0.3s ease;
}

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

#chat-header {
    background: var(--optic-blue);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--optic-gold);
}

#chat-header span {
    font-size: 17px;
    font-weight: 600;
}

#chat-header .header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

#chat-header .action-btn {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
    transition: 0.2s;
}

#chat-header .action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #FAFAFA;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.msg {
    max-width: 85%;
    padding: 12px 18px;
    font-size: 15.5px;
    line-height: 1.6;
    border-radius: 16px;
    word-wrap: break-word;
}

.user-msg {
    align-self: flex-end;
    background: var(--optic-blue);
    color: #fff;
    border-bottom-right-radius: 2px;
}

.bot-msg {
    align-self: flex-start;
    background: var(--bot-bg);
    color: #1A1A1A;
    border-bottom-left-radius: 2px;
    font-weight: 500;
}

.user-img-preview {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 5px;
    display: block;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--optic-blue);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

#quick-replies {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    overflow-x: auto;
    white-space: nowrap;
    border-top: 1px solid #eee;
    scrollbar-width: none;
}

#quick-replies::-webkit-scrollbar {
    display: none;
}

.q-btn {
    flex-shrink: 0;
    background: #f4f6f8;
    color: var(--optic-blue);
    border: 1px solid #dce1e6;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Noto Serif Bengali', sans-serif;
}

.q-btn:hover {
    background: var(--optic-blue);
    color: #fff;
}

#chat-footer {
    padding: 12px 15px;
    background: #fff;
    border-top: 1px solid #eee;
}

#chat-input-box {
    width: 100%;
    border: 1px solid #e0e0e0;
    padding: 12px;
    border-radius: 8px;
    outline: none;
    font-size: 15px;
    margin-bottom: 10px;
    font-family: 'Noto Serif Bengali', sans-serif;
    box-sizing: border-box;
    resize: none;
}

.footer-btns {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Noto Serif Bengali', sans-serif;
}

.upload-btn:hover {
    background: #e0e0e0;
}

.send-btn {
    background: var(--optic-blue);
    color: #fff;
    border: none;
    padding: 8px 22px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Noto Serif Bengali', sans-serif;
}

.send-btn:hover:not(:disabled) {
    background: #185494 !important;
    color: #ffffff !important;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#img-status {
    font-size: 12px;
    color: #28a745;
    margin-bottom: 5px;
    display: none;
    font-weight: 600;
}

#img-status.active {
    display: block;
}

#error-msg {
    font-size: 12px;
    color: #dc3545;
    margin-bottom: 5px;
    display: none;
}

#error-msg.active {
    display: block;
}