/* AgriNovel ChatBot Pro - Frontend Styles */
:root {
    --agri-color: #22c55e;
}

#agri-chatbot-widget {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#agri-chatbot-widget.agri-position-right {
    right: 20px;
}

#agri-chatbot-widget.agri-position-left {
    left: 20px;
}

.agri-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--agri-color);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.agri-fab:hover {
    transform: scale(1.05);
}

.agri-fab:active {
    transform: scale(0.95);
}

.agri-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.agri-position-right .agri-window {
    right: 0;
}

.agri-position-left .agri-window {
    left: 0;
}

.agri-window.agri-visible {
    opacity: 1;
    transform: scale(1);
}

.agri-header {
    background: linear-gradient(135deg, #0f766e, #115e59);
    color: white;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.agri-avatar {
    font-size: 24px;
}

.agri-status {
    font-size: 12px;
    opacity: 0.9;
    display: block;
}

.agri-minimize {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.agri-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agri-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.agri-message.agri-bot {
    justify-content: flex-start;
}

.agri-message.agri-user {
    justify-content: flex-end;
}

.agri-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.agri-bot .agri-bubble {
    background: white;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.agri-user .agri-bubble {
    background: var(--agri-color);
    color: white;
}

.agri-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    width: fit-content;
}

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

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.agri-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

#agri-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

#agri-input:focus {
    border-color: var(--agri-color);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.1);
}

#agri-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--agri-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

#agri-send:hover {
    opacity: 0.9;
}

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

/* Mobile */
@media (max-width: 768px) {
    .agri-window {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .agri-header {
        border-radius: 0;
    }
}
