/* Container principale */
.product-bot-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e0e0e0;
}

.product-bot-container.open {
    transform: translateX(0);
}

/* Header */
.bot-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-title {
    margin: 0;
    font-size: 1.3rem;
    color: white !important;
}

.bot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Area conversazione */
.bot-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
}

/* Messaggi */
.bot-message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.5;
    word-break: break-word;
    animation: fadeIn 0.3s ease;
}

.user-message {
    background: #3498db;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background: #ecf0f1;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

/* Lista opzioni */
.bot-categories-list,
.bot-options-list,
.bot-attributes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

/* Elementi cliccabili */
.bot-category-item,
.bot-option,
.bot-attribute {
    display: inline-block;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.bot-category-item:hover,
.bot-option:hover,
.bot-attribute:hover {
    background: #B48326 !important;
    color: white;
}


/* Bottone trigger */
.bot-trigger {
    position: fixed;
    right: 20px;
    bottom: 20px;
    /**width: 60px;**/
	padding:20px 30px !important;
    height: 60px;
    background: #2c3e50;
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 9998;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.bot-trigger:hover {
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 600px) {
    .product-bot-container {
        width: 100%;
    }
    
    .bot-trigger {
        right: 10px;
        bottom: 10px;
        width: 50px;
        height: 50px;
    }
}

/* Loader più visibile */
.bot-actions .bot-loader {
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(44, 62, 80, 0.2);
    border-radius: 50%;
    border-top-color: #2c3e50;
    animation: spin 0.8s linear infinite;
    position: relative;
}

/* Aggiungi stile per messaggi di errore */
.bot-error-message {
    background-color: #ffe6e6 !important;
    border-left: 4px solid #ff3333 !important;
    color: #cc0000 !important;
}

/* Animazione più fluida */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.bot-loader {
    display: block;
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(44, 62, 80, 0.2);
    border-radius: 50%;
    border-top-color: #2c3e50;
    animation: spin 0.8s linear infinite;
}

.bot-error-message {
    background-color: #ffe6e6 !important;
    border-left: 4px solid #ff3333 !important;
    color: #cc0000 !important;
}

/* Assicurati che i pulsanti siano cliccabili */
.bot-category-item, 
.bot-option, 
.bot-attribute {
    cursor: pointer;
    user-select: none;
}

/* Migliora la visibilità durante il caricamento */
.product-bot-container.loading .bot-actions {
    pointer-events: none;
    opacity: 0.7;
}

.bot-attribute-values-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.bot-attribute-value {
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bot-attribute-value:hover {
    background: #B48326;
    color: white;
}

/* Stili per i risultati del filtro */
.bot-filter-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.bot-show-products, 
.bot-new-filter {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.bot-show-products {
    background: #2c3e50;
    color: white;
}

.bot-new-filter {
    background: #f5f5f5;
}

.bot-attribute-values-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.bot-attribute-value {
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bot-attribute-value:hover {
    background: #B48326;
    color: white;
}

.bot-filter-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.bot-show-filtered, 
.bot-change-filter {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.bot-show-filtered {
    background: #2c3e50;
    color: white;
}

.bot-change-filter {
    background: #f5f5f5;
}

.user-message{color: #B48326 !important}

.bot-subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.bot-subcategory-item {
    display: inline-block;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.bot-subcategory-item:hover {
    background: #B48326 !important;
    color: white;
}

.bot-restart {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 10px 15px;
    cursor: pointer;
    margin-top: 10px;
    display: inline-block;
    transition: all 0.2s ease;
}

.bot-restart:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* Stile per le opzioni disabilitate */
.bot-category-item[disabled],
.bot-option[disabled],
.bot-attribute[disabled],
.bot-attribute-value[disabled],
.bot-subcategory-item[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Stile per il loader */
.bot-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #2c3e50;
    animation: spin 1s ease-in-out infinite;
    margin: 10px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer con pulsante reset fisso */
.bot-footer {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    text-align: center;
}

.bot-reset-fixed {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 18px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.bot-reset-fixed:hover {
    background: #c0392b;
}

/* Assicurati che il container abbia spazio per il footer */
.product-bot-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e0e0e0;
}

.bot-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
}