/* AI Coach Widget Styles - Modern Futuristic */

#ai-coach-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: 'Outfit', sans-serif;
}

.ai-fab {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.ai-fab:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.8), inset 0 0 15px rgba(255, 255, 255, 0.6);
}

.ai-fab i {
    color: #0f172a;
    width: 32px;
    height: 32px;
    animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.ai-chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 500px;
    max-height: 80vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 242, 254, 0.1);
    transform-origin: bottom right;
    transition: all 0.3s ease;
}

.ai-chat-window.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.slide-up {
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-header {
    background: linear-gradient(90deg, rgba(0, 242, 254, 0.1), rgba(79, 172, 254, 0.1));
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    text-shadow: 0 0 20px rgba(0, 242, 254, 0.5);
}

.chat-header i {
    color: #00f2fe;
    filter: drop-shadow(0 0 5px rgba(0, 242, 254, 0.8));
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chat-msg {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chat-msg.bot {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #e2e8f0;
}

.chat-msg.bot::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 10px;
    width: 10px;
    height: 10px;
    background: rgba(30, 41, 59, 0.8);
    transform: rotate(45deg);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-msg.user {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
}

.chat-input-area input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 12px;
    color: white;
    outline: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.chat-input-area input:focus {
    border-color: #00f2fe;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
    background: rgba(0, 0, 0, 0.5);
}

.chat-input-area button {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0f172a;
    transition: all 0.2s;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.chat-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.6);
}

.typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #00f2fe;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    margin: 0 2px;
}

.typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@media (max-width: 480px) {
    .ai-chat-window {
        width: 90vw;
        height: 70vh;
        bottom: 100px;
        right: 10px;
        left: 10px;
    }
}

/* Typing Animation (Ensure these are present) */
.chat-message.typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    width: fit-content;
    border-radius: 12px;
    border-top-left-radius: 0;
    min-height: 44px;
}

/* Voice & Controls */
.chat-controls {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.chat-control-btn:hover,
.chat-control-btn.active {
    background: var(--primary);
    color: #000;
}

.chat-control-btn.listening {
    animation: pulse-mic 1.5s infinite;
    background: #ef4444;
    /* Red */
    color: white;
}

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

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.chat-message.typing span {
    display: block;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.chat-message.typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-message.typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {

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

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

/* Light Mode Support */
[data-theme="light"] .ai-chat-window {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(8, 145, 178, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1), 0 0 30px rgba(8, 145, 178, 0.1);
}

[data-theme="light"] .chat-header {
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.1), rgba(124, 58, 237, 0.1));
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .chat-msg.bot {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .chat-msg.bot::before {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .chat-input-area {
    background: rgba(255, 255, 255, 0.7);
    border-top-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .chat-input-area input {
    background: rgba(255, 255, 255, 0.8);
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
}