/* DubZig AI Chatbot Styles */

/* Chat Button */
.chat-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.4);
    z-index: 999999;
    transition: all 0.3s ease;
    border: none;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(13, 110, 253, 0.6);
}

.chat-button i {
    font-size: 28px;
    color: white;
}

.chat-button .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 999999;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-widget.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chat-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-close:hover {
    opacity: 1;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #e9ecef;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
}

.message.user .message-avatar {
    background: #6c757d;
    color: white;
}

.message-content {
    max-width: 70%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 14px;
}

/* Message formatting styles */
.message-bubble strong {
    font-weight: 600;
    color: inherit;
}

.message-bubble em {
    font-style: italic;
}

.message-bubble code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message.user .message-bubble code {
    background: rgba(255, 255, 255, 0.2);
}

.message-bubble ul,
.message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble li {
    margin: 4px 0;
    line-height: 1.5;
}

.message-bubble ul {
    list-style-type: none;
}

.message-bubble ul li:before {
    content: "•";
    color: #0d6efd;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.message.user .message-bubble ul li:before {
    color: rgba(255, 255, 255, 0.8);
}

.message-bubble ol {
    list-style-type: decimal;
}

.message-bubble h2,
.message-bubble h3,
.message-bubble h4 {
    margin: 10px 0 6px 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-bubble h2 {
    font-size: 18px;
}

.message-bubble h3 {
    font-size: 16px;
}

.message-bubble h4 {
    font-size: 15px;
}

.message-bubble a {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.message-bubble a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.message.user .message-bubble a {
    color: white;
    text-decoration: underline;
    font-weight: 500;
}

.message.user .message-bubble a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.message.bot .message-bubble {
    background: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message.user .message-bubble {
    background: #0d6efd;
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 6px;
}

.message.user .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.typing-indicator.active {
    display: block;
}

.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c757d;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply {
    background: white;
    border: 2px solid #0d6efd;
    color: #0d6efd;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply:hover {
    background: #0d6efd;
    color: white;
}

/* Chat Input */
.chat-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

#chatInput {
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 45px 12px 20px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    transition: border-color 0.2s;
}

#chatInput:focus {
    outline: none;
    border-color: #0d6efd;
}

.input-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 5px;
}

.input-action-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: color 0.2s;
}

.input-action-btn:hover {
    color: #0d6efd;
}

#sendBtn {
    background: #0d6efd;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

#sendBtn:hover:not(:disabled) {
    background: #0a58ca;
    transform: scale(1.05);
}

#sendBtn:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

/* Welcome Screen */
.chat-welcome {
    padding: 30px 20px;
    text-align: center;
}

.chat-welcome h3 {
    color: #212529;
    margin-bottom: 10px;
}

.chat-welcome p {
    color: #6c757d;
    margin-bottom: 20px;
}

.welcome-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suggestion-btn {
    background: white;
    border: 2px solid #e9ecef;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.suggestion-btn:hover {
    border-color: #0d6efd;
    background: #f8f9ff;
}

.suggestion-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.suggestion-text h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #212529;
}

.suggestion-text p {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-widget {
        width: calc(100% - 30px);
        height: calc(100% - 120px);
        right: 15px;
        bottom: 90px;
        border-radius: 15px;
    }
    
    .chat-button {
        right: 15px;
        bottom: 15px;
        width: 55px;
        height: 55px;
    }
}

/* Powered by badge */
.chat-powered {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #6c757d;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.chat-powered a {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
}

/* Contact Form in Chat */
.chat-contact-form {
    width: 100%;
}

.chat-contact-form h6 {
    color: #0d6efd;
    font-weight: 600;
}

.chat-contact-form .form-control {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.chat-contact-form .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.chat-contact-form textarea.form-control {
    resize: vertical;
    min-height: 70px;
}

.chat-contact-form .btn {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.chat-contact-form .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Rich Media Styles */
.message-media {
    margin-bottom: 10px;
}

.media-image {
    max-width: 100%;
    border-radius: 10px;
    display: block;
}

.media-video {
    max-width: 100%;
    border-radius: 10px;
    display: block;
}

.message-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 5px;
    margin: 10px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.message-carousel::-webkit-scrollbar {
    height: 6px;
}

.message-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.message-carousel::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 10px;
}

.carousel-card {
    min-width: 220px;
    max-width: 220px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    scroll-snap-align: start;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.carousel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.15);
    border-color: #0d6efd;
}

.carousel-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.carousel-content {
    padding: 15px;
}

.carousel-content h6 {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
}

.carousel-content p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.5;
}

.carousel-content .btn {
    width: auto;
    display: inline-block;
    font-size: 12px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.carousel-content .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
}

/* Proactive Triggers */
.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(13, 110, 253, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 6px 30px rgba(13, 110, 253, 0.6); }
}

/* Service Cards */
.service-cards-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    margin: 10px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.service-cards-container::-webkit-scrollbar {
    height: 6px;
}

.service-cards-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.service-cards-container::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 10px;
}

.service-card {
    min-width: 220px;
    max-width: 220px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    scroll-snap-align: start;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
    border-color: #0d6efd;
}

.service-card.featured {
    border-color: #0d6efd;
    border-width: 3px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
}

.card-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

.card-icon {
    font-size: 36px;
    margin-bottom: 12px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #212529;
    margin: 10px 0;
    line-height: 1.3;
}

.card-price {
    font-size: 24px;
    font-weight: 800;
    color: #0d6efd;
    margin: 12px 0;
}

.card-price small {
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

.card-features {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    text-align: left;
}

.card-features li {
    padding: 6px 0;
    font-size: 13px;
    color: #495057;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}

.card-features li i {
    color: #28a745;
    margin-right: 8px;
    margin-top: 2px;
    font-size: 12px;
    flex-shrink: 0;
}

.card-action-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.card-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.4);
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
}

.card-action-btn:active {
    transform: translateY(0);
}

.service-card.featured .card-action-btn {
    background: linear-gradient(135deg, #28a745 0%, #20873a 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.service-card.featured .card-action-btn:hover {
    background: linear-gradient(135deg, #20873a 0%, #1c6e34 100%);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

/* Responsive adjustments for service cards */
@media (max-width: 480px) {
    .service-card {
        min-width: 200px;
        max-width: 200px;
        padding: 16px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .card-price {
        font-size: 22px;
    }
    
    .card-features li {
        font-size: 12px;
    }
}

.chat-preview-bubble {
    position: fixed;
    bottom: 110px;
    right: 30px;
    max-width: 320px;
    z-index: 999998;
    animation: slideInUp 0.3s ease;
}

.preview-message {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 12px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.preview-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}

.preview-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-avatar i {
    color: white;
    font-size: 20px;
}

.preview-text {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.preview-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 12px;
    transition: color 0.2s ease;
}

.preview-close:hover {
    color: #333;
}

.chat-preview-bubble.fade-out {
    animation: fadeOut 0.3s ease;
    opacity: 0;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}
