:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #A5D6A7;
    --accent-color: #FF9800;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --chat-bg: #fff;
    --bot-message-bg: #e9f5e9;
    --user-message-bg: #f0f4f8;
    --border-radius: 12px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Chat Widget Button */
.chat-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.chat-widget-button i {
    font-size: 24px;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    background-color: var(--primary-dark);
}

/* Chat Popup */
.chat-popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 550px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    opacity: 0;
    transform-origin: bottom right;
    transition: all 0.3s ease;
}

.chat-popup.active {
    transform: scale(1);
    opacity: 1;
}

.chat-popup-header {
    padding: 15px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-popup-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-popup-logo i {
    font-size: 20px;
}

.chat-popup-logo h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.chat-popup-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-status {
    display: flex;
    gap: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: #4CAF50;
}

.status-dot.offline {
    background-color: #F44336;
}

.chat-popup-actions {
    display: flex;
    gap: 5px;
}

.chat-popup-action-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.chat-popup-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chat popup tabs */
.chat-popup-tabs {
    display: flex;
    background-color: var(--primary-dark);
}

.chat-tab {
    padding: 10px 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    text-align: center;
    font-weight: 600;
}

.chat-tab:hover {
    color: white;
}

.chat-tab.active {
    color: white;
    border-bottom: 3px solid var(--accent-color);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Fast Chat Styles */
.fast-chat-form {
    padding: 15px;
    height: 100%;
    overflow-y: auto;
}

.fast-chat-form h3 {
    margin: 0 0 15px;
    color: var(--primary-dark);
    font-size: 1.2rem;
    text-align: center;
}

.fast-chat-section {
    margin-bottom: 20px;
}

.fast-chat-section h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #555;
}

.fast-chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(25% - 8px);
    height: 70px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px 5px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.option-item i {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary);
}

.option-item span {
    text-align: center;
    font-size: 0.75rem;
}

.option-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.option-item.selected {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.option-item.selected i {
    color: var(--primary-dark);
}

.action-button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 15px;
}

.action-button:hover {
    background-color: var(--primary-dark);
}

.action-button i {
    margin-right: 5px;
}

/* Tab Content */
.chat-popup-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

/* Inline loader for chat messages */
.inline-loader {
    margin: 10px 0;
    padding: 0;
    position: relative;
    background: transparent;
}

.loading-message {
    padding: 10px;
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Product loading message */
.product-loading-message {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    font-style: italic;
    color: #555;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: pulse 1.5s infinite alternate;
}

.tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    overflow-y: auto;
    padding: 15px;
    background-color: var(--chat-bg);
}

.tab-content.active {
    display: block;
}

/* Categories and Effects Grids */
.category-grid, .effects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px 0;
}

.category-item, .effect-item {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-item:hover, .effect-item:hover {
    background-color: var(--primary-light);
}

.category-item i, .effect-item i {
    font-size: 24px;
    color: var(--primary-dark);
}

/* Chat Messages */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 100%;
    overflow-y: auto;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.message-bubble {
    padding: 10px 12px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.bot .message-bubble {
    background-color: var(--bot-message-bg);
    border-bottom-left-radius: 0;
}

.user .message-bubble {
    background-color: var(--user-message-bg);
    border-bottom-right-radius: 0;
}

.message p {
    margin: 0;
    font-size: 0.9rem;
}

/* Product Carousel */
.product-container {
    display: none;
    padding: 15px 0;
    overflow-x: auto;
    white-space: nowrap;
}

.product-container.active {
    display: block;
}

.product-carousel {
    display: flex;
    gap: 10px;
}

.product-card {
    flex: 0 0 200px;
    border-radius: var(--border-radius);
    background-color: white;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
    display: inline-block;
    margin-right: 10px;
    white-space: normal;
    vertical-align: top;
    position: relative;
}

.product-card:hover {
    transform: translateY(-3px);
}

.product-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.product-info {
    padding: 10px;
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-category, .product-brand {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 3px;
}

.product-thc {
    font-size: 0.8rem;
    margin-top: 5px;
    color: var(--primary-dark);
}

/* Price styling */
.product-price {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
    color: #333;
}

.product-price.on-sale {
    display: flex;
    align-items: center;
    gap: 5px;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.8rem;
    font-weight: normal;
}

.discounted-price {
    color: #e53935;
}

/* Classification badge */
.classification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.no-image {
    background-color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #aaa;
    font-size: 1.5rem;
}

/* Suggestions Container */
.suggestions-container {
    padding: 10px 0;
    display: none;
    gap: 8px;
    flex-wrap: wrap;
}

.suggestions-container.active {
    display: flex;
}

.suggestion-button {
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.suggestion-button:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Chat Input */
.chat-popup-footer {
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

.chat-input {
    display: flex;
    gap: 8px;
    background-color: #f5f5f5;
    border-radius: 20px;
    padding: 5px;
}

.chat-input input {
    flex: 1;
    border: none;
    padding: 8px 10px;
    font-size: 0.9rem;
    outline: none;
    background: transparent;
}

.send-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-button:hover {
    background-color: var(--primary-dark);
}

/* Product Details Modal */
.product-details-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.3s;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #777;
    cursor: pointer;
}

.close-modal:hover {
    color: #333;
}

/* Product Details */
.product-details-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.product-details-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.product-details-info {
    flex: 1;
}

.product-details-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.product-details-brand,
.product-details-category {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 3px;
}

.product-details-classification {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8rem;
    margin: 8px 0;
}

.product-details-description {
    margin: 10px 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.product-details-section {
    margin-top: 15px;
}

.product-details-section h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.product-details-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.attribute-tag {
    padding: 4px 8px;
    border-radius: 12px;
    background-color: #f0f4f8;
    font-size: 0.75rem;
}

/* Loading animation */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
    text-align: center;
}

.chat-loader {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.chat-loader > div {
    width: 12px;
    height: 12px;
    background-color: #3498db;
    border-radius: 100%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
    margin: 0 5px;
}

.chat-loader .bounce1 {
    animation-delay: -0.32s;
}

.chat-loader .bounce2 {
    animation-delay: -0.16s;
}

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

/* Modern Loader Styles */
.loader-container {
    width: 100%;
    max-width: 500px;
    margin: 10px auto;
    position: relative;
}

.loader-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    padding: 24px;
    transition: transform 180ms ease;
    margin-bottom: 20px;
}

.message-track {
    position: relative;
    min-height: 32px;
    margin-bottom: 12px;
}

.typing-line {
    opacity: 0;
    transition: opacity 200ms ease;
    line-height: 1.5;
    color: #333;
    font-size: 16px;
}

.typing-line.active {
    opacity: 1;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    animation: typing calc(var(--type-duration, 1000ms)) steps(var(--char-count, 10), end);
}

.typing-line.exiting {
    opacity: 0;
    transition: opacity 300ms ease;
}

.dots-blip {
    position: absolute;
    top: 100%;
    left: 0;
    opacity: 0;
    transition: opacity 180ms ease;
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.dots-blip.active {
    opacity: 1;
}

.dots-blip span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    margin-right: 6px;
    opacity: 0.8;
}

.dots-blip.bounce span {
    animation: dotPulse 1.4s infinite;
}

.dots-blip span:nth-child(2) {
    animation-delay: 160ms;
}

.dots-blip span:nth-child(3) {
    animation-delay: 320ms;
}

.progress-bar {
    height: 4px;
    background: #5caf65;
    width: 0;
    border-radius: 2px;
    transition: width 400ms cubic-bezier(0.65, 0, 0.35, 1);
}

.message-bump {
    animation: messageBump 180ms ease-out;
}

@keyframes messageBump {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

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

/* Search bar styles */
.search-container {
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eaeaea;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 24px;
    padding: 8px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-icon {
    color: #888;
    margin-right: 8px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 5px;
}

.search-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-button:hover {
    background-color: #3d9c40;
}

/* Category Grid Styles */
.category-section {
    margin-bottom: 20px;
}

.category-section h4 {
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    font-size: 15px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.category-card {
    background-color: #f5f5f5;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.category-card.selected {
    border-color: #4CAF50;
    background-color: #e8f5e9;
    box-shadow: 0 3px 8px rgba(76, 175, 80, 0.3);
}

.category-icon {
    font-size: 24px;
    color: #4CAF50;
    margin-bottom: 8px;
}

.category-name {
    font-size: 12px;
    font-weight: 500;
}

/* Fast Chat button styles */
.find-products-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    margin-bottom: 10px;
    display: block;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.find-products-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Fast Chat option styles */
.option-container {
    margin-bottom: 15px;
}

.option-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.option-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-item {
    cursor: pointer;
    background-color: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.option-item:hover {
    background-color: #e8e8e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.option-item.selected {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-color: #4CAF50;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

/* Color coding for classifications */
.classification-HYBRID {
    background-color: #9575CD;
    color: white;
}

.classification-INDICA {
    background-color: #5E35B1;
    color: white;
}

.classification-SATIVA {
    background-color: #43A047;
    color: white;
}

.classification-HYBRID-INDICA {
    background-color: #7986CB;
    color: white;
}

.classification-HYBRID-SATIVA {
    background-color: #66BB6A;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-popup {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-widget-button {
        bottom: 15px;
        right: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
}

@media (max-width: 480px) {
    .category-grid, .effects-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .product-card {
        flex: 0 0 180px;
    }
}
