/* ============================================================
   G Teach — AI iconography (wave-2 task C)
   Унифицированный визуальный язык для AI-фич: сияющая звезда/
   голосовая волна/молния с indigo→fuchsia gradient + glow.
   Inspired by: Linear.app AI, Notion AI, Apple Intelligence.
   ============================================================ */

.gt-ai-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    vertical-align: middle;
    color: var(--gt-accent, #7B61FF);
    flex-shrink: 0;
}

/* Размеры (modifier) */
.gt-ai-icon--sm { width: 16px; height: 16px; }
.gt-ai-icon--md { width: 24px; height: 24px; }
.gt-ai-icon--lg { width: 32px; height: 32px; }
.gt-ai-icon--xl { width: 44px; height: 44px; }

.gt-ai-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    position: relative;
    z-index: 2;
}

/* Glow позади — только у крупных (lg/xl) */
.gt-ai-icon--lg::before,
.gt-ai-icon--xl::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(
        circle at center,
        rgba(123, 97, 255, 0.38) 0%,
        rgba(236, 72, 153, 0.18) 40%,
        transparent 70%
    );
    filter: blur(14px);
    z-index: 1;
    opacity: 0.9;
    pointer-events: none;
    transition: opacity 300ms ease;
}
.gt-ai-icon--xl::before {
    inset: -50%;
    filter: blur(20px);
}

/* Anim — лёгкий shimmer звезды (бесконечный, 4s, едва заметный) */
@keyframes gtAiShimmer {
    0%, 100% { transform: rotate(0deg) scale(1); filter: brightness(1); }
    50%      { transform: rotate(4deg) scale(1.06); filter: brightness(1.15); }
}
.gt-ai-icon--animated svg {
    animation: gtAiShimmer 4s ease-in-out infinite;
    transform-origin: center;
}

/* Hover — быстрый импульс (только у интерактивных родителей) */
a:hover .gt-ai-icon,
button:hover .gt-ai-icon,
.gt-ai-icon--hover-boost:hover {
    color: var(--gt-accent-hover, #6B51F0);
}
a:hover .gt-ai-icon--lg::before,
a:hover .gt-ai-icon--xl::before,
.gt-ai-icon--hover-boost:hover::before {
    opacity: 1;
    inset: -60%;
}

/* Inline-подача рядом с текстом (eyebrow, badge) */
.gt-ai-icon--inline {
    margin-right: 6px;
}

/* Размеры для static icon (без glow) */
.gt-ai-icon--sm svg,
.gt-ai-icon--md svg {
    color: inherit;
}

/* Gradient fill/stroke — применяется к <path> через url(#gt-ai-grad) в SVG */
/* Сами градиенты объявлены в <defs> внутри одного из SVG — общий defs
   глобально не поддерживается браузерами надёжно, поэтому каждый SVG
   хранит свой inline <defs>. */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .gt-ai-icon--animated svg {
        animation: none !important;
    }
    a:hover .gt-ai-icon--lg::before,
    a:hover .gt-ai-icon--xl::before,
    .gt-ai-icon--hover-boost:hover::before {
        inset: -40%;
    }
}

/* ============================================================
   Override внутри bento-карточек: убираем дефолтный .gt-bento__icon
   square-background, когда иконка помечена как AI — даём ей жить
   с glow на фоне карточки.
   ============================================================ */
.gt-bento__icon.gt-ai-icon--xl,
.gt-bento__icon.gt-ai-icon--lg {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
}
.gt-bento__icon.gt-ai-icon--xl {
    width: 52px !important;
    height: 52px !important;
}
.gt-bento__icon.gt-ai-icon--lg {
    width: 36px !important;
    height: 36px !important;
}

/* AI-badge в mockup — слегка крупнее и без рамки */
.gt-mockup__ai-badge.gt-ai-icon {
    background: transparent !important;
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    color: inherit !important;
}

/* Dark mode — glow ярче */
[data-theme="dark"] .gt-ai-icon--lg::before,
[data-theme="dark"] .gt-ai-icon--xl::before {
    background: radial-gradient(
        circle at center,
        rgba(159, 136, 255, 0.55) 0%,
        rgba(244, 114, 182, 0.28) 40%,
        transparent 70%
    );
}
