/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 20px;
    z-index: 1000;
    font-family: 'Quicksand', sans-serif;
    display: none;
    flex-direction: column;
    width: 350px;
    height: 500px;
    background: #1f1f38;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(192, 132, 252, 0.3);
    overflow: hidden;
}

.chat-widget.chat-open {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(192, 132, 252, 0.3);
}

.chat-header-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 0.75rem;
}

.chat-header-avatar .ricky-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-header-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #0b0c1b;
    scrollbar-width: thin;
    scrollbar-color: #c084fc #1f1f38;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #1f1f38;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c084fc;
    border-radius: 2px;
}

.chat-message {
    display: flex;
    margin-bottom: 1rem;
    align-items: flex-start;
}

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

.chat-message.ricky-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.message-avatar .ricky-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.message-content {
    max-width: 70%;
    background: #1f1f38;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(192, 132, 252, 0.2);
}

.user-message .message-content {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    color: white;
    margin-left: auto;
}

.ricky-message .message-content {
    background: #1f1f38;
    color: #ffffff;
}

.message-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Chat Input */
.chat-input-container {
    background: #1f1f38;
    border-top: 1px solid rgba(192, 132, 252, 0.3);
}

.chat-typing {
    display: none;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(192, 132, 252, 0.1);
}

.chat-typing .message-avatar {
    margin-right: 0.5rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #c084fc;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

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

.chat-input-area {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    background: #0b0c1b;
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 25px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.1);
}

.chat-input::placeholder {
    color: #aaaaaa;
}

.chat-send {
    background: linear-gradient(135deg, #c084fc, #a855f7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(192, 132, 252, 0.4);
}

.chat-send:active {
    transform: translateY(0);
}

/* Ricky Avatar Image Styles */
.ricky-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-widget {
        width: 300px;
        height: 400px;
        bottom: 100px;
        right: 10px;
    }
    
    .chat-header {
        padding: 0.5rem 0.75rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
    }
    
    .chat-input-area {
        padding: 0.75rem;
    }
}

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

/* Animation for better UX */
.chat-widget * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus styles for accessibility */
.chat-input:focus,
.chat-send:focus,
.chat-close:focus {
    outline: 2px solid #c084fc;
    outline-offset: 2px;
}