/* 
 * UWO Premium AI Chatbot - Glassmorphism Edition
 * Color Palette: Dark Blue, Gold, Slate
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;600;700&display=swap');

:root {
    --uwo-blue: #0a0f1e;
    --uwo-blue-vivid: #0c1226;
    --uwo-blue-glass: rgba(10, 15, 30, 0.98);
    --uwo-blue-light: #161e31;
    --uwo-gold: #D6A559;
    --uwo-gold-light: #FABE56;
    --uwo-gold-gradient: linear-gradient(135deg, #D6A559, #FABE56);
    --uwo-white: #0f172a;
    --uwo-text-dim: #475569;
    --uwo-border-glass: rgba(214, 165, 89, 0.5);
    --uwo-shadow-premium: 0 40px 100px -20px rgba(0, 0, 0, 0.5), 0 0 50px rgba(214, 165, 89, 0.15);
    --uwo-radius: 32px;
}

/* --- Blur Overlay --- */
.chatbot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.chatbot-overlay.active {
    opacity: 1;
    visibility: visible;
}

sup {
    font-size: 0.65em;
    vertical-align: super;
    margin-left: 1px;
}

#uwo-chatbot-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    font-family: 'Outfit', 'Inter', sans-serif;
}

#uwo-chatbot-widget * {
    box-sizing: border-box;
}

/* --- Floating Button --- */
.chatbot-toggle-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--uwo-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(214, 165, 89, 0.25);
    border: 1.5px solid var(--uwo-gold);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 10;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 35px rgba(214, 165, 89, 0.45);
    border-color: var(--uwo-gold-light);
}

.chatbot-toggle-btn i {
    font-size: 32px;
    color: var(--uwo-gold);
    filter: drop-shadow(0 0 8px rgba(214, 165, 89, 0.6));
    animation: robot-breathe 3s ease-in-out infinite;
}

@keyframes robot-breathe {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(214, 165, 89, 0.6));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 15px rgba(214, 165, 89, 0.9));
    }
}

/* --- Premium Chat Panel --- */
.chatbot-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 92vw;
    height: 90vh;
    max-width: 1200px;
    max-height: 850px;
    background: var(--uwo-blue-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: var(--uwo-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--uwo-shadow-premium);
    transform: translate(-50%, -45%) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    border: 1px solid var(--uwo-border-glass);
    z-index: 100000;
}

.chatbot-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    display: flex !important;
}

/* --- Header --- */
.chatbot-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bot-avatar {
    width: 65px;
    height: 65px;
    background: #ffffff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

.bot-avatar i {
    color: var(--uwo-blue);
    font-size: 30px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.2));
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.header-info h3 {
    color: #fff !important;
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.header-info p {
    color: var(--uwo-gold) !important;
    margin: 2px 0 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.chatbot-close-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

/* --- Chat Area --- */
.chat-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-area::-webkit-scrollbar {
    width: 4px;
}

.chat-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* --- Message Bubbles --- */
.message-wrapper {
    display: flex;
    width: 100%;
    margin-bottom: 5px;
}

.bot-wrapper {
    justify-content: flex-start;
}

.user-wrapper {
    justify-content: flex-end;
}

.message {
    max-width: 82%;
    padding: 6px 12px 18px 12px;
    font-size: 15px;
    line-height: 1.3;
    position: relative;
    font-family: 'Inter', sans-serif;
    white-space: pre-wrap;
    height: fit-content;
    display: flex;
    flex-direction: column;
}

.message-content {
    margin: 0;
}

.bot-message {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0 !important;
    border-radius: 20px 20px 20px 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bot-message strong {
    color: var(--uwo-gold);
    font-weight: 700;
}

.user-message {
    background: var(--uwo-gold-gradient);
    color: var(--uwo-blue) !important;
    font-weight: 600;
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 10px 20px rgba(214, 165, 89, 0.15);
}

.message-time {
    position: absolute;
    bottom: 4px;
    right: 10px;
    font-size: 9px;
    opacity: 0.5;
}

.gold-head {
    color: var(--uwo-gold);
    font-weight: 800;
}

/* --- Registration --- */
.reg-card {
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    margin-top: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
    border: 1px solid var(--uwo-gold);
}

.reg-card h4 {
    color: var(--uwo-blue) !important;
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 15px 0;
}

.reg-card input {
    width: 100% !important;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    color: var(--uwo-blue) !important;
    outline: none !important;
}

.reg-submit-btn {
    width: 100%;
    background: var(--uwo-blue) !important;
    color: #fff !important;
    padding: 14px !important;
    border-radius: 12px !important;
    border: none !important;
    font-weight: 800 !important;
    cursor: pointer;
}

/* --- Typing --- */
.typing {
    display: flex;
    flex-direction: row !important;
    gap: 5px;
    padding: 15px 22px;
    width: fit-content;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--uwo-gold);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
    opacity: 0.6;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* --- Input Area --- */
.chatbot-input-area {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    /* Added for waveform */
    gap: 12px;
    align-items: center;
}

.chatbot-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 16px 24px !important;
    color: #fff !important;
    font-size: 16px !important;
    outline: none !important;
}

.chatbot-input-area input:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--uwo-gold-light) !important;
}

.chatbot-send-btn {
    width: 50px;
    height: 50px;
    background: var(--uwo-gold-gradient) !important;
    color: var(--uwo-blue) !important;
    border-radius: 14px !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s;
}

.chatbot-mic-btn {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--uwo-gold) !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.chatbot-mic-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--uwo-gold);
}

.chatbot-mic-btn.active {
    background: var(--uwo-gold-gradient) !important;
    color: var(--uwo-blue) !important;
    animation: mic-pulse 1.5s infinite;
}

@keyframes mic-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(214, 165, 89, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(214, 165, 89, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(214, 165, 89, 0);
    }
}

.suggestion-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--uwo-gold);
    color: var(--uwo-gold) !important;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: fit-content;
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: var(--uwo-gold-gradient);
    color: var(--uwo-blue) !important;
    transform: translateY(-2px);
}

.powered-by {
    padding: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.3) !important;
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 700;
    text-transform: uppercase;
}

/* --- Waveform Animation --- */
.waveform-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 15px;
    margin-bottom: 5px;
    opacity: 0.8;
    width: 100%;
    /* Force it to take the top row */
}

.waveform-bar {
    width: 3px;
    height: 100%;
    background: var(--uwo-gold);
    border-radius: 3px;
    animation: waveform-pulse 1s infinite ease-in-out;
}

.waveform-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.waveform-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.waveform-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.waveform-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes waveform-pulse {

    0%,
    100% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(1.2);
    }
}

/* --- Mobile Responsiveness (Centered Overlay Panel) --- */
@media (max-width: 580px) {
    .chatbot-panel {
        width: 95vw !important;
        height: 92vh !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 24px;
    }

    .chatbot-header {
        padding: 15px 20px;
        gap: 12px;
    }

    .bot-avatar {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        background: #fff;
        /* White background for better logo contrast on mobile */
        padding: 5px;
    }

    .header-info h3 {
        font-size: 18px !important;
        line-height: 1.2;
    }

    .header-info p {
        font-size: 10px !important;
    }

    .chat-area {
        padding: 15px;
        gap: 15px;
    }

    .message {
        font-size: 14px !important;
        padding: 12px 18px;
        max-width: 90%;
    }

    .chatbot-input-area {
        padding: 12px 15px;
    }

    .chatbot-input-area input {
        padding: 12px 18px !important;
        font-size: 14px !important;
    }

    .chatbot-send-btn {
        width: 44px;
        height: 44px;
    }

    .suggestion-chip {
        font-size: 12px;
        padding: 8px 14px;
    }
}