/* ========== AI CHATBOT STYLES ========== */
.ai-chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #ff6b00, #ff8533);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(255, 107, 0, 0.4);
    z-index: 9998;
    transition: all 0.3s ease;
}

.ai-chat-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 0, 0.6);
}

.ai-icon {
    font-size: 1.5rem;
}

.ai-text {
    font-weight: 600;
}

/* Chatbot Container */
.ai-chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
}

.night-mode .ai-chat-container {
    background: #1a1a2e;
    border: 1px solid #2d4059;
}

.ai-chat-container.hidden {
    display: none;
}

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

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, #0a2a5a, #1a3a8a);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.night-mode .ai-chat-header {
    background: linear-gradient(135deg, #0f3460, #2d4059);
}

.ai-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ai-avatar {
    font-size: 2rem;
    background: white;
    color: #0a2a5a;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-header-text h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.ai-status {
    margin: 5px 0 0 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.night-mode .ai-chat-messages {
    background: #16213e;
}

.ai-welcome-message {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
}

.night-mode .ai-welcome-message {
    background: #0f3460;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.ai-welcome-message p {
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.5;
}

.night-mode .ai-welcome-message p {
    color: #e6e6e6;
}

.ai-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.ai-quick-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.night-mode .ai-quick-btn {
    background: #2d4059;
    color: #e6e6e6;
}

.ai-quick-btn:hover {
    background: #0a2a5a;
    color: white;
    transform: translateY(-2px);
}

.night-mode .ai-quick-btn:hover {
    background: #4cc9f0;
    color: #1a1a2e;
}

/* Messages */
.ai-message {
    margin-bottom: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

.user-message {
    margin-left: auto;
}

.ai-message .message-content {
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.user-message .message-content {
    background: linear-gradient(135deg, #0a2a5a, #1a3a8a);
    color: white;
    border-bottom-right-radius: 5px;
}

.night-mode .user-message .message-content {
    background: linear-gradient(135deg, #4cc9f0, #2d9cdb);
}

.ai-message .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.night-mode .ai-message .message-content {
    background: #2d4059;
    color: #e6e6e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.message-text {
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

/* Thinking Indicator */
.ai-thinking {
    padding: 10px 16px;
    background: white;
    border-radius: 18px;
    margin-bottom: 15px;
    max-width: 80%;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.night-mode .ai-thinking {
    background: #2d4059;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.thinking-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thinking-dots {
    display: flex;
    gap: 4px;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0a2a5a;
    animation: bounce 1.4s infinite ease-in-out both;
}

.night-mode .thinking-dots span {
    background: #4cc9f0;
}

.thinking-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.thinking-text {
    font-size: 0.9rem;
    color: #666;
}

.night-mode .thinking-text {
    color: #b8b8b8;
}

/* Chat Input Area */
.ai-chat-input-area {
    border-top: 1px solid #eee;
    padding: 20px;
    background: white;
}

.night-mode .ai-chat-input-area {
    background: #1a1a2e;
    border-color: #2d4059;
}

.ai-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.3s ease;
}

.night-mode .ai-chat-input {
    background: #2d4059;
    border-color: #3a506b;
    color: #e6e6e6;
}

.ai-chat-input:focus {
    border-color: #0a2a5a;
}

.night-mode .ai-chat-input:focus {
    border-color: #4cc9f0;
}

.ai-send-btn {
    background: linear-gradient(135deg, #ff6b00, #ff8533);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0 25px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.ai-send-btn:hover {
    background: linear-gradient(135deg, #ff8533, #ff6b00);
    transform: translateY(-2px);
}

.send-icon {
    font-size: 1.2rem;
}

.ai-disclaimer {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    line-height: 1.4;
}

.night-mode .ai-disclaimer {
    color: #aaa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-chat-toggle {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .ai-chat-container {
        bottom: 80px;
        right: 20px;
        left: 20px;
        width: auto;
        height: 500px;
    }
    
    .ai-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .ai-header-text h3 {
        font-size: 1rem;
    }
    
    .ai-message {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .ai-chat-toggle .ai-text {
        display: none;
    }
    
    .ai-chat-toggle {
        padding: 15px;
        width: 60px;
        height: 60px;
        justify-content: center;
    }
    
    .ai-icon {
        font-size: 1.8rem;
        margin: 0;
    }
    
    .ai-chat-container {
        bottom: 90px;
        right: 10px;
        left: 10px;
        height: 450px;
    }
}
