/* Bot Defunti - CSS */
.bot-defunti-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100000;
    font-family: 'Poppins', sans-serif;
}

.bot-defunti-toggle {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 32px;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(30, 58, 138, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 100002;
}

.bot-defunti-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(30, 58, 138, 0.6);
}

.bot-defunti-widget {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 450px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 100001;
    border: 2px solid rgba(226, 232, 240, 0.8);
}

.bot-defunti-widget.active {
    display: flex;
    animation: botSlideIn 0.3s ease;
}

@keyframes botSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bot-defunti-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 25px;
    text-align: center;
    position: relative;
}

.bot-defunti-header h3 {
    margin: 0 0 8px 0;
    font-size: 2.4rem;
    color: aliceblue;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bot-defunti-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 1.3rem;
    font-weight: 500;
}

.bot-defunti-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.bot-defunti-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.bot-defunti-content {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    background: #f8fafc;
}

.bot-defunti-tabs {
    display: flex;
    margin-bottom: 25px;
    background: white;
    border-radius: 15px;
    padding: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bot-defunti-tab {
    flex: 1;
    padding: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.3rem;
    color: #64748b;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.bot-defunti-tab.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.bot-defunti-messages {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 20px;
}

.bot-defunti-message {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #3b82f6;
}

.bot-defunti-message-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.bot-defunti-candle {
    font-size: 2.2rem;
    animation: candleFlicker 3s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes candleFlicker {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    25% { opacity: 0.9; transform: scale(1.05); }
    50% { opacity: 0.7; transform: scale(0.95); }
    75% { opacity: 0.85; transform: scale(1.02); }
}

.bot-defunti-defunto {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.bot-defunti-categoria {
    color: #64748b;
    font-size: 1.2rem;
    font-weight: 500;
    font-style: italic;
}

.bot-defunti-message-text {
    color: #475569;
    line-height: 1.6;
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-style: italic;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #e2e8f0;
}

.bot-defunti-message-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    color: #64748b;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.bot-defunti-mittente {
    font-weight: 600;
    color: #3b82f6;
    font-size: 1.5rem;
}

.bot-defunti-data {
    color: #64748b;
    font-size: 1.1rem;
    background: rgba(96, 165, 250, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
}

.bot-defunti-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 20px 0;
    border-top: 2px solid #e2e8f0;
}

.bot-defunti-pagination-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bot-defunti-pagination-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.6;
}

.bot-defunti-pagination-btn:hover:not(:disabled) {
    background: #1e3a8a;
    transform: translateY(-2px);
}

.bot-defunti-pagination-info {
    font-size: 1.2rem;
    color: #64748b;
    font-weight: 600;
}

.bot-defunti-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.bot-defunti-form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot-defunti-form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 1.3rem;
}

.bot-defunti-form-group input,
.bot-defunti-form-group select,
.bot-defunti-form-group textarea {
    padding: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.3rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.bot-defunti-form-group input:focus,
.bot-defunti-form-group select:focus,
.bot-defunti-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.bot-defunti-form-group textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}

.bot-defunti-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.bot-defunti-checkbox input {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.bot-defunti-checkbox label {
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    font-size: 1.2rem;
}

.bot-defunti-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 20px 35px;
    border-radius: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

.bot-defunti-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.4);
}

.bot-defunti-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.bot-defunti-success {
    text-align: center;
    padding: 60px 30px;
    color: #059669;
}

.bot-defunti-success h4 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.bot-defunti-success p {
    font-size: 1.3rem;
    line-height: 1.6;
}

.bot-defunti-loading {
    text-align: center;
    padding: 60px 30px;
    color: #64748b;
    font-size: 1.4rem;
}

.bot-defunti-empty {
    text-align: center;
    padding: 60px 30px;
    color: #64748b;
}

.bot-defunti-empty p {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.bot-defunti-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 18px;
    border-radius: 12px;
    font-size: 1.3rem;
    margin-bottom: 25px;
    text-align: center;
    border: 2px solid #fecaca;
    font-weight: 500;
}


/* Nuove funzionalità suggerimenti e copia */
.bot-defunti-suggestions {
    background: #f0f9ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 2px solid #e0f2fe;
}

.bot-defunti-suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.bot-defunti-suggestions-header h4 {
    color: #0369a1;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.bot-defunti-refresh-suggestions {
    background: #38bdf8;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.bot-defunti-refresh-suggestions:hover {
    background: #0ea5e9;
    transform: rotate(90deg);
}

.bot-defunti-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bot-defunti-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #38bdf8;
}

.bot-defunti-suggestion-text {
    flex: 1;
    color: #475569;
    font-size: 1.5rem;
    line-height: 1.5;
    font-style: italic;
}

.bot-defunti-suggestion-btn {
    background: #3b82f6;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.bot-defunti-suggestion-btn:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.bot-defunti-text-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.bot-defunti-copy-btn {
    background: #10b981;
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.bot-defunti-copy-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.bot-defunti-copy-message {
    background: #64748b;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.bot-defunti-copy-message:hover {
    background: #475569;
    transform: scale(1.1);
}


/* Firefox specific optimizations */
@-moz-document url-prefix() {
    .bot-defunti-toggle,
    .bot-defunti-btn {
        transition-duration: 0.25s;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .bot-defunti-container {
        bottom: 15px;
        right: 15px;
    }
    
    .bot-defunti-widget {
        width: calc(100vw - 30px);
        right: -15px;
        height: 70vh;
    }
    
    .bot-defunti-toggle {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .bot-defunti-header {
        padding: 20px;
    }
    
    .bot-defunti-header h3 {
        font-size: 1.7rem;
    }
    
    .bot-defunti-header p {
        font-size: 1.2rem;
    }
    
    .bot-defunti-content {
        padding: 20px;
    }
    
    .bot-defunti-tab {
        font-size: 1.1rem;
        padding: 14px;
    }
    
    .bot-defunti-defunto {
        font-size: 1.4rem;
    }
    
    .bot-defunti-categoria {
        font-size: 1.1rem;
    }
    
    .bot-defunti-message-text {
        font-size: 1.2rem;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bot-defunti-toggle,
    .bot-defunti-btn,
    .bot-defunti-widget,
    .bot-defunti-candle {
        transition: none;
        animation: none;
    }
    
    .bot-defunti-toggle:hover,
    .bot-defunti-btn:hover {
        transform: none;
    }
    
    .bot-defunti-candle {
        animation: none;
        opacity: 0.8;
    }
}