/* ========================================
   WHATSAPP CHAT WIDGET STYLES
   ======================================== */

/* Demo Page Styles */
.chat-demo-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d0f0e 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-demo-container {
    text-align: center;
    color: #fff;
    padding: 40px;
}

.chat-demo-container h1 {
    font-family: 'Agrandir', 'Open Sans', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.chat-demo-container p {
    font-family: 'Open Sans', sans-serif;
    color: #ccc;
    font-size: 1.1rem;
}

/* Chat Widget Container */
.whatsapp-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 99999;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Floating Button */
.whatsapp-float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8D2424 0%, #A71D2A 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(141, 36, 36, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: pulse 2s infinite;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(141, 36, 36, 0.6);
}

.whatsapp-float-btn__badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 22px;
    background: #fff;
    color: #8D2424;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(141, 36, 36, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(141, 36, 36, 0.7), 0 0 0 15px rgba(141, 36, 36, 0);
    }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 150px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.chat-window.open {
    display: flex;
}

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

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #8D2424 0%, #A71D2A 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header__avatar {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.chat-header__avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    padding: 3px;
}

.chat-header__status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #4ade80;
    border: 2px solid #8D2424;
    border-radius: 50%;
}

.chat-header__info {
    flex: 1;
}

.chat-header__name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 2px 0;
}

.chat-header__subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin: 0;
}

.chat-header__close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-header__close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Chat Body */
.chat-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.chat-body__background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9c4bc' fill-opacity='0.2'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 1;
}

.chat-messages {
    position: relative;
    z-index: 1;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Bubbles */
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    animation: messageIn 0.3s ease-out;
    word-wrap: break-word;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message--bot {
    background: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: #0E000A;
}

.chat-message--bot::before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 0;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #fff;
    border-left: 0;
    border-bottom: 0;
}

.chat-message--user {
    background: linear-gradient(135deg, #8D2424 0%, #A71D2A 100%);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message--user::after {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 0;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #A71D2A;
    border-right: 0;
    border-bottom: 0;
}

.chat-message__text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 6px 0;
    color: inherit;
}

.chat-message__time {
    font-size: 11px;
    opacity: 0.7;
    text-align: right;
    margin: 0;
}

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

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

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

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        background: #999;
    }

    30% {
        transform: translateY(-6px);
        background: #8D2424;
    }
}

/* Chat Input Area */
.chat-input-area {
    background: #f0f0f0;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
}

.chat-input-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: box-shadow 0.2s ease;
}

.chat-input:focus {
    box-shadow: 0 0 0 2px rgba(141, 36, 36, 0.3);
}

.chat-input::placeholder {
    color: #999;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8D2424 0%, #A71D2A 100%);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(141, 36, 36, 0.4);
}

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

/* WhatsApp Redirect Button */
.chat-whatsapp-redirect {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    border-radius: 8px;
}

.chat-whatsapp-redirect:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.chat-whatsapp-redirect i {
    margin-right: 8px;
}

/* Hidden state for input when showing redirect */
.chat-input-area.hidden {
    display: none;
}

/* Interest Selection Buttons */
.chat-interest-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
    animation: messageIn 0.3s ease-out;
}

.chat-interest-btn {
    padding: 14px 20px;
    background: #fff;
    border: 2px solid #8D2424;
    border-radius: 12px;
    color: #8D2424;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-interest-btn:hover {
    background: linear-gradient(135deg, #8D2424 0%, #A71D2A 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(141, 36, 36, 0.3);
}

.chat-interest-btn:active {
    transform: translateY(0);
}

/* Responsive - Mobile Fullscreen */
@media (max-width: 768px) {
    .whatsapp-chat-widget {
        bottom: 90px;
        right: 20px;
    }

    .whatsapp-float-btn {
        width: 56px;
        height: 56px;
        font-size: 26px;
    }

    /* Fullscreen chat on mobile */
    .chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 100000;
    }

    .chat-header {
        padding: 16px 20px;
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
    }

    .chat-header__avatar {
        width: 44px;
        height: 44px;
    }

    .chat-header__name {
        font-size: 17px;
    }

    .chat-header__subtitle {
        font-size: 13px;
    }

    .chat-body {
        flex: 1;
    }

    .chat-messages {
        padding: 20px;
        padding-bottom: 10px;
    }

    .chat-message {
        max-width: 85%;
    }

    .chat-message__text {
        font-size: 15px;
        line-height: 1.6;
    }

    .chat-input-area {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .chat-input {
        padding: 14px 18px;
        font-size: 16px;
    }

    .chat-send-btn {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .chat-whatsapp-redirect {
        padding: 16px 24px;
        font-size: 15px;
    }
}