 

.chat-container {
    position: fixed;
    bottom: 8rem;
    right: 1rem;
    width: 320px;
    height: 590px;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 15;
    transform: scale(0);
    opacity: 0;
    transform-origin: bottom right;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chat-container.open {
    transform: scale(1);
    opacity: 1;
}

.chat-header {
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.chat-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.chat-header button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.3s ease, background-color 0.2s ease;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#closeChatButton:hover {
    transform: rotate(90deg);
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-header-buttons button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-header button:active {
    opacity: 0.7;
}

.chat-content {
    flex: 1;
    overflow: hidden;
}

.chat-content iframe {
    border: none;
    height: 100%;
    width: 100%;
}

body.dark-mode .chat-container {
    background-color: #1f2937;
    color: #e5e7eb;
}

body.dark-mode .chat-header {
    background: linear-gradient(135deg, #1E40AF, #6D28D9);
    color: #f9fafb;
}

body.dark-mode .chat-input {
    border-top: 1px solid #374151;
}

@media (max-width: 768px) {
    #openPopupButton {
        display: none;
    }

    .chat-container {
        bottom: 4rem;
        width: 95vw;
        max-width: 400px;
        height: 80vh;
        max-height: 690px;
        right: 0.75rem;
    }
    .chat-container.open {
        width: 90vw;
        max-width: 350px;
        height: 70vh;
        max-height: 590px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        bottom: 4rem;
        width: 95vw;
        max-width: 320px;
        height: 85vh;
        max-height: 740px;
        right: 0.5rem;
    }

    .chat-header h3 {
        font-size: 0.9rem;
        letter-spacing: 0.3px;
    }
}

@media (max-width: 360px) {
    .chat-container {
        bottom: 4rem;
        width: 95vw;
        max-width: 300px;
        height: 90vh;
        max-height: 790px;
        right: 0.5rem;
    }

    .chat-header h3 {
        font-size: 0.9rem;
        letter-spacing: 0.2px;
    }
}

@media (max-height: 700px) {
    .chat-container {
        height: 75vh;
        max-height: 490px;
    }
}

@media (max-height: 600px) {
    .chat-container {
        height: 80vh;
        max-height: 440px;
    }
}

@media (max-width: 480px) and (orientation: portrait) {
    .chat-container {
        bottom: 4rem;
    }
}

@media (min-width: 1024px) {
    .chat-container {
        bottom: 60%;
        right: 50%;
        transform: translate(50%, 50%) scale(0);
        width: 600px;
        height: 440px;
        transform-origin: center;
    }

    .chat-container.open {
        transform: translate(50%, 50%) scale(1);
    }

    .chat-content {
        display: flex;
        justify-content: center;
    }

    .chat-content iframe {
        width: 100%;
    }
}
