.chat-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.chat-header {
    background: white;
    border-radius: 15px 15px 0 0;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.chat-messages {
    background: #f8f9fa;
    max-height: 600px;
    overflow-y: auto;
    padding: 1.5rem;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

.chat-footer {
    background: white;
    border-radius: 0 0 15px 15px;
    padding: 1.5rem;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
}

.message.customer {
    justify-content: flex-end;
}

.message.admin {
    justify-content: flex-start;
}

.message.system {
    justify-content: center;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.message.customer .message-avatar {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    margin-left: 10px;
}

.message.admin .message-avatar {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
    margin-right: 10px;
}

.message-bubble {
    max-width: 70%;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    font-size: 14px;
}

.message.customer .message-bubble {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-bottom-right-radius: 6px;
    font-size: 14px;
}

.message.admin .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.message.system .message-bubble {
    background: #e9ecef;
    color: #6c757d;
    font-style: italic;
    text-align: center;
    border-radius: 20px;
    max-width: 80%;
}

.message-info {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

.message.customer .message-info {
    text-align: right;
    color: #ffffff;
}

.message.admin .message-info {
    color: #6c757d;
}

.sender-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-active {
    background: #d1edff;
    color: #0066cc;
}

.status-waiting_admin {
    background: #fff3cd;
    color: #856404;
}

.status-closed {
    background: #f8d7da;
    color: #721c24;
}

.btn-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-custom:hover {
    transform: scale(1.05);
    color: white;
}

.chat-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.info-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.info-value {
    color: #212529;
}

.empty-messages {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

/* Chat Widget Button */
.chat-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-widget-button.active {
    background: #dc3545;
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 999;
    transform: translateY(100%) scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-widget.active {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.chat-header-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-header-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chat-header-actions {
    display: flex;
    align-items: center;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chat-status-message {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    color: #28a745;
    font-weight: 500;
}

.chat-status-message.closed {
    color: #dc3545;
}

.start-new-chat-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 10px;
    margin-right: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.start-new-chat-btn:hover {
    transform: scale(1.05);
}

.restart-chat-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.restart-chat-btn:hover {
    transform: scale(1.05);
}

.chat-action-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.chat-options-menu {
    position: absolute;
    top: 10px;
    right: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.chat-options-menu:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dropdown-menu-custom {
    position: absolute;
    top: 35px;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    z-index: 1000;
    display: none;
    padding: 5px 0;
}

.dropdown-menu-custom.show {
    display: block;
}

.dropdown-item-custom {
    padding: 8px 15px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item-custom:hover {
    background-color: #f8f9fa;
}

.dropdown-item-custom i {
    margin-right: 8px;
    width: 15px;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message.admin {
    justify-content: flex-start;
}

.message.customer {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    margin-right: 8px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #28a745;
    margin-right: 0;
    margin-left: 8px;
}

.message.customer .message-avatar {
    background: #28a745;
    margin-right: 0;
    margin-left: 8px;
}

.message.admin .message-avatar {
    background: #007bff;
    margin-right: 8px;
    margin-left: 0;
}

.message-bubble {
    max-width: 250px;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    animation: messageSlideIn 0.3s ease;
}

.message.bot .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 13px;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
    font-size: 13px;
}

.message.customer .message-bubble {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.message.admin .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 10px 20px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.typing-indicator.active {
    display: block;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 5px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: typingBounce 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 typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Chat Input */
.chat-input {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.input-group {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 5px;
}

.chat-input input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 15px;
    background: transparent;
    font-size: 14px;
}

.chat-input button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-input button:hover {
    transform: scale(1.05);
}

.chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quick Options */
.quick-options {
    padding: 10px 20px;
    display: none;
}

.quick-options.active {
    display: block;
}

.quick-option {
    display: inline-block;
    background: #f8f9fa;
    color: #667eea;
    padding: 8px 15px;
    border-radius: 20px;
    margin: 5px 5px 0 0;
    cursor: pointer;
    border: 1px solid #e9ecef;
    font-size: 13px;
    transition: all 0.2s ease;
}

.quick-option:hover {
    background: #667eea;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        bottom: 90px;
        right: 20px;
        left: 20px;
    }
}

/* Demo page styling */
.demo-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.demo-content h1 {
    color: #333;
    margin-bottom: 20px;
}

.demo-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.feature-card {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.feature-card i {
    font-size: 30px;
    color: #667eea;
    margin-bottom: 10px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.d-none {
    display: none !important;
}

@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
    }

    .chat-info {
        grid-template-columns: 1fr;
    }
}