/* Sultify AI Chat Widget - Deep Tech Theme V2 */
:root {
    --chat-primary: #00f2fe;
    /* Cyan Neon */
    --chat-secondary: #4facfe;
    /* Blue Neon */
    --chat-accent: #ff0055;
    /* Error/Accent */
    --chat-bg: rgba(5, 10, 20, 0.85);
    /* More transparent for glass */
    --chat-border: rgba(0, 242, 254, 0.3);
    --chat-text: #e0e0e0;
    --chat-user-bg: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
    --chat-bot-bg: rgba(255, 255, 255, 0.03);
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Floating Action Button (FAB) */
.chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--chat-primary);
    box-shadow: 0 0 15px var(--chat-primary), inset 0 0 10px var(--chat-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

.chat-fab:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 0 30px var(--chat-primary), inset 0 0 20px var(--chat-primary);
}

.chat-fab i {
    font-size: 24px;
    color: var(--chat-primary);
    text-shadow: 0 0 5px var(--chat-primary);
}

/* Chat Window - Holographic Card */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    /* Slightly wider */
    height: 600px;
    /* Taller */
    max-height: 80vh;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: 16px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 242, 254, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.chat-window::before {
    /* Scanline Overlay */
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.3;
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chat-header {
    padding: 15px 20px;
    background: rgba(0, 242, 254, 0.05);
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 3;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--chat-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-avatar::after {
    /* Pulse Ring */
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 1px solid var(--chat-primary);
    animation: ripple 2s infinite;
    opacity: 0;
}

.chat-avatar i {
    font-size: 16px;
    color: var(--chat-primary);
}

.chat-info h4 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.chat-info span {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--chat-primary);
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--chat-primary);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--chat-primary);
    animation: blink 2s infinite;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    z-index: 3;
    scrollbar-width: thin;
    scrollbar-color: var(--chat-primary) transparent;
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--chat-primary);
    border-radius: 20px;
}

.message {
    font-family: var(--font-body);
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    animation: message-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    word-wrap: break-word;
}

.message strong {
    color: var(--chat-primary);
    font-weight: 600;
}

.message ul {
    margin: 5px 0 5px 20px;
    padding: 0;
}

.message code {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 5px;
    border-radius: 4px;
    color: #ff0055;
    font-family: monospace;
}

.message.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--chat-text);
    border-bottom-left-radius: 2px;
    border-left: 2px solid var(--chat-primary);
}

.message.user {
    align-self: flex-end;
    background: var(--chat-user-bg);
    color: #fff;
    border-bottom-right-radius: 2px;
    border-right: 2px solid var(--chat-secondary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    align-self: flex-start;
    width: fit-content;
    border-left: 2px solid var(--chat-primary);
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--chat-primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 5px var(--chat-primary);
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

/* Input Area */
.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 3;
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: var(--chat-primary);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

.chat-send {
    width: 45px;
    height: 45px;
    background: transparent;
    border: 1px solid var(--chat-primary);
    border-radius: 8px;
    color: var(--chat-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send:hover {
    background: var(--chat-primary);
    color: #000;
    box-shadow: 0 0 15px var(--chat-primary);
}

/* Close Button */
.chat-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s;
}

.chat-close:hover {
    color: var(--chat-accent);
    text-shadow: 0 0 5px var(--chat-accent);
}

/* Animations */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 15px var(--chat-primary), inset 0 0 10px var(--chat-primary);
    }

    50% {
        box-shadow: 0 0 25px var(--chat-primary), inset 0 0 15px var(--chat-primary);
    }
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .chat-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
}