/**
 * Custom styles for the Ghost sprite in the corner
 * Version: 1.0.0
 */

@media (min-width: 769px) {
    /* Enlarged ghost sprite in bottom corner */
    .ghost-chat-trigger {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 60px !important;
        height: 60px !important;
        background-color: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 999998;
        transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }

    /* Move the ghost sprite to the left when chat is open */
    .ghost-chat-container.is-open ~ .ghost-chat-trigger,
    .ghost-chat-container.is-open + .ghost-chat-trigger,
    .is-open ~ .ghost-chat-trigger {
        right: 380px !important; /* Move left to make room for chat */
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Ensure ghost icon is blue and bigger */
    .ghost-chat-trigger svg {
        width: 60px !important;
        height: 60px !important;
        fill: #4877EF !important;
        stroke: none !important;
    }

    /* Add floating animation */
    .ghost-chat-trigger {
        animation: float-sprite 4s ease-in-out infinite;
    }

    @keyframes float-sprite {
        0%, 100% { transform: translateY(-5px); }
        50% { transform: translateY(5px); }
    }

    /* Hover effect */
    .ghost-chat-trigger:hover {
        transform: scale(1.1) translateY(-5px);
    }
    
    /* Override any existing ghost svg styling */
    .ghost-chat-trigger svg path {
        fill: #4877EF !important;
    }
    
    /* Make sure the toggle button stays visible when chat is open */
    .ghost-chat-container.is-open + #ghost-chat-toggle,
    .ghost-chat-container.is-open ~ #ghost-chat-toggle,
    .is-open ~ #ghost-chat-toggle,
    #ghost-chat-toggle.is-open {
        right: 360px !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
        z-index: 999999;
    }
    
    /* Make sure toggle follows the chat when closing */
    .ghost-chat-container:not(.is-open) ~ #ghost-chat-toggle,
    .ghost-chat-container:not(.is-open) + #ghost-chat-toggle,
    #ghost-chat-toggle:not(.is-open) {
        right: 0 !important;
        transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }
    
    /* Style the chat title area */
    .ghost-chat-header {
        display: flex;
        align-items: center;
        padding: 12px 16px;
    }
    
    /* Ensure ghost icon in title is properly displayed */
    .chat-title-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        margin-right: 12px;
    }
    
    .chat-title-icon svg {
        width: 100%;
        height: 100%;
    }
    
    /* Style the ghost-chat-title for better layout */
    .ghost-chat-title {
        display: flex;
        align-items: center;
    }
}
