/* LDD Chatbot Widget - Liquid Glassmorphism 2026 */

:root {
    --ldd-primary: #445ea3;
    --ldd-primary-dark: #35467a;
    --ldd-primary-light: #5a6fb8;
    --ldd-glass-bg: rgba(255, 255, 255, 0.65);
    --ldd-glass-border: rgba(255, 255, 255, 0.4);
    --ldd-glass-shadow: 0 8px 32px rgba(68, 94, 163, 0.12);
    --ldd-glass-blur: 20px;
}

#ldd-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Popup offer-property musi być nad chatbotem (chatbot ma z-index 9999) */
.popup-out {
    z-index: 100001 !important;
}

/* Floating Button - Glassmorphism */
#ldd-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ldd-primary) 0%, var(--ldd-primary-dark) 100%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(68, 94, 163, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#ldd-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(68, 94, 163, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

#ldd-chatbot-button:hover svg {
    transform: scale(1.05);
}

#ldd-chatbot-button svg {
    transition: transform 0.2s ease;
}

/* Chat Window - Liquid Glass */
#ldd-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--ldd-glass-bg);
    backdrop-filter: blur(var(--ldd-glass-blur));
    -webkit-backdrop-filter: blur(var(--ldd-glass-blur));
    border-radius: 20px;
    border: 1px solid var(--ldd-glass-border);
    box-shadow: var(--ldd-glass-shadow), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatWindowOpen 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatWindowOpen {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header - Subtle gradient glass */
#ldd-chatbot-header {
    background: linear-gradient(135deg, var(--ldd-primary) 0%, var(--ldd-primary-dark) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#ldd-chatbot-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: white;
    letter-spacing: -0.02em;
}

#ldd-chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s ease;
}

#ldd-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Messages Area - Light glass */
#ldd-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 360px;
    background: rgba(255, 255, 255, 0.3);
}

#ldd-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#ldd-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#ldd-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(68, 94, 163, 0.2);
    border-radius: 10px;
}

#ldd-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(68, 94, 163, 0.35);
}

.ldd-chatbot-message {
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 14px;
    animation: messageSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.user-message {
    text-align: right;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--ldd-primary) 0%, var(--ldd-primary-dark) 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 16px 16px 4px 16px;
    display: inline-block;
    max-width: 85%;
    box-shadow: 0 2px 8px rgba(68, 94, 163, 0.25);
}

.bot-message .message-content {
    background: rgba(255, 255, 255, 0.8);
    color: #2d3748;
    padding: 12px 16px;
    border-radius: 16px 16px 16px 4px;
    display: inline-block;
    max-width: 85%;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: var(--ldd-primary);
    border-radius: 50%;
    opacity: 0.6;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    30% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Contact Form */
#ldd-chatbot-contact-form {
    background: rgba(255, 255, 255, 0.5);
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
}

.contact-form-content p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #2d3748;
}

#ldd-contact-email {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(68, 94, 163, 0.2);
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.8);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#ldd-contact-email:focus {
    outline: none;
    border-color: var(--ldd-primary);
    box-shadow: 0 0 0 3px rgba(68, 94, 163, 0.15);
}

#ldd-contact-submit, #ldd-contact-cancel {
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s ease;
}

#ldd-contact-submit {
    background: linear-gradient(135deg, var(--ldd-primary) 0%, var(--ldd-primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(68, 94, 163, 0.3);
}

#ldd-contact-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(68, 94, 163, 0.35);
}

#ldd-contact-cancel {
    background: rgba(255, 255, 255, 0.8);
    color: #4a5568;
    border: 1px solid rgba(68, 94, 163, 0.2);
}

#ldd-contact-cancel:hover {
    background: rgba(255, 255, 255, 0.95);
}

/* Input Area - Glass */
#ldd-chatbot-input-area {
    display: flex;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    gap: 10px;
}

#ldd-chatbot-input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid rgba(68, 94, 163, 0.2);
    border-radius: 14px;
    font-size: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#ldd-chatbot-input:focus {
    border-color: var(--ldd-primary);
    box-shadow: 0 0 0 3px rgba(68, 94, 163, 0.15);
}

#ldd-chatbot-input::placeholder {
    color: #a0aec0;
}

#ldd-chatbot-send {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ldd-primary) 0%, var(--ldd-primary-dark) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(68, 94, 163, 0.3);
}

#ldd-chatbot-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(68, 94, 163, 0.35);
}

#ldd-chatbot-send:disabled {
    background: #cbd5e0;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #ldd-chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    #ldd-chatbot-window {
        width: calc(100vw - 20px);
        max-width: 340px;
        height: 480px;
        bottom: 70px;
    }
    
    #ldd-chatbot-button {
        width: 54px;
        height: 54px;
    }
    
    #ldd-chatbot-header {
        padding: 14px 16px;
    }
    
    #ldd-chatbot-header h4 {
        font-size: 14px;
    }
    
    #ldd-chatbot-messages {
        padding: 16px;
        max-height: 320px;
    }
    
    .ldd-chatbot-message {
        font-size: 13px;
    }
    
    #ldd-chatbot-input-area {
        padding: 12px 16px;
    }
}

/* Link Buttons */
.ldd-link-button {
    display: inline-block;
    margin: 5px 5px 5px 0;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--ldd-primary) 0%, var(--ldd-primary-dark) 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(68, 94, 163, 0.3);
    border: none;
    cursor: pointer;
}

.ldd-link-button:hover {
    background: linear-gradient(135deg, var(--ldd-primary-light) 0%, var(--ldd-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 94, 163, 0.4);
    color: white !important;
    text-decoration: none !important;
}

.ldd-link-button:active {
    transform: translateY(0);
}

.ldd-link-button .link-icon {
    margin-right: 5px;
    font-size: 14px;
}

/* Quick Questions */
.ldd-quick-questions {
    margin: 15px 0;
    padding: 0;
}

.ldd-quick-questions p {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
}

.ldd-quick-btn {
    display: block;
    width: 100%;
    margin: 6px 0;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(68, 94, 163, 0.2);
    border-radius: 12px;
    color: var(--ldd-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.ldd-quick-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--ldd-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(68, 94, 163, 0.15);
}

.ldd-quick-btn:active {
    transform: translateY(0);
}

@media (max-width: 350px) {
    #ldd-chatbot-window {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
    }
}

/* Property Cards - UX layout: nazwa → zdjęcie → cena → przycisk */
.ldd-property-card-placeholder {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    font-size: 12px;
    color: #4a5568;
    border: 1px solid rgba(68, 94, 163, 0.15);
}

.ldd-property-card {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(68, 94, 163, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.ldd-property-card__header {
    padding: 12px 14px 8px;
    border-bottom: 1px solid rgba(68, 94, 163, 0.08);
}

.ldd-property-card__title {
    font-weight: 600;
    font-size: 14px;
    color: #1a202c;
    margin: 0;
    line-height: 1.3;
}

.ldd-property-card__img {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: rgba(68, 94, 163, 0.06);
}

.ldd-property-card__body {
    padding: 12px 14px;
}

.ldd-property-card__cena {
    font-size: 15px;
    font-weight: 700;
    color: var(--ldd-primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.ldd-property-card__btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--ldd-primary) 0%, var(--ldd-primary-dark) 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(68, 94, 163, 0.3);
    text-align: center;
}

.ldd-property-card__btn:hover {
    background: linear-gradient(135deg, var(--ldd-primary-light) 0%, var(--ldd-primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(68, 94, 163, 0.35);
    color: white !important;
    text-decoration: none !important;
}

.ldd-property-card-error {
    font-size: 12px;
    color: #a0aec0;
}
