/* ========================================
   FROSTLINE CHATBOT STYLES
   Modern AI Assistant with Glassmorphism
   ======================================== */

:root {
    --chatbot-primary: #0066cc;
    --chatbot-primary-dark: #0052a3;
    --chatbot-secondary: #00b4d8;
    --chatbot-bg: #ffffff;
    --chatbot-surface: #f8f9fa;
    --chatbot-border: #e0e0e0;
    --chatbot-text: #1a1a1a;
    --chatbot-text-light: #666666;
    --chatbot-shadow: rgba(0, 0, 0, 0.1);
    --chatbot-shadow-lg: rgba(0, 0, 0, 0.15);
    --chatbot-user-msg: #0066cc;
    --chatbot-bot-msg: #f0f2f5;
    --chatbot-success: #10b981;
    --chatbot-typing: #94a3b8;
}

/* Chatbot Button - Floating Action Button */
.chatbot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--chatbot-shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-ring 2s infinite;
}

.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 102, 204, 0.4);
}

.chatbot-fab svg {
    width: 32px;
    height: 32px;
    fill: white;
    transition: transform 0.3s ease;
}

.chatbot-fab.active svg {
    transform: rotate(90deg);
}

@keyframes pulse-ring {
    0%, 100% {
        box-shadow: 0 4px 20px var(--chatbot-shadow-lg), 0 0 0 0 rgba(0, 102, 204, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px var(--chatbot-shadow-lg), 0 0 0 10px rgba(0, 102, 204, 0);
    }
}

/* Notification Badge */
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    animation: bounce-in 0.5s ease;
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 600px;
    background: var(--chatbot-bg);
    border-radius: 20px;
    box-shadow: 0 10px 50px var(--chatbot-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transform: scale(0.8) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-container.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbot-header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.chatbot-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chatbot-status-dot {
    width: 8px;
    height: 8px;
    background: var(--chatbot-success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--chatbot-surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-border);
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #c0c0c0;
}

/* Message Bubble */
.chatbot-message {
    display: flex;
    gap: 10px;
    animation: slide-in 0.3s ease;
    max-width: 85%;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chatbot-message.bot .chatbot-message-avatar {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    color: white;
}

.chatbot-message.user .chatbot-message-avatar {
    background: var(--chatbot-user-msg);
    color: white;
}

.chatbot-message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.chatbot-message.user .chatbot-message-content {
    background: var(--chatbot-user-msg);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message.bot .chatbot-message-content {
    background: white;
    color: var(--chatbot-text);
    border-bottom-left-radius: 4px;
}

.chatbot-message-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.chatbot-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--chatbot-typing);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Quick Actions */
.chatbot-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-quick-btn {
    background: white;
    border: 1px solid var(--chatbot-border);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--chatbot-primary);
    font-weight: 500;
}

.chatbot-quick-btn:hover {
    background: var(--chatbot-primary);
    color: white;
    border-color: var(--chatbot-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

/* Input Area */
.chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1px solid var(--chatbot-border);
    padding: 12px 16px;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.chatbot-send-btn {
    background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-secondary) 100%);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.3);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Welcome Screen */
.chatbot-welcome {
    text-align: center;
    padding: 40px 20px;
    animation: fade-in 0.5s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chatbot-welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.chatbot-welcome h4 {
    margin: 0 0 8px 0;
    color: var(--chatbot-text);
    font-size: 20px;
}

.chatbot-welcome p {
    margin: 0 0 24px 0;
    color: var(--chatbot-text-light);
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 32px);
        height: calc(100vh - 140px);
        bottom: 90px;
        right: 16px;
        left: 16px;
        margin: 0 auto;
    }
    
    .chatbot-fab {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .chatbot-fab svg {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
    }
    
    .chatbot-header {
        border-radius: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --chatbot-bg: #1a1a1a;
        --chatbot-surface: #242424;
        --chatbot-border: #333333;
        --chatbot-text: #ffffff;
        --chatbot-text-light: #a0a0a0;
        --chatbot-bot-msg: #2a2a2a;
    }
    
    .chatbot-message.bot .chatbot-message-content {
        background: var(--chatbot-bot-msg);
        color: var(--chatbot-text);
    }
    
    .chatbot-input {
        background: var(--chatbot-surface);
        color: var(--chatbot-text);
    }
    
    .chatbot-quick-btn {
        background: var(--chatbot-surface);
        color: var(--chatbot-text);
    }
}
