/**
 * Eddi Dübel Chatbot Widget - Styles
 * holzPUNK.de
 */

/* ============================================
   CHAT BUTTON (mit Eddi-Bild!)
   ============================================ */

.eddi-chat-button {
    position: fixed;
    bottom: 50px;
    right: 150px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    border: 3px solid #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 9998;
    padding: 0;
    overflow: hidden;
}

.eddi-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.eddi-chat-button:active {
    transform: scale(0.95);
}

/* Eddi Avatar im Button */
.eddi-avatar-button {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Notification Badge */
.eddi-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #CD5C5C;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   CHAT WINDOW
   ============================================ */

.eddi-chat-window {
    position: fixed;
    bottom: 50px;
    right: 150px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   HEADER
   ============================================ */

.eddi-chat-header {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.eddi-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Eddi Avatar im Header */
.eddi-avatar-header {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.eddi-header-title {
    font-weight: 600;
    font-size: 16px;
}

.eddi-header-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.eddi-status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Header Buttons */
.eddi-header-right {
    display: flex;
    gap: 8px;
}

.eddi-icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.eddi-icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.eddi-icon-btn:active {
    transform: scale(0.95);
}

/* ============================================
   DSGVO CONSENT
   ============================================ */

.eddi-gdpr-consent {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.eddi-gdpr-consent p {
    margin: 0;
    line-height: 1.5;
}

.eddi-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.eddi-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.eddi-btn-primary {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.eddi-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.eddi-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.eddi-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   CHAT INTERFACE
   ============================================ */

#eddi-chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Messages Area */
.eddi-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fa;
}

.eddi-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.eddi-message-user {
    flex-direction: row-reverse;
}

/* Eddi Avatar bei Nachrichten */
.eddi-avatar-msg {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid #D2691E;
}

.eddi-message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
}

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

.eddi-message-bot .eddi-message-bubble a {
    color: #8B4513;
    text-decoration: underline;
    cursor: pointer;
    pointer-events: auto;
}

.eddi-message-bot .eddi-message-bubble a:hover {
    color: #D2691E;
    text-decoration: underline;
}

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

/* Typing Indicator */
.eddi-typing-indicator {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.eddi-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #8B4513;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* ============================================
   INPUT AREA
   ============================================ */

.eddi-input-area {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #e5e7eb;
    gap: 8px;
}

.eddi-input {
    flex: 1;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.eddi-input:focus {
    border-color: #8B4513;
}

.eddi-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s;
}

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

.eddi-send-btn:active {
    transform: scale(0.95);
}

/* ============================================
   PRIVACY INFO
   ============================================ */

.eddi-privacy-info {
    padding: 8px 12px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    font-size: 11px;
    color: #6b7280;
}

.eddi-privacy-info a {
    color: #8B4513;
    text-decoration: none;
}

.eddi-privacy-info a:hover {
    text-decoration: underline;
}

/* ============================================
   RÜCKRUF-BUTTON IN FAQ-ANTWORTEN
   ============================================ */

.eddi-callback-button {
    background: linear-gradient(135deg, #CD5C5C 0%, #DC143C 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin: 10px 0;
    display: inline-block;
    transition: all 0.2s;
    font-size: 14px;
}

.eddi-callback-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
    background: linear-gradient(135deg, #DC143C 0%, #CD5C5C 100%);
}

.eddi-callback-button:active {
    transform: translateY(0);
}

/* ============================================
   CHOICE BUTTONS (für Bestellung/Anliegen/Ja/Nein)
   ============================================ */

.eddi-choice-button {
    background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin: 5px 5px 5px 0;
    display: inline-block;
    transition: all 0.2s;
    font-size: 14px;
    min-width: 120px;
}

.eddi-choice-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
    background: linear-gradient(135deg, #D2691E 0%, #8B4513 100%);
}

.eddi-choice-button:active {
    transform: translateY(0);
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

@media (max-width: 480px) {
    .eddi-chat-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .eddi-chat-button {
        bottom: 16px;
        right: 16px;
        width: 60px;
        height: 60px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.eddi-messages::-webkit-scrollbar {
    width: 6px;
}

.eddi-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.eddi-messages::-webkit-scrollbar-thumb {
    background: #8B4513;
    border-radius: 3px;
}

.eddi-messages::-webkit-scrollbar-thumb:hover {
    background: #D2691E;
}