/* ═══════════════════════════════════════════════════════════════
   Service rotator — shared styles
   يستخدم على: services/index, services/development, services/training
   (home-services partial عنده نسخة inline لأسباب تاريخية)
   ═══════════════════════════════════════════════════════════════ */

.svc-rotator {
    position: relative; width: 100%; height: 100%;
    border-radius: 14px; overflow: hidden;
    background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.18), rgba(15,23,42,0.65));
    isolation: isolate;
}
.svc-variant {
    position: absolute; inset: 0;
    opacity: 0; transform: scale(.985);
    transition: opacity .4s ease, transform .4s ease;
    pointer-events: none;
}
.svc-variant--active { opacity: 1; transform: scale(1); pointer-events: auto; z-index: 1; }
.svc-variant--exit   { opacity: 0; transform: scale(1.015); z-index: 0; }

.svc-canvas { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; }
.svc-canvas--grid {
    background:
        radial-gradient(circle at 30% 30%, rgba(99,102,241,0.18), rgba(15,23,42,0.6)),
        radial-gradient(circle 1px at 14px 14px, rgba(165,180,252,0.15) 1px, transparent 1.5px) 0 0/18px 18px;
}
.svc-canvas--code  { background: linear-gradient(150deg, #0d0a1f, #1a1234); padding: 14px; }
.svc-canvas--light { background: linear-gradient(150deg, rgba(255,255,255,0.04), rgba(168,85,247,0.06)); padding: 14px; }

.svc-svg { width: 100%; height: 100%; display: block; }

.svc-dots {
    position: absolute; bottom: 8px; right: 10px; z-index: 5;
    display: flex; gap: 5px; padding: 5px 8px; border-radius: 999px;
    background: rgba(15,12,40,0.55); backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.svc-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(255,255,255,0.30); border: none; padding: 0; cursor: pointer;
    transition: width .2s, background .2s;
}
.svc-dot:hover { background: rgba(255,255,255,0.55); }
.svc-dot--active { width: 16px; border-radius: 3px; background: linear-gradient(90deg,#a5b4fc,#d946ef); }

/* ═══ B1 · Workflow builder ═══ */
@keyframes svc-flow-dash { to { stroke-dashoffset: -100; } }
.svc-flow { animation: svc-flow-dash 4.5s linear infinite; }

@keyframes svc-packet-lg-1 {
    0%   { transform: translate(75px, 105px); opacity: 0; }
    8%   { opacity: 1; }
    50%  { transform: translate(162px, 105px); opacity: 1; }
    51%  { transform: translate(212px, 105px); opacity: 0; }
    60%  { transform: translate(212px, 105px); opacity: 1; }
    99%  { transform: translate(282px, 55px); opacity: 1; }
    100% { transform: translate(282px, 55px); opacity: 0; }
}
@keyframes svc-packet-lg-2 {
    0%   { transform: translate(75px, 105px); opacity: 0; }
    8%   { opacity: 1; }
    50%  { transform: translate(162px, 105px); opacity: 1; }
    51%  { transform: translate(212px, 105px); opacity: 0; }
    60%  { transform: translate(212px, 105px); opacity: 1; }
    99%  { transform: translate(282px, 155px); opacity: 1; }
    100% { transform: translate(282px, 155px); opacity: 0; }
}
.svc-packet--lg-1 { animation: svc-packet-lg-1 3.4s linear infinite; }
.svc-packet--lg-2 { animation: svc-packet-lg-2 3.4s linear infinite 1.7s; }

.svc-node--center rect { filter: drop-shadow(0 0 8px rgba(168,85,247,0.45)); }

/* ═══ B2 · Live code ═══ */
.svc-code {
    width: 100%; height: 100%; border-radius: 10px; overflow: hidden;
    background: #0d0a1f; border: 1px solid rgba(165,180,252,0.20);
    display: flex; flex-direction: column;
    box-shadow: 0 10px 28px rgba(0,0,0,0.45), 0 0 0 1px rgba(168,85,247,0.10) inset;
}
.svc-code__bar {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; background: #1a1530;
    border-bottom: 1px solid rgba(165,180,252,0.12);
}
.svc-code__dot { width: 10px; height: 10px; border-radius: 50%; }
.svc-code__filename {
    margin-right: auto; color: #a0a0a8; font-size: 11.5px;
    font-family: 'Menlo', 'Monaco', monospace;
}
.svc-code__body {
    margin: 0; padding: 14px 16px; color: #e9d5ff;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 12.5px; line-height: 1.65;
    direction: ltr; text-align: left; white-space: pre;
    overflow: hidden;
}
.svc-c-kw  { color: #c084fc; font-weight: 700; }
.svc-c-cls { color: #38bdf8; }
.svc-c-var { color: #f9a8d4; }
.svc-c-str { color: #6ee7b7; }
.svc-c-ok  { color: #34d399; font-weight: 700; display: inline-block; margin-top: 6px; }

.svc-cursor {
    display: inline-block; width: 7px; height: 13px;
    background: #d946ef; vertical-align: -1px;
    animation: svc-blink 1.1s steps(2) infinite;
}
@keyframes svc-blink { 50% { opacity: 0; } }

/* ═══ B3 / shared pulse dots ═══ */
@keyframes svc-pulse {
    0%, 100% { transform: scale(1);   opacity: .95; }
    50%      { transform: scale(1.35); opacity: .55; }
}
.svc-pulse-dot { transform-origin: center; transform-box: fill-box; animation: svc-pulse 1.6s ease-in-out infinite; }

/* ═══ T1 · Cohort grid ═══ */
.svc-cohort {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    width: 100%; height: 100%;
    direction: rtl;
}
.svc-coh {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(168,85,247,0.18);
    border-radius: 10px; padding: 9px 11px;
    display: flex; flex-direction: column; justify-content: center;
}
.svc-coh__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.svc-coh__avatar {
    width: 28px; height: 28px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 13px;
    flex-shrink: 0;
}
.svc-coh__name { color: var(--text,#f5f5f7); font-size: 12.5px; font-weight: 700; }
.svc-coh__pct  { margin-right: auto; color: #a5b4fc; font-size: 11px; font-weight: 700; }
.svc-coh__bar  { height: 5px; background: rgba(165,180,252,0.15); border-radius: 999px; overflow: hidden; }
.svc-coh__bar span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, #6366f1, #d946ef);
    border-radius: 999px;
    animation: svc-bar-fill 1.4s ease-out forwards;
}
.svc-variant--active .svc-coh__bar span { width: var(--p); }
@keyframes svc-bar-fill { from { width: 0; } to { width: var(--p); } }

/* ═══ T2 · Syllabus ═══ */
.svc-syl {
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(168,85,247,0.18);
    border-radius: 12px; padding: 12px 14px;
    direction: rtl;
}
.svc-syl__head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 6px; margin-bottom: 6px;
    border-bottom: 1px solid rgba(168,85,247,0.18);
}
.svc-syl__title    { font-size: 13px; font-weight: 800; color: var(--text,#f5f5f7); }
.svc-syl__progress { font-size: 11.5px; color: #6ee7b7; font-weight: 700; }
.svc-syl__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.svc-syl__list li {
    display: grid; grid-template-columns: 64px 1fr 18px; align-items: center;
    gap: 8px; padding: 4px 0; font-size: 12px; color: #a0a0a8;
}
.svc-syl__week  { color: #6b7280; font-weight: 600; }
.svc-syl__topic { color: var(--text,#f5f5f7); }
.svc-syl__icon { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.is-done .svc-syl__icon { background: #10b981; color: #fff; font-weight: 800; }
.is-done .svc-syl__topic { color: #6ee7b7; }
.svc-syl__icon--ring {
    border: 2px solid #a855f7;
    box-shadow: 0 0 10px rgba(168,85,247,0.55);
    animation: svc-ring-pulse 1.6s ease-in-out infinite;
}
.svc-syl__icon--dot { background: rgba(165,180,252,0.20); }
@keyframes svc-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(168,85,247,0.55); }
    50%      { box-shadow: 0 0 0 5px rgba(168,85,247,0); }
}

/* ═══ C1 · Founder + slot ═══ */
.svc-canvas--consult-c1 {
    background: radial-gradient(circle at 50% 35%, rgba(168,85,247,0.35), rgba(15,12,40,0.85) 70%);
    padding: 14px;
}
.svc-founder {
    position: relative; width: 110px; height: 110px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.svc-founder__photo {
    width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
    border: 3px solid rgba(232,121,249,0.75);
    box-shadow: 0 0 28px rgba(232,121,249,0.55), 0 6px 18px rgba(0,0,0,0.35);
    position: relative; z-index: 2;
    animation: svc-float 4.5s ease-in-out infinite;
}
.svc-founder__ring,
.svc-founder__pulse {
    position: absolute; top: 50%; left: 50%; width: 116px; height: 116px;
    border-radius: 50%; border: 2px solid rgba(232,121,249,0.55);
    transform: translate(-50%, -50%); z-index: 1; pointer-events: none;
}
.svc-founder__ring  { animation: svc-ring 2.4s ease-out infinite; }
.svc-founder__pulse { animation: svc-ring 2.4s ease-out infinite 1.2s; }
@keyframes svc-ring {
    0%   { transform: translate(-50%, -50%) scale(0.85); opacity: .85; }
    100% { transform: translate(-50%, -50%) scale(1.55); opacity: 0; }
}
@keyframes svc-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

.svc-slot {
    margin-right: 18px;
    background: rgba(15,12,40,0.55);
    border: 1px solid rgba(232,121,249,0.35);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-radius: 14px; padding: 10px 14px;
    color: #fff; max-width: 220px;
}
.svc-slot__label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; color: #6ee7b7;
    margin-bottom: 5px;
}
.svc-slot__dot {
    width: 7px; height: 7px; border-radius: 50%; background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: svc-blink-dot 1.6s infinite;
}
@keyframes svc-blink-dot { 0%,100%{opacity:1} 50%{opacity:.35} }
.svc-slot__main {
    display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
    line-height: 1.3;
}
.svc-slot__day  { font-size: 13.5px; font-weight: 700; color: #e9d5ff; }
.svc-slot__date { font-size: 15px; font-weight: 800; color: #fff; }
.svc-slot__time { font-size: 12.5px; font-weight: 700; color: #a5b4fc; margin-right: auto; padding: 3px 9px; border-radius: 7px; background: rgba(99,102,241,0.22); }

/* ═══ C2 · Meet tiles ═══ */
.svc-canvas--consult-c2 {
    background: #0a0a0f; padding: 12px;
    flex-direction: column; align-items: stretch;
    gap: 8px;
}
.svc-meet {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    flex: 1; min-height: 0;
}
.svc-meet__tile {
    position: relative; border-radius: 12px; overflow: hidden;
    background: #1a1530;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid rgba(168,85,247,0.30);
}
.svc-meet__tile--you { background: linear-gradient(135deg, #6366f1, #a855f7); }
.svc-meet__img { width: 100%; height: 100%; object-fit: cover; }
.svc-meet__avatar {
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255,255,255,0.18); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 24px;
}
.svc-meet__chip {
    position: absolute; bottom: 6px; right: 6px;
    background: rgba(0,0,0,0.55); color: #fff;
    padding: 2px 8px; border-radius: 6px;
    font-size: 10.5px; font-weight: 700;
}
.svc-meet__rec {
    position: absolute; top: 7px; right: 7px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #ef4444; box-shadow: 0 0 8px #ef4444;
    animation: svc-blink-dot 1.4s infinite;
}
.svc-meet__ctrls {
    display: flex; justify-content: center; gap: 6px; padding-top: 2px;
}
.svc-meet__btn {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.10); color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.svc-meet__btn--accent { background: linear-gradient(135deg, #ec4899, #a855f7); }
.svc-meet__btn svg { width: 13px; height: 13px; }

/* ═══ C3 · Action plan ═══ */
.svc-plan {
    position: relative; width: 100%; height: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(168,85,247,0.20);
    border-radius: 12px; padding: 12px 14px;
    direction: rtl;
    box-shadow: 0 0 24px rgba(168,85,247,0.10) inset;
}
.svc-plan__head {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 6px; margin-bottom: 6px;
    border-bottom: 1px solid rgba(168,85,247,0.18);
}
.svc-plan__title { font-size: 13px; font-weight: 800; color: var(--text,#f5f5f7); }
.svc-plan__count {
    background: rgba(168,85,247,0.18); color: #d8b4fe;
    padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 700;
}
.svc-plan__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.svc-plan__list li {
    display: grid; grid-template-columns: 18px 1fr; align-items: center;
    gap: 8px; padding: 3px 0; font-size: 12.5px; color: var(--text,#f5f5f7);
}
.svc-plan__check {
    width: 15px; height: 15px; border-radius: 4px;
    border: 1.5px solid rgba(165,180,252,0.45);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; color: transparent;
}
.is-done .svc-plan__check { background: #10b981; border-color: #10b981; color: #fff; }
.is-done .svc-plan__text  { text-decoration: line-through; opacity: .55; }
.is-active .svc-plan__check {
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168,85,247,0.55);
    animation: svc-ring-pulse 1.6s ease-in-out infinite;
}
.svc-plan__sig {
    position: absolute; bottom: 8px; left: 10px;
    width: 70px; height: 16px; opacity: .55;
}

@media (prefers-reduced-motion: reduce) {
    .svc-variant { transition: none !important; }
    .svc-flow, .svc-packet--lg-1, .svc-packet--lg-2,
    .svc-cursor, .svc-pulse-dot, .svc-syl__icon--ring,
    .svc-plan__check, .svc-founder__photo, .svc-founder__ring, .svc-founder__pulse,
    .svc-meet__rec, .svc-slot__dot { animation: none !important; }
}
