.chat-widget-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    font-family: 'Roboto', sans-serif;
}

.chat-widget-container.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-widget-header {
    background: linear-gradient(135deg, #5a9fd4 0%, #4a8fc4 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-widget-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-widget-avatar {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a9fd4;
    font-size: 20px;
}

.chat-widget-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-widget-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.chat-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f7f9fa;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #5a9fd4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
    background: #6a6f73;
}

.chat-message-content {
    max-width: 70%;
}

.chat-message-bubble {
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.6;
    color: #2d3748;
}

.chat-message.user .chat-message-bubble {
    background: #5a9fd4;
    color: white;
}

.chat-message-time {
    font-size: 11px;
    color: #718096;
    margin-top: 4px;
    padding: 0 4px;
}

.chat-widget-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #d1d7dc;
}

.chat-widget-input-form {
    display: flex;
    gap: 10px;
}

.chat-widget-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d7dc;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-widget-input:focus {
    border-color: #5a9fd4;
}

.chat-widget-send-btn {
    width: 40px;
    height: 40px;
    background: #5a9fd4;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-widget-send-btn:hover {
    background: #4a8fc4;
    transform: scale(1.05);
}

.chat-widget-send-btn:disabled {
    background: #d1d7dc;
    cursor: not-allowed;
    transform: scale(1);
}

.chat-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #6a6f73;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chat-welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #4a5568;
}

.chat-welcome-message i {
    font-size: 48px;
    color: #5a9fd4;
    margin-bottom: 16px;
}

.chat-welcome-message h4 {
    font-size: 18px;
    color: #2d3748;
    margin-bottom: 8px;
}

.chat-welcome-message p {
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
}

@media (max-width: 768px) {
    .chat-widget-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        right: 10px;
        bottom: 90px;
    }
}


.chat-courses-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
    padding: 0 12px;
}

.chat-course-card {
    display: flex;
    gap: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-course-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(90, 159, 212, 0.2);
    border-color: #5a9fd4;
}

.chat-course-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}

.chat-course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-course-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.chat-course-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chat-course-price {
    font-size: 16px;
    font-weight: 700;
    color: #e53e3e;
}

@media (max-width: 480px) {
    .chat-widget-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-course-card {
        padding: 10px;
    }
    
    .chat-course-thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .chat-course-title {
        font-size: 13px;
    }
    
    .chat-course-price {
        font-size: 14px;
    }
}
