/* 🤖 AI Chatbot Styles for Hayagreeva Tech Solutions */
/* Modern, responsive, and accessible chatbot interface with Hayagreeva blue gradient branding */

:root {
    /* Hayagreeva Blue Gradient Brand Colors - Matching Logo */
    --chatbot-primary: #0066cc;
    --chatbot-secondary: #004499;
    --chatbot-accent: #3399ff;
    --chatbot-light: #66b3ff;
    --chatbot-gradient: linear-gradient(135deg, #0066cc 0%, #3399ff 25%, #66b3ff 50%, #004499 75%, #0066cc 100%);
    --chatbot-gradient-alt: linear-gradient(45deg, #004499 0%, #0066cc 50%, #3399ff 100%);
    --chatbot-success: #10ac84;
    --chatbot-warning: #ff9f43;
    --chatbot-error: #ff3838;
    --chatbot-bg: #ffffff;
    --chatbot-bg-secondary: #f0f8ff;
    --chatbot-text: #2c2c2c;
    --chatbot-text-light: #666666;
    --chatbot-border: #e6f3ff;
    --chatbot-shadow: 0 4px 20px rgba(0, 102, 204, 0.15);
    --chatbot-shadow-lg: 0 8px 40px rgba(0, 102, 204, 0.25);
    --chatbot-shadow-xl: 0 12px 60px rgba(0, 102, 204, 0.35);
    --chatbot-radius: 16px;
    --chatbot-radius-lg: 20px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --chatbot-bg: #1a1a1a;
        --chatbot-bg-secondary: #2d2d2d;
        --chatbot-text: #ffffff;
        --chatbot-text-light: #cccccc;
        --chatbot-border: #404040;
        --chatbot-shadow: 0 4px 20px rgba(0, 102, 204, 0.3);
        --chatbot-shadow-lg: 0 8px 40px rgba(0, 102, 204, 0.4);
    }
}

/* Chatbot Trigger Button */
.chatbot-trigger {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 70px;
    height: 70px;
    background: var(--chatbot-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow-xl);
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    outline: none;
    backdrop-filter: blur(10px);
}

.chatbot-trigger:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 50px rgba(0, 102, 204, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.chatbot-trigger:active {
    transform: translateY(-1px) scale(1.02);
}

.chatbot-icon {
    font-size: 28px;
    transition: transform 0.3s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Logo integration - Fixed to properly show logo */
.chatbot-icon img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: contain;
    background: white;
    padding: 3px;
}

.chatbot-trigger:hover .chatbot-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Enhanced Pulse animation */
.chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--chatbot-gradient);
    opacity: 0.6;
    animation: chatbot-pulse 2.5s ease-in-out infinite;
}

@keyframes chatbot-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 0.2; }
    100% { transform: scale(1.6); opacity: 0; }
}

.pulse-animation .chatbot-pulse {
    animation: chatbot-pulse 1.2s ease-in-out infinite;
}

/* Enhanced Tooltip */
.chatbot-tooltip {
    position: absolute;
    bottom: 120%;
    right: 0;
    background: linear-gradient(135deg, var(--chatbot-text) 0%, #444 100%);
    color: white;
    padding: 12px 16px;
    border-radius: var(--chatbot-radius);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--chatbot-shadow);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 25px;
    border: 8px solid transparent;
    border-top-color: var(--chatbot-text);
}

.chatbot-trigger:hover .chatbot-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-8px);
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 400px;
    height: 650px;
    max-height: calc(100vh - 50px);
    background: var(--chatbot-bg);
    border-radius: var(--chatbot-radius-lg);
    box-shadow: var(--chatbot-shadow-xl);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    border: 2px solid rgba(0, 102, 204, 0.1);
    animation: chatbot-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

@keyframes chatbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 40px);
        bottom: 10px;
        right: 10px;
        border-radius: var(--chatbot-radius);
    }
    
    .chatbot-trigger {
        bottom: 20px;
        right: 20px;
        width: 65px;
        height: 65px;
    }
}

/* Enhanced Header */
.chatbot-header {
    background: var(--chatbot-gradient);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--chatbot-radius-lg) var(--chatbot-radius-lg) 0 0;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="headerPattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23headerPattern)"/></svg>') repeat;
    animation: headerFlow 20s linear infinite;
}

@keyframes headerFlow {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-20px) translateY(-20px); }
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.chatbot-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-avatar img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 50%;
    background: white;
    padding: 2px;
}

.chatbot-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--chatbot-success);
    border: 3px solid white;
    border-radius: 50%;
    animation: online-pulse 2.5s ease-in-out infinite;
}

@keyframes online-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.chatbot-title h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chatbot-subtitle {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
}

.chatbot-header-actions {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.chatbot-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.chatbot-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: var(--chatbot-bg-secondary);
    scroll-behavior: smooth;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(0, 102, 204, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(51, 153, 255, 0.05) 0%, transparent 50%);
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 102, 204, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 102, 204, 0.5);
}

.chatbot-message {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
    animation: message-appear 0.4s ease-out forwards;
}

@keyframes message-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    display: flex;
    justify-content: flex-end;
}

.ai-message {
    display: flex;
    justify-content: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 16px 20px;
    border-radius: var(--chatbot-radius);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.user-message .message-content {
    background: var(--chatbot-gradient);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.ai-message .message-content {
    background: var(--chatbot-bg);
    color: var(--chatbot-text);
    border: 2px solid var(--chatbot-border);
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.message-time {
    font-size: 11px;
    color: var(--chatbot-text-light);
    margin-top: 6px;
    text-align: right;
}

.ai-message .message-time {
    text-align: left;
}

/* Message formatting */
.message-content strong {
    font-weight: 700;
    color: var(--chatbot-primary);
}

.ai-message .message-content strong {
    color: var(--chatbot-primary);
}

.message-content a {
    color: var(--chatbot-accent);
    text-decoration: none;
    font-weight: 600;
}

.message-content a:hover {
    text-decoration: underline;
}

/* Enhanced Quick Actions */
.chatbot-quick-actions {
    padding: 20px 24px 12px;
    background: var(--chatbot-bg);
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-action-btn {
    background: linear-gradient(135deg, var(--chatbot-bg-secondary) 0%, #fff 100%);
    border: 2px solid var(--chatbot-border);
    color: var(--chatbot-text);
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--chatbot-gradient);
    transition: left 0.3s ease;
    z-index: 0;
}

.quick-action-btn span {
    position: relative;
    z-index: 1;
}

.quick-action-btn:hover {
    color: white;
    border-color: var(--chatbot-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
}

.quick-action-btn:hover::before {
    left: 0;
}

/* Enhanced Typing Indicator */
.chatbot-typing-indicator {
    padding: 20px 24px;
    background: var(--chatbot-bg);
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: var(--chatbot-text-light);
}

.typing-dots {
    display: flex;
    gap: 6px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--chatbot-primary);
    border-radius: 50%;
    animation: typing-bounce 1.6s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-12px);
        opacity: 1;
    }
}

/* Enhanced Input Area */
.chatbot-input-area {
    background: var(--chatbot-bg);
    border-top: 1px solid var(--chatbot-border);
}

.chatbot-input-container {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    border: 2px solid var(--chatbot-border);
    border-radius: var(--chatbot-radius);
    padding: 14px 18px;
    font-size: 14px;
    background: var(--chatbot-bg-secondary);
    color: var(--chatbot-text);
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    min-height: 20px;
    max-height: 100px;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
    background: var(--chatbot-bg);
}

.chatbot-input::placeholder {
    color: var(--chatbot-text-light);
}

.chatbot-send-btn {
    width: 48px;
    height: 48px;
    background: var(--chatbot-gradient);
    border: none;
    border-radius: var(--chatbot-radius);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.chatbot-send-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 102, 204, 0.4);
}

.chatbot-send-btn:active {
    transform: translateY(0) scale(1.02);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Enhanced Footer */
.chatbot-footer {
    background: var(--chatbot-bg);
    border-top: 1px solid var(--chatbot-border);
    padding: 16px 24px;
    border-radius: 0 0 var(--chatbot-radius-lg) var(--chatbot-radius-lg);
}

.chatbot-branding {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--chatbot-text-light);
    font-weight: 500;
}

.chatbot-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rating-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.rating-btn:hover {
    opacity: 1;
    transform: scale(1.2);
    background: rgba(0, 102, 204, 0.1);
}

/* Accessibility improvements */
.chatbot-container:focus-within {
    outline: 3px solid var(--chatbot-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .chatbot-trigger,
    .chatbot-container,
    .chatbot-message,
    .quick-action-btn,
    .chatbot-send-btn {
        animation: none;
        transition: none;
    }
    
    .chatbot-pulse {
        animation: none;
    }
    
    .typing-dots span {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --chatbot-border: #000000;
        --chatbot-text-light: #000000;
    }
    
    .chatbot-input {
        border-width: 3px;
    }
    
    .chatbot-action-btn,
    .quick-action-btn {
        border-width: 3px;
    }
}

/* Focus indicators for keyboard navigation */
.chatbot-trigger:focus,
.chatbot-action-btn:focus,
.quick-action-btn:focus,
.chatbot-send-btn:focus,
.rating-btn:focus {
    outline: 3px solid var(--chatbot-accent);
    outline-offset: 2px;
}

/* Loading states */
.chatbot-loading {
    opacity: 0.7;
    pointer-events: none;
}

.chatbot-error {
    border: 2px solid var(--chatbot-error);
    background: rgba(255, 56, 56, 0.1);
}

/* Success states */
.chatbot-success {
    border: 2px solid var(--chatbot-success);
    background: rgba(16, 172, 132, 0.1);
}

/* Ensure proper z-index stacking */
.chatbot-container,
.chatbot-trigger {
    z-index: 9999;
}

/* Print styles */
@media print {
    .chatbot-container,
    .chatbot-trigger {
        display: none !important;
    }
}

/* Special styling for Hayagreeva service mentions */
.hayagreeva-service-mention {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.1), rgba(51, 153, 255, 0.1));
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid rgba(0, 102, 204, 0.2);
}

/* Enhanced visual feedback */
.chatbot-input:valid {
    border-color: var(--chatbot-success);
}

.chatbot-input:invalid {
    border-color: var(--chatbot-error);
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, 
                transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

/* Additional enhancements for Hayagreeva branding */
.chatbot-brand-accent {
    background: var(--chatbot-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.chatbot-glow-effect {
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.3);
} 