/* ==================== CHAT WIDGET STYLES ==================== */

.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    height: 600px;
    background: linear-gradient(135deg, #0f172a 0%, rgba(255,255,255,0.04) 100%);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(6, 182, 212, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 999;
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chat-widget.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

.chat-header {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    color: #ffffff;
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-icon {
    font-size: 1.3rem;
}

.chat-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close:hover {
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user-message {
    align-items: flex-end;
}

.chat-message.bot-message {
    align-items: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message-content p {
    margin: 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.user-message .message-content {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    color: #ffffff;
    border-radius: 12px 4px 8px 12px;
}

.bot-message .message-content {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px 12px 12px 4px;
}

.message-time {
    font-size: 0.75rem;
    color: #64748b;
    padding: 0 0.25rem;
}

.chat-input-area {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1rem 1.25rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 0 0 12px 12px;
}

#chatForm {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

.chat-input::placeholder {
    color: #64748b;
}

.chat-input:focus {
    outline: none;
    border-color: #06b6d4;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.chat-send {
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    font-size: 0.85rem;
}

.chat-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3);
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-footer {
    text-align: center;
    font-size: 0.7rem;
    color: #64748b;
}

/* Toggle Button (when chat is hidden) */
.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-direction: column;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.3);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 998;
    animation: bounce 2s infinite;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(6, 182, 212, 0.4);
    animation: none;
}

.chat-bubble {
    font-size: 1.5rem;
}

.chat-label {
    text-align: center;
    line-height: 1;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.3);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.5);
}

/* Loading indicator */
.chat-loading {
    display: flex;
    gap: 4px;
    padding: 0.6rem 1rem;
}

.chat-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #06b6d4;
    animation: pulse 1.4s infinite;
}

.chat-loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chat-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        max-width: 400px;
    }

    .chat-input {
        font-size: 1rem;
    }
}
