/* KI-Chatbot Styles */
.chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--theme-color, #dc3545);
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
    animation: pulse 2s infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(220, 53, 69, 0.6);
}

.chatbot-button i {
    color: white;
    font-size: 28px;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(220, 53, 69, 0.7);
    }
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
}

.chatbot-window.open {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

.chatbot-header {
    background: linear-gradient(135deg, #21791f 0%, #21791f 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chatbot-message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message.bot {
    display: flex;
    gap: 10px;
}

.chatbot-message.user {
    display: flex;
    justify-content: flex-end;
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #21791f 0%, #21791f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.chatbot-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
}

.chatbot-message.bot .chatbot-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chatbot-message.user .chatbot-bubble {
    background: linear-gradient(135deg, #21791f 0%, #21791f 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.chatbot-option-btn {
    background: white;
    border: 2px solid #21791f;
    color: #21791f;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
}

.chatbot-option-btn:hover {
    background: #21791f;
    color: white;
    transform: translateX(5px);
}

.chatbot-input-area {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, opacity 0.2s;
}

.chatbot-input:focus {
    border-color: #21791f;
}

.chatbot-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.chatbot-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #21791f 0%, #1a5f18 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

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

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #21791f;
    animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Mobile Button für index.php/bagdady_index.php */
.chatbot-button-mobile {
    display: none; /* Versteckt auf Desktop */
}

/* KI-Chatbot Button in Navigation (home.php) */
.chatbot-nav-btn {
    display: inline-block;
    margin-left: 15px;
    margin-right: 57px;
    vertical-align: middle;
}

.chatbot-nav-btn button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #21791f 0%, #1a5f18 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(33, 121, 31, 0.3);
}

.chatbot-nav-btn button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(33, 121, 31, 0.5);
}

.chatbot-nav-btn button i {
    font-size: 18px;
}

/* langbg div Container für Language Switcher + Chatbot Button */
.langbg {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 80px;
        height: calc(100vh - 100px);
        max-height: 600px;
    }

    /* Standard-Button verstecken auf Mobile (home.php) */
    .chatbot-button {
        display: none !important;
    }

    /* Navigation-Button verstecken auf Mobile (ist jetzt im Burger-Menü) */
    .chatbot-nav-btn {
        display: none !important;
    }

    /* Mobile Button anzeigen (oben links) für index.php/bagdady_index.php */
    .chatbot-button-mobile {
        display: flex;
        position: fixed;
        top: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #21791f 0%, #1a5f18 100%);
        border-radius: 50%;
        border: none;
        box-shadow: 0 4px 15px rgba(33, 121, 31, 0.4);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        z-index: 9997;
    }

    .chatbot-button-mobile:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(33, 121, 31, 0.6);
    }

    .chatbot-button-mobile i {
        color: white;
        font-size: 22px;
    }
}

/* Formular-Inputs im Chat */
.chatbot-form-group {
    margin-bottom: 12px;
}

.chatbot-form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.chatbot-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-form-input:focus {
    border-color: #21791f;
}

.chatbot-form-textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.chatbot-form-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #21791f 0%, #1a5f18 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s;
}

.chatbot-form-submit:hover {
    transform: translateY(-2px);
}

.chatbot-success-message {
    text-align: center;
    padding: 20px;
    color: #28a745;
}

.chatbot-success-message i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.chatbot-char-counter {
    font-size: 11px;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

.chatbot-char-counter.warning {
    color: #f59e0b;
}

.chatbot-char-counter.error {
    color: #ef4444;
}

/* ==================== DATENSCHUTZ CONSENT DIALOG ==================== */
.chatbot-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chatbot-consent-box {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.chatbot-consent-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-consent-header i {
    font-size: 24px;
}

.chatbot-consent-content {
    padding: 20px;
    color: #333;
    line-height: 1.6;
}

.chatbot-consent-content p {
    margin: 0 0 10px 0;
}

.chatbot-consent-buttons {
    display: flex;
    gap: 10px;
    padding: 15px 20px 20px;
    background: #f8f9fa;
}

.chatbot-consent-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chatbot-consent-btn.decline {
    background: #e9ecef;
    color: #6c757d;
}

.chatbot-consent-btn.decline:hover {
    background: #dee2e6;
}

.chatbot-consent-btn.accept {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
}

.chatbot-consent-btn.accept:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .chatbot-consent-box {
        width: 95%;
        margin: 10px;
    }

    .chatbot-consent-buttons {
        flex-direction: column;
    }
}

/* ==================== GERICHTEKARTEN IM CHATBOT ==================== */
.chatbot-dish-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 15px 0;
    animation: fadeIn 0.4s ease;
}

.chatbot-dish-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.chatbot-dish-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #21791f;
}

.dish-card-image {
    width: 100%;
    height: 80px;
    overflow: hidden;
    position: relative;
}

.dish-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.chatbot-dish-card:hover .dish-card-image img {
    transform: scale(1.1);
}

.dish-card-content {
    padding: 10px;
}

.dish-card-category {
    font-size: 10px;
    color: #888;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dish-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-card-price {
    font-size: 14px;
    font-weight: 700;
    color: #21791f;
}

.dish-card-add {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #21791f 0%, #1a5f18 100%);
    color: white;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.dish-card-add:hover {
    background: linear-gradient(135deg, #1a5f18 0%, #145212 100%);
}

.dish-card-add i {
    font-size: 11px;
}

/* Mobile Anpassungen für Gerichtekarten */
@media (max-width: 400px) {
    .chatbot-dish-cards {
        grid-template-columns: 1fr;
    }

    .dish-card-image {
        height: 100px;
    }

    .dish-card-name {
        font-size: 14px;
    }
}
