/* =============================================
   GSA Article Chat - Floating Button & Popup
   Unique prefix: gsa-artchat- to avoid conflicts
   ============================================= */

/* כפתור צף */
.gsa-artchat-floating-btn {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 999990;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border: none;
    border-radius: 60px;
    background: linear-gradient(135deg, #0f244b 0%, #1a3a6e 100%);
    color: #ffffff;
    font-family: 'David Libre', 'Frank Ruhl Libre', 'Noto Serif Hebrew', Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(66, 133, 244, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    line-height: 1;
}

.gsa-artchat-floating-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 10px 32px rgba(66, 133, 244, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gsa-artchat-floating-btn:active {
    transform: translateY(-1px) scale(1.01);
}

.gsa-artchat-floating-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.gsa-artchat-floating-btn-icon svg {
    width: 22px;
    height: 22px;
}

/* Pulse animation */
.gsa-artchat-floating-btn::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 60px;
    background: linear-gradient(135deg, #4285f4, #9b72cb, #d96570);
    opacity: 0;
    z-index: -1;
    animation: gsa-artchat-pulse 2.5s ease-in-out infinite;
}

@keyframes gsa-artchat-pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.08); }
}

/* שכבת רקע כהה */
.gsa-artchat-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999995;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gsa-artchat-overlay.gsa-artchat-visible {
    display: block;
    opacity: 1;
}

/* Popup container */
.gsa-artchat-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 999998;
    width: 92vw;
    height: 90vh;
    max-width: 900px;
    background: #131314;
    border: 1px solid #3c4043;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
}

.gsa-artchat-popup.gsa-artchat-visible {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* כפתור סגירה */
.gsa-artchat-close-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #3c4043;
    border-radius: 50%;
    background: #1e1f20;
    color: #8e918f;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.gsa-artchat-close-btn:hover {
    background: #2f2f2f;
    color: #ffffff;
    border-color: #5f6368;
}

/* Container של הצ'אט בתוך הpopup */
.gsa-artchat-popup #gemini-chat-container {
    width: 100%;
    height: 100%;
}

/* Override לגובה הצ'אט בתוך popup - שיתפוס את כל הגובה */
.gsa-artchat-popup #gemini-chat-container > div {
    height: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    margin-bottom: 0 !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .gsa-artchat-floating-btn {
        bottom: 18px;
        left: 18px;
        padding: 12px 18px;
        font-size: 13px;
        gap: 8px;
    }

    .gsa-artchat-floating-btn-icon {
        width: 22px;
        height: 22px;
    }

    .gsa-artchat-floating-btn-icon svg {
        width: 18px;
        height: 18px;
    }

    .gsa-artchat-popup {
        width: 98vw;
        height: 95vh;
        border-radius: 16px;
    }

    .gsa-artchat-close-btn {
        top: 10px;
        left: 10px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}