/* Galilée Feedback Styles */

/* The main container */
.galilee-wrap {
    display: flex;
    align-items: flex-start;
    margin: 25px 0 15px 0;
    font-family: 'Courier New', Courier, monospace; /* Typewriter feel */
    position: relative;
    z-index: 100; /* Ensure it sits above background vectors */
    background: transparent;
}

/* Avatar Container */
.galilee-avatar {
    flex-shrink: 0;
    margin-right: 15px;
    width: 60px;
    height: 60px;
}

/* Avatar Image - Forced dimensions */
.galilee-avatar img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    object-fit: cover;
    background: #fff; /* Fallback if transparent png */
    display: block;
}

/* Chat Bubble */
.galilee-bubble {
    position: relative;
    background: #ffffff; /* Solid white to block background lines */
    border: 1px solid #dce4ec;
    border-radius: 15px;
    border-top-left-radius: 2px; /* Chat bubble style */
    padding: 18px 22px;
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    flex-grow: 1; /* Take remaining width */
    width: 100%;  /* Force width logic */
}

/* Loading Animation - Typing Ellipsis Only */
.galilee-loading {
    display: block;
    color: #888;
    font-size: 1.5em; /* Larger dots */
    min-height: 24px;
    line-height: 24px;
    font-weight: bold;
}

/* The element itself is empty, the dots are added by CSS */
.galilee-thinking::after {
    content: '.';
    animation: galilee-dots 1.5s steps(4, end) infinite;
}

@keyframes galilee-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* Typewriter Cursor */
.typing-active::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #3498db;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: galilee-blink 1s step-end infinite;
}

@keyframes galilee-blink {
    50% { opacity: 0; }
}

/* MathJax Spacing Fix */
.galilee-bubble .MathJax_Display {
    margin: 0.5em 0 !important;
}

/* Feedback Footer (Thumbs & Menu) */
.galilee-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    gap: 10px;
}

.galilee-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 2px 5px;
}

.galilee-btn:hover {
    opacity: 1;
}

.galilee-menu {
    position: relative;
}

.galilee-menu-content {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 150px;
    display: none;
    z-index: 10;
}

.galilee-menu-content.visible {
    display: block;
}

.opt-out-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 0.85em;
    color: #d9534f;
    cursor: pointer;
}

.opt-out-btn:hover {
    background: #f9f9f9;
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .galilee-wrap {
        margin: 15px 0 10px 0;
    }
    
    .galilee-avatar {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }
    
    .galilee-avatar img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .galilee-bubble {
        padding: 12px 15px;
        border-radius: 12px;
        border-top-left-radius: 2px;
        font-size: 0.95rem;
    }
}
