/**
 * Handz.on Chatbot Styles
 * ChatGPT-inspiriertes Design
 */

/* === FULLSCREEN HEADER CONTAINER === */
.handz-chatbot-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: #343541;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.handz-chatbot-container.active {
    opacity: 1;
    pointer-events: all;
}

/* === HEADER === */
.handz-chatbot-header {
    background: #343541;
    border-bottom: 1px solid #565869;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.handz-chatbot-title {
    color: #ececf1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.handz-chatbot-title::before {
    content: "💬";
    font-size: 20px;
}

.handz-chatbot-close {
    background: transparent;
    border: none;
    color: #ececf1;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 6px;
}

.handz-chatbot-close:hover {
    background: #40414f;
    color: #fff;
}

/* === MESSAGES CONTAINER === */
.handz-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #343541;
}

/* Custom Scrollbar */
.handz-chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.handz-chatbot-messages::-webkit-scrollbar-track {
    background: #40414f;
}

.handz-chatbot-messages::-webkit-scrollbar-thumb {
    background: #565869;
    border-radius: 4px;
}

.handz-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #676879;
}

/* === MESSAGE STYLES === */
.handz-chat-message {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
    max-width: 100%;
}

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

.handz-chat-message.user {
    background: #444654;
}

.handz-chat-message.assistant {
    background: #343541;
    border: 1px solid #565869;
}

.handz-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
}

.handz-chat-message.user .handz-chat-avatar {
    background: #5436da;
    color: #fff;
}

.handz-chat-message.assistant .handz-chat-avatar {
    background: #10a37f;
    color: #fff;
}

.handz-chat-content {
    flex: 1;
    color: #ececf1;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.handz-chat-content p {
    margin: 0 0 12px 0;
}

.handz-chat-content p:last-child {
    margin-bottom: 0;
}

/* === QUICK REPLIES === */
.handz-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.handz-quick-reply-btn {
    background: #40414f;
    border: 1px solid #565869;
    color: #ececf1;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.handz-quick-reply-btn:hover {
    background: #565869;
    border-color: #676879;
}

/* === TYPING INDICATOR === */
.handz-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.handz-typing-dot {
    width: 8px;
    height: 8px;
    background: #ececf1;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

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

/* === INPUT AREA === */
.handz-chatbot-input-wrapper {
    background: #343541;
    border-top: 1px solid #565869;
    padding: 20px;
    flex-shrink: 0;
}

.handz-chatbot-input-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    background: #40414f;
    border-radius: 12px;
    border: 1px solid #565869;
    display: flex;
    align-items: flex-end;
    transition: border-color 0.2s;
}

.handz-chatbot-input-container:focus-within {
    border-color: #676879;
    box-shadow: 0 0 0 1px #676879;
}

.handz-chatbot-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ececf1;
    padding: 12px 16px;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 200px;
    font-family: inherit;
}

.handz-chatbot-input::placeholder {
    color: #8e8ea0;
}

.handz-chatbot-send {
    background: var(--theme-color, #10a37f);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 4px;
    transition: all 0.2s;
}

.handz-chatbot-send:hover:not(:disabled) {
    background: var(--theme-color-dark, #0d8a6a);
}

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

.handz-chatbot-send svg {
    width: 20px;
    height: 20px;
}

/* === FLOATING BUTTON === */
.handz-chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--theme-color, #10a37f);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 999998;
}

.handz-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.handz-chatbot-toggle svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* === ERROR MESSAGE === */
.handz-error-message {
    background: #ef4444;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 14px;
}

/* === EMPTY STATE === */
.handz-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8e8ea0;
    text-align: center;
    padding: 40px;
}

.handz-empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.handz-empty-state h3 {
    color: #ececf1;
    font-size: 24px;
    margin: 0 0 8px 0;
}

.handz-empty-state p {
    font-size: 14px;
    max-width: 400px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .handz-chatbot-messages {
        padding: 16px;
    }
    
    .handz-chat-message {
        padding: 16px;
        gap: 12px;
    }
    
    .handz-chatbot-input-wrapper {
        padding: 16px;
    }
    
    .handz-chatbot-toggle {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .handz-chatbot-header {
        padding: 10px 16px;
    }
    
    .handz-chatbot-title {
        font-size: 14px;
    }
    
    .handz-chat-avatar {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* === ACCESSIBILITY === */
.handz-chatbot-container:focus-within {
    outline: none;
}

button:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--theme-color, #10a37f);
    outline-offset: 2px;
}

/* === ANIMATIONS === */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.handz-chatbot-container.active {
    animation: slideDown 0.3s ease;
}
