/* EniyiAjanslar AI Assistant Widget — beyaz + #1e40af */
.ea-ai-widget {
    --ea-ai-brand: #1e40af;
    --ea-ai-white: #ffffff;
    --ea-ai-shadow: 0 12px 48px rgba(30, 64, 175, 0.22), 0 4px 16px rgba(30, 64, 175, 0.08);
    --ea-ai-radius: 16px;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ea-ai-widget * {
    box-sizing: border-box;
}
/* reCAPTCHA rozetini sola al */
.grecaptcha-badge {
    left: 14px !important;
    right: auto !important;
    bottom: 14px !important;
}
/* Floating trigger button */
.ea-ai-trigger {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ea-ai-brand);
    color: var(--ea-ai-white);
    box-shadow: var(--ea-ai-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.2s;
    position: relative;
    z-index: 2;
}

.ea-ai-trigger:hover {
    transform: scale(1.06);
    box-shadow: 0 16px 56px rgba(30, 64, 175, 0.32), 0 6px 20px rgba(30, 64, 175, 0.12);
}

.ea-ai-trigger:active {
    transform: scale(0.98);
}

.ea-ai-trigger svg {
    width: 28px;
    height: 28px;
    transition: opacity 0.2s, transform 0.25s;
}

.ea-ai-trigger .ea-ai-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.ea-ai-widget.is-open .ea-ai-trigger {
    background: var(--ea-ai-white);
    color: var(--ea-ai-brand);
    border: 2px solid var(--ea-ai-brand);
}

.ea-ai-widget.is-open .ea-ai-trigger .ea-ai-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}

.ea-ai-widget.is-open .ea-ai-trigger .ea-ai-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* Pulse ring on closed state */
.ea-ai-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--ea-ai-brand);
    opacity: 0.3;
    animation: ea-ai-pulse 2.5s ease-out infinite;
    z-index: 1;
    pointer-events: none;
}

.ea-ai-widget.is-open .ea-ai-pulse {
    display: none;
}

@keyframes ea-ai-pulse {
    0% { transform: scale(1); opacity: 0.3; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* Chat panel */
.ea-ai-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 620px;
    max-height: calc(100vh - 120px);
    background: var(--ea-ai-white);
    border-radius: var(--ea-ai-radius);
    box-shadow: var(--ea-ai-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    border: 2px solid var(--ea-ai-brand);
}

.ea-ai-widget.is-open .ea-ai-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Panel header */
.ea-ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--ea-ai-brand);
    color: var(--ea-ai-white);
    flex-shrink: 0;
}

.ea-ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--ea-ai-white);
    color: var(--ea-ai-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ea-ai-avatar svg {
    width: 22px;
    height: 22px;
}

.ea-ai-header-text {
    flex: 1;
    min-width: 0;
}

.ea-ai-header-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ea-ai-white);
}

.ea-ai-header-text span {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
    color: var(--ea-ai-white);
}

.ea-ai-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ea-ai-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ea-ai-white);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.ea-ai-minimize {
    width: 32px;
    height: 32px;
    border: 2px solid var(--ea-ai-white);
    border-radius: 8px;
    background: transparent;
    color: var(--ea-ai-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.ea-ai-minimize:hover {
    background: var(--ea-ai-white);
    color: var(--ea-ai-brand);
}

.ea-ai-minimize svg {
    width: 18px;
    height: 18px;
}

/* iframe container */
.ea-ai-body {
    flex: 1;
    min-height: 0;
    position: relative;
    background: var(--ea-ai-white);
}

.ea-ai-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.ea-ai-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--ea-ai-brand);
    font-size: 14px;
    font-weight: 500;
    background: var(--ea-ai-white);
    transition: opacity 0.3s;
}

.ea-ai-loading.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.ea-ai-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(30, 64, 175, 0.2);
    border-top-color: var(--ea-ai-brand);
    border-radius: 50%;
    animation: ea-ai-spin 0.8s linear infinite;
}

@keyframes ea-ai-spin {
    to { transform: rotate(360deg); }
}

body.ea-ai-panel-open {
    overflow: hidden;
}

@media (min-width: 481px) {
    body.ea-ai-panel-open {
        overflow: auto;
    }
}

/* Tooltip label on trigger */
.ea-ai-label {
    position: absolute;
    right: 72px;
    bottom: 18px;
    background: var(--ea-ai-brand);
    color: var(--ea-ai-white);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    pointer-events: none;
    box-shadow: var(--ea-ai-shadow);
}

.ea-ai-label::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--ea-ai-brand);
}

.ea-ai-widget:not(.is-open):hover .ea-ai-label {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.ea-ai-widget.is-open .ea-ai-label {
    display: none;
}

/* Mobile */
@media (max-width: 480px) {
    .ea-ai-widget {
        right: 16px;
        bottom: 16px;
    }

    .ea-ai-panel {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border-width: 0;
        border-top: 2px solid var(--ea-ai-brand);
    }

    .ea-ai-widget.is-open .ea-ai-trigger {
        position: fixed;
        bottom: 16px;
        right: 16px;
        z-index: 100000;
    }

    .ea-ai-label {
        display: none;
    }
}
