.xai-contact-container {
    position: fixed;
    top: 20%;
    right: -350px;
    width: 350px;
    transition: right 0.3s ease;
    z-index: 1000;
}

.xai-contact-container.active {
    right: 0;
}

.xai-contact-toggle {
    position: absolute;
    left: -50px;
    top: 50%;
    transform: rotate(-90deg);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1);
    color: white;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    z-index: 1001; /* Ensure it stays above form */
}

.xai-contact-toggle:hover {
    transform: rotate(-90deg) translateY(-5px);
}

.xai-contact-form {
    background: linear-gradient(135deg, #6e8efb, #a777e3, #ff8c00);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    transform: perspective(1000px) rotateY(5deg);
    transition: transform 0.3s ease;
    display: none; /* Hidden by default */
}

.xai-contact-form.active {
    display: block; /* Show when active */
    position: fixed !important; /* Fixed position on mobile */
    top: 20% !important;
    right: 0 !important;
    width: 300px !important; /* Adjusted for mobile */
    max-width: 80% !important;
    z-index: 1000 !important; /* Isolated from page sections */
}

.xai-contact-form:hover {
    transform: perspective(1000px) rotateY(0deg);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    color: white;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.form-group input:hover,
.form-group textarea:hover {
    transform: translateY(-2px);
}

.xai-submit-btn {
    background: linear-gradient(45deg, #ff9966, #ff5e62, #00ff00);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transform: perspective(1000px) translateZ(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.xai-submit-btn:hover {
    transform: perspective(1000px) translateZ(10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.xai-success-message {
    margin: 10px 0;
    color: #00ff00;
    font-weight: bold;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    .xai-contact-container {
        position: fixed !important;
        top: 20% !important;
        right: -300px !important;
        width: 300px !important;
        max-width: 80% !important;
        display: block !important;
        margin: 0 !important;
        z-index: 1000 !important;
    }
    .xai-contact-container.active {
        right: 0 !important;
    }
    .xai-contact-toggle {
        display: block !important;
        position: absolute !important;
        right: -50px !important; /* Moved to right side for mobile */
        top: 50% !important;
        transform: rotate(90deg) !important; /* Adjusted rotation */
        margin: 0 !important;
        padding: 8px 15px !important;
        font-size: 20px !important;
        border-radius: 0 10px 10px 0 !important; /* Adjusted border radius */
        text-align: center !important;
        width: 40px !important;
        background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1) !important;
        color: white !important;
        cursor: pointer !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
    }
    .xai-contact-form.active {
        width: 300px !important;
        max-width: 80% !important;
    }
    /* Additional responsive adjustments */
    @media (max-width: 480px) {
        .xai-contact-container {
            width: 250px !important;
            right: -250px !important;
        }
        .xai-contact-form.active {
            width: 250px !important;
        }
        .xai-contact-toggle {
            font-size: 18px !important;
            padding: 6px 12px !important;
            width: 35px !important;
            right: -45px !important; /* Adjusted for smaller screen */
        }
    }
}