/* --- Smart IoT AI Agent Styles --- */

#ai-agent-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #008cba; /* A typical IoT blue */
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#ai-agent-fab:hover {
    background-color: #005f7a;
    transform: scale(1.05);
}

#ai-agent-fab:disabled {
    cursor: not-allowed;
    background-color: #777;
}

/* State-specific styles */
#ai-agent-fab[data-state="listening"] {
    background-color: #d32f2f; /* Red when listening */
    animation: pulse 1.5s infinite;
}

#ai-agent-fab[data-state="thinking"] {
    background-color: #ffa000; /* Orange when thinking */
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(211, 47, 47, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Chat Window Styles */
.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 350px;
    height: 500px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-chat-window.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 15px 15px 0 0;
}

.ai-chat-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.ai-chat-title {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    flex: 1;
}

.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.ai-chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.ai-conversation-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-chat-status {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    z-index: 10;
    animation: slideIn 0.3s ease;
    white-space: nowrap;
}

.ai-chat-status.hidden {
    display: none;
}

.ai-chat-status.listening {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    animation: pulse 1.5s infinite;
}

.ai-chat-status.thinking {
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
    color: white;
}

.ai-chat-status.error {
    background: linear-gradient(135deg, #ef5350 0%, #f44336 100%);
    color: white;
}

.ai-chat-status.idle {
    background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
    color: white;
}

.ai-message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: slideIn 0.3s ease;
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    color: #333;
    margin-left: auto;
}

.bot-message {
    align-self: flex-start;
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    color: #333;
    margin-right: auto;
}

.message-content {
    font-size: 14px;
    line-height: 1.4;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-input-area {
    padding: 15px 20px;
    background: white;
    border-radius: 0 0 15px 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #e0e0e0;
    position: relative;
}

.ai-text-input {
    flex: 1;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

.ai-text-input:focus {
    border-color: #667eea;
}

.ai-mic-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.3s;
}

.ai-mic-button:hover {
    transform: scale(1.05);
}

.ai-mic-button:active {
    transform: scale(0.95);
}

.ai-mic-button.listening {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse 1.5s infinite;
}

.ai-mic-button.error {
    background: linear-gradient(135deg, #ef5350 0%, #f44336 100%);
}

.ai-mic-button svg {
    transition: all 0.2s ease;
}

/* Responsive design */
@media (max-width: 480px) {
    .ai-chat-window {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 90px;
    }
    
    #ai-agent-fab {
        right: 15px;
        bottom: 15px;
    }
}

