/* =========================================
   Chat Widget Styles
   ========================================= */

.chat-widget-container {
    position: fixed;
    top: 100px;
    left: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    pointer-events: auto;
}

/* Floating Trigger Button */
.chat-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.chat-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
}

.chat-trigger.active {
    transform: rotate(90deg);
    background: #fff;
    color: #000;
}

.notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: #ff3b30;
    border-radius: 50%;
    border: 2px solid #000;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* Chat Window */
.chat-window {
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background: rgba(10, 15, 20, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transform-origin: top left;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 80px;
    left: 0;
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 240, 255, 0.05);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    color: var(--primary-color);
    font-weight: 600;
}

.close-chat-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.close-chat-btn:hover {
    color: #fff;
}

/* Chat Body */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Messages */
.message {
    display: flex;
    gap: 15px;
    max-width: 85%;
    animation: message-fade-in 0.3s ease;
}

@keyframes message-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: rgba(0, 240, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.user-message .message-avatar {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.message-content {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    color: var(--text-body);
    line-height: 1.5;
    font-size: 0.95rem;
}

.user-message .message-content {
    background: var(--primary-color);
    color: #000;
    border-radius: 12px;
    border-top-right-radius: 2px;
}

/* Suggestions */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.suggestion-btn {
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggestion-btn:hover {
    background: rgba(0, 240, 255, 0.15);
    transform: translateY(-1px);
}

/* Chat Footer */
.chat-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

#chat-input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    padding: 8px 16px;
    outline: none;
    font-size: 0.95rem;
}

#send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: var(--spacing-lg);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    border-top: 1px solid var(--surface-border);
    padding-top: var(--spacing-lg);
}