:root {
    --assistant-fab-bottom: 1.25rem;
    --assistant-fab-stack: 5.35rem;
    --floating-actions-gap: 0.85rem;
}

.novademi-assistant {
    position: fixed;
    right: 1.25rem;
    bottom: var(--assistant-fab-bottom);
    z-index: 1040;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Yukarı çık butonu — asistanın üstünde sabit aralık */
.back-to-top {
    bottom: calc(var(--assistant-fab-bottom) + var(--assistant-fab-stack) + var(--floating-actions-gap));
    z-index: 1038;
}

.novademi-assistant__fab-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.novademi-assistant__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.55);
    animation: novademi-assistant-pulse 2.4s ease-out infinite;
    pointer-events: none;
}

.novademi-assistant__pulse--2 {
    animation-delay: 1.2s;
}

@keyframes novademi-assistant-pulse {
    0% {
        transform: scale(0.92);
        opacity: 0.85;
    }
    70% {
        transform: scale(1.45);
        opacity: 0;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

.novademi-assistant__fab {
    position: relative;
    z-index: 2;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: linear-gradient(145deg, #6366f1 0%, #7c3aed 48%, #4338ca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.25),
        0 0 28px rgba(124, 58, 237, 0.45),
        0 12px 32px rgba(79, 70, 229, 0.48),
        0 4px 14px rgba(124, 58, 237, 0.35);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    cursor: pointer;
    animation: novademi-assistant-float 3s ease-in-out infinite;
}

.novademi-assistant__fab::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #fbbf24,
        #a78bfa,
        #60a5fa,
        #c084fc,
        #fbbf24
    );
    z-index: 0;
    animation: novademi-assistant-ring-spin 4s linear infinite;
    opacity: 0.55;
}

.novademi-assistant__fab::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: linear-gradient(145deg, #6366f1 0%, #7c3aed 48%, #4338ca 100%);
    z-index: 0;
}

@keyframes novademi-assistant-ring-spin {
    to { transform: rotate(360deg); }
}

.novademi-assistant__fab:hover {
    animation: none;
    transform: scale(1.08) translateY(-2px);
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.35),
        0 0 36px rgba(124, 58, 237, 0.55),
        0 16px 40px rgba(79, 70, 229, 0.58),
        0 6px 18px rgba(124, 58, 237, 0.42);
}

.novademi-assistant__fab:focus-visible {
    outline: 3px solid #a78bfa;
    outline-offset: 3px;
}

@keyframes novademi-assistant-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.novademi-assistant__icon-svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.novademi-assistant__icon-orbit {
    transform-origin: 32px 32px;
    animation: novademi-assistant-orbit-spin 10s linear infinite;
}

@keyframes novademi-assistant-orbit-spin {
    to { transform: rotate(360deg); }
}

.novademi-assistant__icon-sparkles {
    transform-origin: 32px 24px;
    animation: novademi-assistant-sparkle-twinkle 2.2s ease-in-out infinite;
}

@keyframes novademi-assistant-sparkle-twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.72; transform: scale(0.94); }
}

.novademi-assistant__icon-dot--1 {
    transform-origin: 48px 40px;
    animation: novademi-assistant-dot-pulse 2.4s ease-in-out infinite;
}

.novademi-assistant__icon-dot--2 {
    transform-origin: 16px 38px;
    animation: novademi-assistant-dot-pulse 2.4s ease-in-out 1.1s infinite;
}

@keyframes novademi-assistant-dot-pulse {
    0%, 100% { opacity: 0.55; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.15); }
}

.novademi-assistant__fab-badge {
    position: absolute;
    right: -4px;
    bottom: -6px;
    z-index: 3;
    padding: 0.2rem 0.52rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 55%, #ea580c 100%);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.2;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.5);
    border: 2px solid #fff;
    white-space: nowrap;
    animation: novademi-assistant-badge-pop 2.8s ease-in-out infinite;
}

@keyframes novademi-assistant-badge-pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.novademi-assistant__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.85rem);
    width: min(360px, calc(100vw - 2rem));
    max-height: min(520px, calc(100vh - 8rem));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(148, 163, 184, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.novademi-assistant__panel[hidden],
.novademi-assistant[hidden] {
    display: none !important;
}

.novademi-assistant__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
    background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
    color: #fff;
}

.novademi-assistant__head-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.novademi-assistant__head-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.novademi-assistant__head strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.novademi-assistant__head small {
    display: block;
    margin-top: 0.2rem;
    opacity: 0.85;
    font-size: 0.78rem;
}

.novademi-assistant__close {
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.novademi-assistant__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: #f8fafc;
}

.novademi-assistant__msg {
    max-width: 92%;
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.novademi-assistant__msg--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

.novademi-assistant__msg--user {
    align-self: flex-end;
    background: #4f46e5;
    color: #fff;
}

.novademi-assistant__msg--error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.novademi-assistant__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.novademi-assistant__links a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    text-decoration: none;
    font-weight: 600;
}

.novademi-assistant__prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.9rem 0.55rem;
    background: #f8fafc;
}

.novademi-assistant__prompt {
    border: 1px solid #c7d2fe;
    background: #fff;
    color: #4338ca;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.72rem;
    cursor: pointer;
}

.novademi-assistant__compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    padding: 0.75rem 0.9rem;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.novademi-assistant__compose input {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.55rem 0.75rem;
    font-size: 0.86rem;
}

.novademi-assistant__compose button {
    border: 0;
    border-radius: 12px;
    width: 42px;
    background: #4f46e5;
    color: #fff;
    cursor: pointer;
}

.novademi-assistant__footer {
    padding: 0 0.9rem 0.75rem;
    background: #fff;
}

.novademi-assistant__wa {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #15803d;
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    :root {
        --assistant-fab-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
        --assistant-fab-stack: 4.65rem;
    }

    .novademi-assistant__fab {
        width: 60px;
        height: 60px;
    }

    .novademi-assistant__fab-wrap {
        width: 64px;
        height: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .novademi-assistant__fab,
    .novademi-assistant__fab::before,
    .novademi-assistant__pulse,
    .novademi-assistant__fab-badge,
    .novademi-assistant__icon-orbit,
    .novademi-assistant__icon-sparkles,
    .novademi-assistant__icon-dot--1,
    .novademi-assistant__icon-dot--2 {
        animation: none !important;
    }
}
