/**
 * Oriana Academy AI Chatbot Styles
 */

/* Chatbot Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 8px 24px rgba(139, 92, 246, 0.4),
        0 0 0 4px rgba(139, 92, 246, 0.2),
        0 0 40px rgba(139, 92, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100000;
    padding: 4px;
    overflow: hidden;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.chat-toggle:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow:
        0 12px 32px rgba(139, 92, 246, 0.5),
        0 0 0 6px rgba(139, 92, 246, 0.3),
        0 0 60px rgba(139, 92, 246, 0.5);
}

.chat-toggle.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chat-toggle-image {
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    object-fit: cover;
    border-radius: 50%;
    background: white;
    padding: 2px;
}

.chat-toggle svg {
    width: 32px;
    height: 32px;
    color: var(--gt-primary);
}

.chat-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ff4444, #ff6b6b);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.4);
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.1);
    }
}

/* Chatbot Window */
.chat-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 420px;
    height: 650px;
    max-height: calc(100vh - 48px);
    background: linear-gradient(to bottom, #f5f3ff, #faf9ff);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100001;
    overflow: hidden;
    border: 4px solid transparent;
    background-image:
        linear-gradient(to bottom, #f5f3ff, #faf9ff),
        linear-gradient(135deg, #8b5cf6, #3b82f6, #10b981, #f59e0b);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #3b82f6 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-avatar svg {
    width: 24px;
    height: 24px;
    color: white;
}

.chat-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

.chat-close svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(to bottom, #f5f3ff, #faf9ff);
}

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

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.chat-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--gt-primary), var(--gt-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar svg {
    width: 18px;
    height: 18px;
    color: white;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--gt-primary), var(--gt-secondary));
    color: #000000;
    border-bottom-right-radius: 4px;
}

.bot-message .message-bubble {
    background: linear-gradient(135deg, #f8f7ff, #ffffff);
    color: var(--gray-800);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

/* Typing Indicator */
.typing-indicator .message-bubble {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.typing-indicator .message-bubble span {
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-indicator .message-bubble span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .message-bubble span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: #faf9ff;
    border-top: 1px solid #e9ecef;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.chat-input:focus {
    border-color: var(--gt-primary);
    background: #f8f9fa;
}

.chat-send {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.chat-send:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

.chat-send svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Suggestion Chips */
.chat-suggestions {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
    background: #faf9ff;
    flex-wrap: wrap;
    border-top: 1px solid #e9ecef;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }

    50% {
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    }
}

.chat-toggle.pulse {
    animation: pulse 2s infinite;
}

/* Streaming Cursor Effect */
.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 15px;
    background-color: #8b5cf6;
    margin-left: 4px;
    vertical-align: middle;
    animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.suggestion-chip {
    padding: 10px 16px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--gray-700);
    white-space: nowrap;
    font-weight: 500;
}

.suggestion-chip:hover {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 32px);
        bottom: 16px;
        right: 16px;
        max-height: calc(100vh - 32px);
    }

    .chat-toggle {
        bottom: 16px;
        right: 16px;
    }

    .message-bubble {
        max-width: 85%;
    }
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }

    50% {
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    }
}

.chat-toggle.pulse {
    animation: pulse 2s infinite;
}