/* ============================================================
   CEVOX AI — Chatbot Stylesheet
   S-TIER Premium AI Assistant Interface
   ============================================================ */

/* ===== FAB (Floating Action Button) ===== */
.cevox-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF4D00, #E63E00);
    border: none;
    cursor: pointer;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 30px rgba(255, 77, 0, 0.4),
        0 0 60px rgba(255, 77, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.cevox-fab::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 77, 0, 0.6) 90deg, transparent 180deg);
    animation: fab-spin 3s linear infinite;
    z-index: -1;
    opacity: 0.5;
}

@keyframes fab-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.cevox-fab:hover {
    transform: scale(1.12);
    box-shadow:
        0 8px 45px rgba(255, 77, 0, 0.55),
        0 0 90px rgba(255, 77, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cevox-fab svg {
    width: 26px;
    height: 26px;
    color: white;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.cevox-fab.active svg.icon-chat {
    display: none;
}

.cevox-fab:not(.active) svg.icon-close {
    display: none;
}

/* Pulse ring */
.cevox-fab-pulse {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid rgba(255, 77, 0, 0.4);
    z-index: 8999;
    pointer-events: none;
    animation: fab-pulse 2.5s ease-out infinite;
}

@keyframes fab-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ===== CHAT WINDOW ===== */
.cevox-chat {
    position: fixed;
    bottom: 6.5rem;
    right: 2rem;
    width: 420px;
    max-height: 620px;
    height: 72vh;
    background: rgba(8, 8, 8, 0.97);
    backdrop-filter: blur(80px) saturate(1.5);
    -webkit-backdrop-filter: blur(80px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1.5rem;
    z-index: 9001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 35px 120px rgba(0, 0, 0, 0.75),
        0 0 1px rgba(255, 255, 255, 0.12),
        0 0 80px rgba(255, 77, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cevox-chat.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Ambient glow inside the chat window */
.cevox-chat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 120px;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 77, 0, 0.06) 0%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* Mobile focused card modal */
@media (max-width: 640px) {
    .cevox-chat {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: calc(100% - 2rem);
        height: 80vh;
        max-height: 80vh;
        border-radius: 1.25rem;
    }

    .cevox-fab {
        bottom: 1.25rem;
        right: 1.25rem;
    }

    .cevox-fab-pulse {
        bottom: 1.25rem;
        right: 1.25rem;
    }
}

/* ===== CHAT HEADER ===== */
.cevox-chat-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 77, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: linear-gradient(180deg, rgba(20, 15, 12, 0.8) 0%, rgba(12, 12, 12, 0.6) 100%);
    flex-shrink: 0;
    position: relative;
}

.cevox-chat-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.3s ease;
    margin-left: auto;
    outline: none;
}

.cevox-chat-close:hover {
    color: #FF4D00;
    transform: scale(1.1);
}

.cevox-chat-close svg {
    width: 20px;
    height: 20px;
}

/* Subtle orange gradient line at bottom of header */
.cevox-chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 77, 0, 0.2), transparent);
}

.cevox-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 77, 0, 0.15), rgba(255, 107, 43, 0.08));
    border: 1px solid rgba(255, 77, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    color: white;
    letter-spacing: -0.04em;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(255, 77, 0, 0.08),
        inset 0 0 10px rgba(255, 77, 0, 0.05);
}

.cevox-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.cevox-chat-avatar::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #0a0a0a;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    animation: status-pulse 3s ease-in-out infinite;
}

@keyframes status-pulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 16px rgba(34, 197, 94, 0.7);
    }
}

.cevox-chat-info h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

.cevox-chat-info span {
    font-size: 0.68rem;
    color: rgba(255, 77, 0, 0.5);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.06em;
}

/* ===== MESSAGES AREA ===== */
.cevox-chat-messages {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(255, 77, 0, 0.02) 0%, transparent 60%);
}

.cevox-chat-messages::-webkit-scrollbar {
    width: 3px;
}

.cevox-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.cevox-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 0, 0.15);
    border-radius: 3px;
}

.cevox-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 77, 0, 0.3);
}

/* ===== MESSAGE BUBBLES ===== */
.chat-msg {
    display: flex;
    gap: 0.625rem;
    animation: msg-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
    max-width: 88%;
}

@keyframes msg-in {
    0% {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 2px;
    overflow: hidden;
}

.chat-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.chat-msg.bot .chat-msg-avatar {
    background: linear-gradient(135deg, rgba(255, 77, 0, 0.15), rgba(255, 77, 0, 0.05));
    color: #FF4D00;
    border: 1px solid rgba(255, 77, 0, 0.18);
    box-shadow: 0 0 12px rgba(255, 77, 0, 0.06);
}

.chat-msg.user .chat-msg-avatar {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-msg-bubble {
    padding: 0.9rem 1.15rem;
    border-radius: 1rem;
    font-size: 0.84rem;
    line-height: 1.65;
    word-break: break-word;
    position: relative;
}

.chat-msg.bot .chat-msg-bubble {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    border-top-left-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.chat-msg.user .chat-msg-bubble {
    background: linear-gradient(135deg, rgba(255, 77, 0, 0.2), rgba(255, 77, 0, 0.08));
    border: 1px solid rgba(255, 77, 0, 0.2);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 25px rgba(255, 77, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chat-msg-bubble strong {
    color: #FF6B2B;
    font-weight: 600;
}

.chat-msg-bubble a {
    color: #FF6B2B;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s, text-shadow 0.2s;
}

.chat-msg-bubble a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 107, 43, 0.3);
}

.chat-msg-time {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.12);
    margin-top: 0.375rem;
    font-family: 'JetBrains Mono', monospace;
    text-align: right;
}

.chat-msg.bot .chat-msg-time {
    text-align: left;
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.1rem;
    animation: msg-in 0.3s ease both;
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: linear-gradient(135deg, #FF4D00, #FF6B2B);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
    box-shadow: 0 0 6px rgba(255, 77, 0, 0.3);
}

.typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typing-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-8px) scale(1.15);
        opacity: 1;
    }
}

.typing-label {
    font-size: 0.68rem;
    color: rgba(255, 77, 0, 0.35);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
}

/* ===== QUICK ACTIONS ===== */
.chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.chat-quick-btn {
    padding: 0.5rem 0.9rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 77, 0, 0.15);
    background: rgba(255, 77, 0, 0.04);
    color: #FF6B2B;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.chat-quick-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 77, 0, 0.08), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.chat-quick-btn:hover::before {
    opacity: 1;
}

.chat-quick-btn:hover {
    background: rgba(255, 77, 0, 0.12);
    border-color: rgba(255, 77, 0, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 0, 0.12);
}

.chat-quick-btn:active {
    transform: translateY(0) scale(0.98);
}

.chat-quick-btn svg {
    width: 12px;
    height: 12px;
}

/* ===== INPUT AREA ===== */
.cevox-chat-input {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 77, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.4) 0%, rgba(15, 15, 15, 0.6) 100%);
    flex-shrink: 0;
    position: relative;
}

/* Subtle gradient border on top */
.cevox-chat-input::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 77, 0, 0.12), transparent);
}

.cevox-chat-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.875rem;
    padding: 0.8rem 1.1rem;
    color: white;
    font-size: 0.84rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.cevox-chat-input input::placeholder {
    color: rgba(255, 255, 255, 0.18);
}

.cevox-chat-input input:focus {
    border-color: rgba(255, 77, 0, 0.35);
    box-shadow:
        0 0 25px rgba(255, 77, 0, 0.08),
        0 0 60px rgba(255, 77, 0, 0.03),
        inset 0 0 12px rgba(255, 77, 0, 0.03);
    background: rgba(255, 255, 255, 0.05);
}

.cevox-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 0.875rem;
    background: linear-gradient(135deg, #FF4D00, #E63E00);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Shine effect on send button */
.cevox-chat-send::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cevox-chat-send:hover::before {
    left: 100%;
}

.cevox-chat-send:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(255, 77, 0, 0.35);
}

.cevox-chat-send:active {
    transform: scale(0.95);
}

.cevox-chat-send:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cevox-chat-send:disabled::before {
    display: none;
}

.cevox-chat-send svg {
    width: 18px;
    height: 18px;
    color: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* ===== CHAT FOOTER ===== */
.cevox-chat-footer {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.1);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.1em;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
    background: rgba(5, 5, 5, 0.3);
}

/* ===== WELCOME STATE ===== */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 1rem;
}

.chat-welcome-icon {
    width: 60px;
    height: 60px;
    border-radius: 1.125rem;
    background: linear-gradient(135deg, rgba(255, 77, 0, 0.14), rgba(255, 77, 0, 0.05));
    border: 1px solid rgba(255, 77, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
    animation: icon-breathe 3s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(255, 77, 0, 0.06);
    overflow: hidden;
}

.chat-welcome-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

@keyframes icon-breathe {

    0%,
    100% {
        box-shadow: 0 0 0px rgba(255, 77, 0, 0), 0 0 30px rgba(255, 77, 0, 0.06);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 77, 0, 0.18), 0 0 60px rgba(255, 77, 0, 0.08);
        transform: scale(1.06);
    }
}

.chat-welcome h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    margin: 0;
}

.chat-welcome p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
    max-width: 300px;
    margin: 0;
}

/* ===== NOTIFICATION BADGE ===== */
.cevox-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: white;
    animation: badge-pop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}