/* Germain Entrance Animation Styles */
#germain-entrance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent; /* remove pink/tinted overlay */
    backdrop-filter: none;    /* remove blur */
    z-index: 10000;
    display: block;           /* no centering; holder will position content */
    pointer-events: none;
}
#germain-entrance-overlay.active {
    pointer-events: all;
}

/* Holder positions the media bottom-right and hugs content size */
#germain-entrance-overlay .germain-entrance-holder {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: auto;
    height: auto;
    display: inline-block;
    z-index: 10001;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    line-height: 0;   /* eliminate inline-block baseline gap */
    font-size: 0;
}

/* The entrance media (GIF image) – use natural size, only scale down if too large */
#germain-entrance-video {
    width: auto;
    height: auto;
    max-width: min(40vw, 220px); /* responsive constraint */
    max-height: none;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
    animation: entranceZoom 0.5s ease-out;
    object-fit: contain;
    transform-origin: bottom right; /* shrink away from bottom-right */
    background: transparent;
    box-sizing: content-box;
    vertical-align: bottom;
}

/* Video fallback when no video files exist */
.video-fallback {
    display: none !important; /* keep hidden unless JS shows it */
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: min(40vw, 240px);
    height: auto;
    min-height: 120px;
    padding: 0;
    background: linear-gradient(135deg, #1e40af, #dc2626);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    animation: entranceZoom 0.5s ease-out;
    z-index: 10001;
    transform-origin: bottom right;
}
.fallback-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 120px;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 12px;
}

@keyframes entranceZoom {
    from { opacity: 0; transform: scale(0.7) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

#germain-skip-intro {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0;
    animation: skipButtonFadeIn 0.5s ease-out 2s forwards;
}
@keyframes skipButtonFadeIn { to { opacity: 1; } }
#germain-skip-intro:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #germain-entrance-overlay .germain-entrance-holder {
        bottom: 10px;
        right: 10px;
    }
    /* Only constrain GIF via max-width; do not force a fixed width */
    #germain-entrance-video {
        max-width: min(60vw, 180px);
        border-radius: 10px;
    }
    .video-fallback {
        width: min(40vw, 180px);
        border-radius: 10px;
    }
    .fallback-content {
        font-size: 16px;
        padding: 10px;
    }
    #germain-skip-intro {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* Entrance completion animation: shrink in place from bottom-right */
.germain-entrance-complete {
    animation: shrinkToCorner 1s ease-in-out forwards;
}
@keyframes shrinkToCorner {
    0%   { transform: scale(1);   opacity: 1; }
    100% { transform: scale(0.1); opacity: 0; }
}

/* Chatbot reveal animation */
#germain-chatbot-widget.entrance-reveal {
    animation: revealFromCorner 0.8s ease-out;
}
@keyframes revealFromCorner {
    from { opacity: 0; transform: scale(0.3) translate(50px, 50px); }
    to   { opacity: 1; transform: scale(1) translate(0, 0); }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #germain-entrance-overlay { background: transparent; }
    #germain-skip-intro { border: 2px solid white; }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #germain-entrance-video,
    .video-fallback,
    .germain-entrance-complete,
    #germain-chatbot-widget.entrance-reveal,
    germain-skip-intro {
        animation: none !important;
        transition: none !important;
    }
    #germain-entrance-overlay { backdrop-filter: none; }
}

/* Prefers reduced data - show simple fallback */
@media (prefers-reduced-data: reduce) {
    #germain-entrance-video { display: none; }
    .video-fallback { display: block !important; }
}

/* Ensure the GIF is visible on top and not hidden by theme styles */
#germain-entrance-overlay img#germain-entrance-video {
    display: block !important;
    opacity: 1 !important;
    position: relative;
    z-index: 10001;
}