/* ==========================================================================
   Telkini v148 — كرة Telkini AI الجديدة (Emerald AI Orb)
   كرة زجاجية زمردية · نواة خضراء داكنة شفافة · نجمة ذكاء مضيئة في الوسط ·
   انعكاسات وعمق · حلقة رفيعة متوهجة · إضاءة خضراء محيطة.
   يعيد تلوين نفس عناصر الكرة الحالية (telkini-site.js) فلا تتغير المحادثة ولا الترحيب ولا الـ API.
   الحركة: transform / opacity / translate فقط، وتتوقف عند «تقليل الحركة».
   ========================================================================== */

/* الهالة المحيطة: تتنفس بهدوء */
.tk-orb::before {
  inset: -26% !important;
  background: radial-gradient(closest-side, rgba(52, 211, 153, .5), rgba(16, 185, 129, .2) 55%, rgba(16, 185, 129, 0) 100%) !important;
  animation: tko-breathe 4.2s ease-in-out infinite !important;
}
@keyframes tko-breathe { 0%, 100% { transform: scale(.88); opacity: calc(var(--tko-glow) * .8); } 50% { transform: scale(1.06); opacity: var(--tko-glow); } }

/* الكرة الزجاجية: نواة خضراء داكنة شفافة وحافة زمردية */
.tk-orb-fill {
  background:
    radial-gradient(circle at 50% 62%, rgba(16, 185, 129, .55) 0%, rgba(6, 95, 70, .25) 38%, rgba(6, 95, 70, 0) 62%),
    radial-gradient(circle at 50% 50%, #064e3b 0%, #053b2d 48%, #022c22 78%, #011a14 100%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(110, 231, 183, .45),
    inset 0 -7px 14px -2px rgba(52, 211, 153, .45),
    inset 0 5px 10px -3px rgba(255, 255, 255, .16),
    0 6px 18px -6px rgba(4, 120, 87, .7) !important;
}

/* تيارات الضوء الداخلية: زمردي وتركوازي، أخف وأكثر هدوءاً */
.tk-orb-fill i:nth-child(1) { background: radial-gradient(closest-side, rgba(16, 185, 129, .75) 0%, rgba(5, 150, 105, .35) 50%, rgba(5, 150, 105, 0) 100%) !important; }
.tk-orb-fill i:nth-child(2) { background: radial-gradient(closest-side, rgba(167, 243, 208, .55) 0%, rgba(110, 231, 183, .25) 50%, rgba(110, 231, 183, 0) 100%) !important; }
.tk-orb-fill i:nth-child(3) { background: radial-gradient(closest-side, rgba(4, 120, 87, .85) 0%, rgba(6, 78, 59, .45) 50%, rgba(6, 78, 59, 0) 100%) !important; }
.tk-orb-fill i:nth-child(4) { background: radial-gradient(closest-side, rgba(45, 212, 191, .45) 0%, rgba(45, 212, 191, .18) 50%, rgba(45, 212, 191, 0) 100%) !important; }

/* الشفق الدائر داخل الزجاج */
.tk-orb-spin::before {
  background: conic-gradient(from 20deg, rgba(52, 211, 153, 0) 0deg, rgba(110, 231, 183, .45) 55deg, rgba(52, 211, 153, 0) 115deg, rgba(52, 211, 153, 0) 185deg, rgba(45, 212, 191, .35) 240deg, rgba(52, 211, 153, 0) 295deg) !important;
  opacity: .6 !important;
}

/* نجمة الذكاء في المركز (ثابتة لا تدور مع النواة) */
.tk-orb-spin::after {
  content: ""; position: absolute; z-index: 1; inset: 27%; pointer-events: none;
  background: radial-gradient(circle, #ffffff 0%, #ecfdf5 28%, #a7f3d0 52%, rgba(52, 211, 153, .9) 72%, rgba(52, 211, 153, 0) 100%);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.9 7.2 16.8 11.1 24 12C16.8 12.9 12.9 16.8 12 24C11.1 16.8 7.2 12.9 0 12C7.2 11.1 11.1 7.2 12 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.9 7.2 16.8 11.1 24 12C16.8 12.9 12.9 16.8 12 24C11.1 16.8 7.2 12.9 0 12C7.2 11.1 11.1 7.2 12 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: tko-star 3.4s ease-in-out infinite;
}
@keyframes tko-star { 0%, 100% { transform: scale(.86) rotate(0deg); opacity: .82; } 50% { transform: scale(1.06) rotate(8deg); opacity: 1; } }
/* توهج ناعم خلف النجمة */
.tk-orb-fill::before {
  content: ""; position: absolute; z-index: 1; inset: 22%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(209, 250, 229, .55), rgba(52, 211, 153, .22) 55%, rgba(52, 211, 153, 0) 100%);
  animation: tko-core-glow 3.4s ease-in-out infinite;
}
@keyframes tko-core-glow { 0%, 100% { transform: scale(.85); opacity: .6; } 50% { transform: scale(1.15); opacity: 1; } }

/* الانعكاسات: لمعة علوية + خط ضوء منحنٍ + حافة سفلية مضيئة */
.tk-orb-fill::after {
  background:
    radial-gradient(ellipse 34% 22% at 34% 22%, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle at 70% 78%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 18%),
    radial-gradient(circle at 50% 50%, rgba(1, 26, 20, 0) 60%, rgba(1, 26, 20, .35) 84%, rgba(110, 231, 183, .55) 100%) !important;
}

/* تفاعل */
.tkc-launcher:hover .tk-orb, .tkc-launcher:focus-visible .tk-orb, .ask-ai-btn:hover .tk-orb, .ask-ai-btn:focus-visible .tk-orb { --tko-glow: 1.15; }
.tkc-launcher:hover .tk-orb-spin::after, .ask-ai-btn:hover .tk-orb-spin::after { animation-duration: 1.8s; }
.tkc-logo-head.is-thinking .tk-orb-spin::after { animation-duration: 1.1s; }

/* ---------- الزر العائم: حلقة رفيعة متوهجة + طفو هادئ ---------- */
.tkc-ring, html.dark .tkc-ring {
  inset: -4px !important;
  background: radial-gradient(circle at 50% 35%, rgba(236, 253, 245, .5), rgba(236, 253, 245, 0) 70%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(52, 211, 153, .45),
    0 0 16px -2px rgba(16, 185, 129, .45),
    0 12px 30px -10px rgba(5, 150, 105, .65) !important;
}
html.dark .tkc-ring { background: radial-gradient(circle at 50% 35%, rgba(16, 185, 129, .12), rgba(16, 185, 129, 0) 70%) !important; }
.tkc-ring::before, html.dark .tkc-ring::before {
  background: conic-gradient(from 0deg, rgba(110, 231, 183, 0) 0deg, rgba(110, 231, 183, 0) 70deg, #34d399 170deg, #ecfdf5 215deg, rgba(110, 231, 183, 0) 275deg, rgba(110, 231, 183, 0) 360deg) !important;
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 1.6px), #000 calc(100% - 1.2px)) !important;
          mask: radial-gradient(closest-side, transparent calc(100% - 1.6px), #000 calc(100% - 1.2px)) !important;
  animation-duration: 6s !important;
}
.tkc-launcher:hover .tkc-ring, .tkc-launcher:focus-visible .tkc-ring, .tkc-launcher.tkc-greeting .tkc-ring,
html.dark .tkc-launcher:hover .tkc-ring, html.dark .tkc-launcher:focus-visible .tkc-ring, html.dark .tkc-launcher.tkc-greeting .tkc-ring {
  background: radial-gradient(circle at 50% 35%, rgba(236, 253, 245, .65), rgba(236, 253, 245, 0) 70%) !important;
  box-shadow:
    inset 0 0 0 1.5px rgba(52, 211, 153, .7),
    0 0 26px 0 rgba(16, 185, 129, .6),
    0 14px 34px -10px rgba(5, 150, 105, .75) !important;
}
html.dark .tkc-launcher:hover .tkc-ring, html.dark .tkc-launcher.tkc-greeting .tkc-ring { background: radial-gradient(circle at 50% 35%, rgba(16, 185, 129, .2), rgba(16, 185, 129, 0) 70%) !important; }

/* طفو هادئ (خاصية translate منفصلة عن transform فلا تتعارض مع حركات المرور/الإخفاء) */
.tkc-launcher:not(.tkc-hidden) { animation: tko-float 5.5s ease-in-out infinite; }
@keyframes tko-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.tkc-launcher:hover { transform: translateY(-2px) scale(1.08) !important; }
.tkc-launcher:active { transform: scale(.94) !important; }
/* نبضة الفتح عند الضغط */
.tkc-launcher:active .tkc-ring::after { animation: tko-open .5s ease-out; }
@keyframes tko-open { from { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } to { box-shadow: 0 0 0 16px rgba(52, 211, 153, 0); } }

/* الجيروسكوب عند الترحيب: ألوان زمردية */
.tk-orb-gyro b:nth-child(1) { --tk-c: #34d399 !important; }
.tk-orb-gyro b:nth-child(2) { --tk-c: #065f46 !important; }
html.dark .tk-orb-gyro b:nth-child(2) { --tk-c: #a7f3d0 !important; }
.tk-orb-shock { border-color: #34d399 !important; }

@media (hover: none) { .tkc-launcher:hover { transform: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .tkc-launcher, .tk-orb-spin::after, .tk-orb-fill::before { animation: none !important; }
}
