/* Custom Properties */
:root {
    --primary-color: #20B2AA;
    --primary-dark: #1a8f89;
    --secondary-color: #f8f9fa;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --message-bg: #f8f9fa;
    --text-color: #2c3e50;
    --light-bg: rgba(255, 255, 255, 0.1);
    --text-muted: rgba(255, 255, 255, 0.8);
}
 
/* Base Styles */
* {
    box-sizing: border-box;
}
 
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}
 
/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1001;
    color: white;
    font-size: 24px;
}
 
.chat-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
 
.chat-toggle.active {
    background: #dc3545;
}
 
.chat-toggle.active i::before {
    content: "\f00d";
}
 
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
}
 
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
 
/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: min(90vw, 480px);
    height: min(90vh, 700px);
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    overflow: hidden;
}
 
.chat-container.active {
    opacity: 1;
    transform: translateY(0);
}
 
/* Chat Header */
.chat-header {
    background: var(--primary-color);
    padding: 16px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}
 
.chat-header h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.chat-header small {
    font-size: 0.8rem;
    opacity: 0.9;
}
 
.avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}
 
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    margin-right: 5px;
    animation: blink 2s infinite;
}
 
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}
 
/* Quick Actions */
.quick-actions {
    padding: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

.quick-actions.hidden {
    transform: translateY(-100%);
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.quick-action-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quick-action-btn i {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.quick-action-btn span {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}
 
/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
    transition: padding-top 0.3s ease;
}

.chat-messages.with-quick-actions {
    padding-top: 0;
}
 
.chat-messages::-webkit-scrollbar {
    width: 4px;
}
 
.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}
 
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}
 
.message {
    display: flex;
    gap: 12px;
    max-width: 100%;
}
 
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}
 
.bot-message .message-avatar {
    background: var(--primary-color);
    color: white;
}
 
.user-message {
    flex-direction: row-reverse;
}
 
.user-message .message-avatar {
    background: #6c757d;
    color: white;
    margin-right: 0;
    margin-left: 12px;
}
 
.user-message .message-content {
    align-items: flex-end;
}
 
.message-content {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}
 
.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    max-width: 85%;
    line-height: 1.5;
    font-size: 0.9rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-text {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-card {
    background: var(--light-bg);
    border-radius: 0.75rem;
    padding: 1rem;
    margin: 0.75rem 0;
    border: 1px solid var(--border-color);
}

.product-header {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.model {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
}

.features {
    font-size: 0.85rem;
    color: var(--text-color);
    margin: 0.25rem 0;
}

/* Bot message specific styles */
.bot-message .message-bubble {
    background: var(--light-bg);
    color: var(--text-color);
}

.bot-message .message-bubble p {
    margin-bottom: 0.75rem;
}

.bot-message .message-bubble p:last-child {
    margin-bottom: 0;
}

/* User message specific styles */
.user-message .message-bubble {
    background: var(--message-bg);
    color: var(--text-color);
}

.user-message .message-bubble strong {
    color: var(--primary-color);
}

.user-message .message-bubble a {
    color: var(--primary-color);
}

.user-message .message-bubble hr {
    border-top-color: rgba(0, 0, 0, 0.1);
}
 
.message-time {
    color: var(--text-light);
    font-size: 0.75rem;
    margin-top: 4px;
}
 
/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    padding: 0 20px 10px;
    animation: slideIn 0.3s ease-out;
}
 
.typing-indicator.active {
    display: flex;
}
 
.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}
 
.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}
 
.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
 
.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}
 
@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}
 
/* Chat Input */
.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input-wrapper {
    flex: 1;
    background: #f8f9fa;
    border-radius: 24px;
    padding: 8px 16px;
    min-height: 48px;
    max-height: 120px;
    overflow-y: auto;
}

.chat-input {
    width: 100%;
    border: none;
    background: none;
    padding: 8px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 100px;
    overflow-y: auto;
}

.chat-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
    font-size: 0.85rem;
}

.send-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(32, 178, 170, 0.2);
}

.send-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(32, 178, 170, 0.3);
}

.send-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(32, 178, 170, 0.2);
}

.send-button i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.send-button:hover i {
    transform: scale(1.1);
}

/* Chat Footer */
.chat-footer {
    padding: 10px 20px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
 
/* Chat Overlay */
.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}
 
.chat-overlay.active {
    opacity: 1;
    visibility: visible;
}
 
/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        bottom: 10px;
        right: 10px;
        left: 10px;
        border-radius: var(--border-radius);
    }
   
    .chat-toggle {
        bottom: 20px;
        right: 20px;
    }
   
    .quick-actions .col-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
   
    .message-content {
        max-width: 85%;
    }

    .product-card {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }

    .product-header {
        font-size: 0.9rem;
    }

    .price {
        font-size: 1rem;
    }

    .model, .features {
        font-size: 0.8rem;
    }
}
 
@media (max-width: 480px) {
    .chat-container {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-header h6 {
        font-size: 0.9rem;
    }

    .chat-header small {
        font-size: 0.75rem;
    }

    .chat-input-container {
        padding: 12px;
    }

    .chat-input-wrapper {
        min-height: 40px;
    }

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

    .message-bubble {
        padding: 12px;
        font-size: 0.85rem;
    }

    .product-card {
        padding: 12px;
        font-size: 0.85rem;
    }

    .product-card a {
        font-size: 0.9rem;
    }

    .product-card .price {
        font-size: 0.95rem;
    }

    .product-card .model {
        font-size: 0.8rem;
    }

    .product-card .features {
        font-size: 0.8rem;
    }

    .quick-action-btn {
        padding: 10px 6px;
    }
   
    .quick-action-btn i {
        font-size: 16px;
    }
   
    .quick-action-btn span {
        font-size: 10px;
    }
}
 
/* Tablet adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .chat-container {
        width: min(90vw, 600px);
        height: min(90vh, 800px);
    }
}

/* Desktop adjustments */
@media (min-width: 769px) {
    .chat-container {
        width: min(90vw, 480px);
        height: min(90vh, 700px);
    }
}
 
/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}
 
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
 
.slide-up {
    animation: slideUp 0.3s ease-out;
}
 
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
 
/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
 
.shadow-custom {
    box-shadow: var(--shadow-sm);
}
 
.shadow-custom-lg {
    box-shadow: var(--shadow-lg);
}
 