/* NWRIBOT Aqua Blue Theme - Complete CSS By NorthBase */
:root {
    --aqua-primary: #00bcd4;
    --aqua-secondary: #008ba3;
    --aqua-light: #b2ebf2;
    --aqua-dark: #006978;
    --aqua-gradient: linear-gradient(135deg, #00bcd4, #008ba3);
    --aqua-gradient-light: linear-gradient(135deg, #b2ebf2, #80deea);
    --aqua-gradient-dark: linear-gradient(135deg, #006978, #004d63);
    --wave-color: rgba(0, 188, 212, 0.2);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

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

@keyframes bubbleIn {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    70% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Chatbot Section */
.chatbot-section {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

/* Chatbot Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 140px;
    height: 50px;
    background: var(--aqua-gradient);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.4);
    transition: all 0.3s ease;
    z-index: 1001;
    overflow: hidden;
    padding: 0 15px;
}

.chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 188, 212, 0.6);
    animation: pulse 1.5s infinite;
}

.toggle-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.toggle-inner i {
    font-size: 20px;
    animation: float 3s ease-in-out infinite;
}

.toggle-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: wave 3s linear infinite;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4081;
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 188, 212, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    border: 2px solid var(--aqua-light);
    animation: slideInUp 0.3s ease;
}

.chatbot-container.active {
    display: flex;
}

/* Chatbot Header */
.chatbot-header {
    background: var(--aqua-gradient);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 18px 18px 0 0;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.6), 
        transparent
    );
    animation: shimmer 3s infinite;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.chatbot-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.chatbot-info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(15deg);
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 18px;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(180deg, #f8fdff 0%, #e0f7fa 100%);
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 188, 212, 0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--aqua-primary);
    border-radius: 3px;
}

/* Message Styles - Aqua Theme for Both */
.message {
    display: flex;
    margin-bottom: 20px;
    animation: bubbleIn 0.4s ease-out;
}

.bot-message {
    gap: 12px;
}

.user-message {
    flex-direction: row-reverse;
    gap: 12px;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    align-self: flex-start;
    margin-top: 8px;
}

.bot-message .message-avatar {
    background: var(--aqua-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 188, 212, 0.3);
}

.user-message .message-avatar {
    background: var(--aqua-gradient-dark);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 105, 120, 0.3);
}

.message-content {
    max-width: 75%;
    padding: 16px 18px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.08);
}

/* Bot message - Light Aqua theme */
.bot-message .message-content {
    background: linear-gradient(135deg, #ffffff, #f8fdff);
    border: 1px solid var(--aqua-light);
    border-radius: 18px 18px 18px 4px;
    position: relative;
    overflow: hidden;
    color: var(--aqua-dark);
}

/* Top accent border for bot messages */
.bot-message .message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--aqua-gradient);
}

/* User message - Dark Aqua theme */
.user-message .message-content {
    background: var(--aqua-gradient);
    color: white;
    border-radius: 18px 18px 4px 18px;
    position: relative;
    overflow: hidden;
}

/* Top accent border for user messages */
.user-message .message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4), transparent);
}

.message-text p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.message-text p:last-child {
    margin-bottom: 0;
}

/* Quick Suggestions */
.quick-suggestions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--aqua-light);
}

.quick-suggestions p {
    font-size: 12px;
    color: var(--aqua-dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: var(--aqua-gradient-light);
    color: var(--aqua-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--aqua-light);
    font-weight: 500;
}

.chip:hover {
    background: var(--aqua-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 188, 212, 0.3);
}

/* Chat Input Area */
.chat-input-area {
    border-top: 2px solid var(--aqua-light);
    padding: 15px;
    background: white;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    position: relative;
    transition: transform 0.3s;
}

.input-wrapper:focus-within {
    transform: scale(1.02);
}

.input-icon {
    color: var(--aqua-primary);
    font-size: 18px;
    position: absolute;
    left: 15px;
    z-index: 1;
}

#chatInput {
    flex: 1;
    padding: 14px 16px 14px 45px;
    border: 2px solid var(--aqua-light);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    background: #f8fdff;
    position: relative;
}

#chatInput:focus {
    border-color: var(--aqua-primary);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.1);
    background: white;
}

#chatInput::placeholder {
    color: #80deea;
}

.send-btn {
    width: 50px;
    height: 50px;
    background: var(--aqua-gradient);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.4);
}

.send-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: wave 2s linear infinite;
    opacity: 0;
}

.send-btn:hover .send-wave {
    opacity: 1;
}

/* Chat Footer */
.chat-footer {
    text-align: center;
}

.disclaimer {
    font-size: 11px;
    color: var(--aqua-dark);
    margin: 0;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.disclaimer i {
    color: var(--aqua-primary);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    align-items: center;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    background: var(--aqua-gradient);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 188, 212, 0.3);
}

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

@keyframes typing {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Clear Chat Confirmation */
.clear-confirmation {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin: 15px;
    text-align: center;
    animation: slideInUp 0.3s ease;
}

.clear-confirmation p {
    margin: 0 0 15px;
    color: #ff9800;
    font-weight: 600;
}

.clear-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-clear, .cancel-clear {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.confirm-clear {
    background: linear-gradient(135deg, #ff4081, #f50057);
    color: white;
}

.cancel-clear {
    background: var(--aqua-gradient-light);
    color: var(--aqua-dark);
}

.confirm-clear:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(255, 64, 129, 0.3);
}

.cancel-clear:hover {
    transform: scale(1.05);
}

/* Loading Animation */
.loading-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--aqua-primary);
    border-radius: 50%;
    animation: loading 1.4s infinite ease-in-out;
}

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

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

/* Message Timestamp (optional) */
.message-timestamp {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .chatbot-container {
        width: 90vw;
        height: 70vh;
        bottom: 80px;
        right: 5vw;
    }
    
    .chatbot-toggle {
        width: 120px;
        height: 45px;
        font-size: 13px;
        bottom: 15px;
        right: 15px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chatbot-header {
        padding: 12px 15px;
    }
    
    .chatbot-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .chatbot-container {
        width: 95vw;
        height: 65vh;
        bottom: 70px;
        right: 2.5vw;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    
    .toggle-inner span {
        display: none;
    }
    
    .toggle-inner i {
        font-size: 22px;
        margin: 0;
    }
    
    .message-content {
        max-width: 90%;
        padding: 12px 15px;
    }
    
    .input-wrapper {
        gap: 8px;
    }
    
    #chatInput {
        padding: 12px 16px 12px 40px;
    }
    
    .send-btn {
        width: 45px;
        height: 45px;
    }
}

/* Tablet devices */
@media (min-width: 769px) and (max-width: 1024px) {
    .chatbot-container {
        width: 380px;
        height: 550px;
    }
}

/* Chat message hover effects */
.message-content:hover {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

/* Smooth transitions for interactive elements */
.chatbot-action-btn,
.chatbot-close,
.chip,
.send-btn,
.confirm-clear,
.cancel-clear {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
#chatInput:focus,
.send-btn:focus,
.chatbot-action-btn:focus,
.chatbot-close:focus {
    outline: 2px solid var(--aqua-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .chatbot-section {
        display: none;
    }
}