/* ========================================
   CHATBOT WIDGET - STYLES
   ======================================== */

/* Kontener widgetu */
.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Przycisk do góry strony */
.chatbot-scroll-top {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a4d2e 0%, #2d5a3d 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(26, 77, 46, 0.3);
    transition: all 0.3s ease;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.chatbot-scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.chatbot-scroll-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(26, 77, 46, 0.4);
}

.chatbot-scroll-top:active {
    transform: scale(0.95);
}

/* Przycisk otwarcia czatu */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a4d2e 0%, #2d5a3d 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(26, 77, 46, 0.3);
    transition: all 0.3s ease;
    z-index: 10001;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(26, 77, 46, 0.4);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-toggle.open {
    background: #c62828;
    transform: rotate(45deg);
}

/* Okno czatu */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 10000;
    overflow: hidden;
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header czatu */
.chatbot-header {
    background: linear-gradient(135deg, #1a4d2e 0%, #2d5a3d 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.chatbot-header h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    opacity: 0.8;
}

/* Treść czatu */
.chatbot-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8f9fa;
}

/* Wiadomości */
.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

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

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

.chat-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 0.95rem;
}

.chat-message.bot .chat-bubble {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.chat-message.user .chat-bubble {
    background: #1a4d2e;
    color: white;
    border-radius: 12px 4px 12px 12px;
}

/* FAQ karty w czacie */
.faq-card-widget {
    background: white;
    border-left: 4px solid #1a4d2e;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.faq-card-widget:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(-4px);
}

.faq-card-widget h4 {
    margin: 0 0 0.5rem 0;
    color: #1a4d2e;
    font-size: 0.95rem;
}

.faq-card-widget p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Formularz wiadomości */
.chatbot-form {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.chatbot-input:focus {
    outline: none;
    border-color: #1a4d2e;
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.1);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a4d2e;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.chatbot-send:hover {
    background: #2d5a3d;
    transform: scale(1.05);
}

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

.chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading state */
.chatbot-loading {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.chatbot-loading span {
    width: 8px;
    height: 8px;
    background: #1a4d2e;
    border-radius: 50%;
    animation: loading 1.4s infinite;
}

.chatbot-loading span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes loading {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Bez wiadomości */
.chatbot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
    color: #999;
}

.chatbot-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chatbot-empty-text {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Mobile responsywność */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .chatbot-window {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-bubble {
        max-width: 85%;
    }
    
    .chatbot-toggle {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }
    
    .chatbot-scroll-top {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* Scroll bar */
.chatbot-content::-webkit-scrollbar {
    width: 6px;
}

.chatbot-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.chatbot-content::-webkit-scrollbar-thumb {
    background: #1a4d2e;
    border-radius: 3px;
}

.chatbot-content::-webkit-scrollbar-thumb:hover {
    background: #2d5a3d;
}

/* Animation dla otwarcia/zamknięcia */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-window.active {
    animation: slideUp 0.3s ease;
}
