/* bubbles.css - Fixed version for proper image display */

/* Bubble Container - Fixed positioning */
.bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 2; /* Above SVG but below contact button */
}

/* AI Bubble Styles */
.ai-bubble {
    position: fixed; /* Changed from absolute to fixed */
    bottom: -250px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-align: center;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    animation: floatUp var(--duration, 20s) ease-in-out forwards;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 -10px 30px rgba(255, 255, 255, 0.2),
        inset 0 10px 30px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

/* Bubble glow effect */
.ai-bubble::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 30%;
    height: 30%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(10px);
    z-index: 2;
    pointer-events: none;
}

/* AI Generated Image - Fixed to be circular */
.bubble-image {
    width: 70%;
    height: 70%;
    border-radius: 50% !important; /* Force circular */
    object-fit: cover;
    object-position: center;
    margin-bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    display: block; /* Ensure it's a block element */
    flex-shrink: 0; /* Prevent shrinking */
}

/* Loading state for images */
.bubble-image.loading {
    background: rgba(255, 255, 255, 0.1);
    animation: imagePulse 1.5s ease-in-out infinite;
}

@keyframes imagePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Fallback icon (hidden when image loads) */
.bubble-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: iconPulse 3s ease-in-out infinite;
    z-index: 0;
    opacity: 0.3;
}

/* Hide icon when image is loaded */
.ai-bubble.image-loaded .bubble-icon {
    display: none;
}

/* Bubble Title */
.bubble-title {
    font-size: 0.9em;
    font-weight: 700;
    margin-bottom: 3px;
    margin-top: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 2;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
}

/* Bubble Description */
.bubble-description {
    font-size: 0.75em;
    opacity: 0.9;
    line-height: 1.3;
    max-width: 85%;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 2;
    padding: 0 5px;
}

/* Float Up Animation */
@keyframes floatUp {
    0% {
        bottom: -250px;
        opacity: 0;
        transform: translateX(0) scale(0.8) rotate(0deg);
    }
    10% {
        opacity: 1;
        transform: translateX(calc(var(--drift, 0px) * 0.1)) scale(1) rotate(5deg);
    }
    30% {
        transform: translateX(calc(var(--drift, 0px) * 0.3)) scale(1.05) rotate(-5deg);
    }
    50% {
        transform: translateX(calc(var(--drift, 0px) * 0.5)) scale(1) rotate(3deg);
    }
    70% {
        transform: translateX(calc(var(--drift, 0px) * 0.7)) scale(1.02) rotate(-3deg);
    }
    90% {
        opacity: 1;
        transform: translateX(calc(var(--drift, 0px) * 0.9)) scale(0.98) rotate(2deg);
    }
    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(var(--drift, 0px)) scale(0.9) rotate(0deg);
    }
}

/* Icon Pulse Animation */
@keyframes iconPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Hover Effects */
.ai-bubble:hover {
    transform: scale(1.1);
    animation-play-state: paused;
}

.ai-bubble:hover .bubble-image {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Ensure SVG container stays in place */
svg {
    position: relative;
    z-index: 1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .ai-bubble {
        font-size: 0.85em;
    }
    
    .bubble-image {
        width: 65%;
        height: 65%;
    }
    
    .bubble-icon {
        font-size: 2.5em;
    }
    
    .bubble-title {
        font-size: 0.85em;
    }
    
    .bubble-description {
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .ai-bubble {
        min-width: 120px;
        min-height: 120px;
        max-width: 180px;
        max-height: 180px;
    }
    
    .bubble-description {
        display: none;
    }
    
    .bubble-image {
        width: 60%;
        height: 60%;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ai-bubble {
        animation: simpleFloat var(--duration, 20s) ease-in-out forwards;
    }
    
    @keyframes simpleFloat {
        0% {
            bottom: -250px;
            opacity: 0;
        }
        10% {
            opacity: 1;
        }
        90% {
            opacity: 1;
        }
        100% {
            bottom: 110%;
            opacity: 0;
        }
    }
    
    .bubble-icon,
    .bubble-image {
        animation: none;
    }
}

/* Ensure proper stacking */
.container {
    position: relative;
    z-index: 0;
}

.contact-button {
    z-index: 1000 !important;
}

.modal {
    z-index: 1001 !important;
}