/**
 * AMV Menu - Orbit Widget (frontend)
 * Геометрия и стили 1 в 1 из vtop-smm.html (первый блок — орбита категорий)
 */

.amv-orbit-widget {
    --amv-orbit-center-size: 110px;
    --amv-orbit-center-content-scale: 1;
    --amv-orbit-icon-size: 52px;
    --amv-orbit-satellite-icon-size: 42px;
    --amv-orbit-text-color: #1e1e1e;
    --amv-orbit-ring-color: rgba(29, 161, 243, 0.28);
    --amv-orbit-dropdown-width: 200px;
}

/* Обёртка как в макете: 720px, высота 560px */
.amv-orbit-wrap {
    position: relative;
    width: 100%;
    max-width: 720px;
    height: 560px;
    margin: 0 auto;
}

/* Кольца орбит — точные размеры из vtop-smm.html */
.amv-orbit-rings {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Кольца — линия орбиты; цвет задаётся в настройках (по умолчанию хорошо видимый) */
.amv-orbit-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--amv-orbit-ring-color);
    /* fallback если переменная не подставилась */
    border-color: var(--amv-orbit-ring-color, rgba(29, 161, 243, 0.28));
}

.amv-orbit-ring-inner  { width: 40%; height: 40%; }
.amv-orbit-ring-middle { width: 68%; height: 68%; }
.amv-orbit-ring-outer  { width: 92%; height: 92%; }

/* Центр — как в макете: градиент и тени */
.amv-orbit-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: var(--amv-orbit-center-size);
    height: var(--amv-orbit-center-size);
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff 0%, #e8f4fc 100%);
    box-shadow: 0 0 0 8px rgba(29, 161, 243, 0.06),
                0 0 0 20px rgba(29, 161, 243, 0.03),
                0 12px 40px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 2;
    overflow: hidden;
}

/* Размер изображения/надписи задаётся переменной --amv-orbit-center-content-scale (0.3–1, по умолчанию 1) */
.amv-orbit-center img {
    width: calc(100% * var(--amv-orbit-center-content-scale, 1));
    height: calc(100% * var(--amv-orbit-center-content-scale, 1));
    object-fit: contain;
}

/* Текст в центре (как в vtop-smm: логотип с акцентом); масштаб от той же переменной */
.amv-orbit-center-text {
    font-weight: 800;
    font-size: calc(15px * var(--amv-orbit-center-content-scale, 1));
    letter-spacing: -0.5px;
    text-align: center;
    line-height: 1.2;
    padding: calc(8px * var(--amv-orbit-center-content-scale, 1));
    max-width: calc(100% * var(--amv-orbit-center-content-scale, 1));
}
.amv-orbit-center-text .amv-orbit-center-accent {
    /* цвет задаётся инлайном из настроек */
}

/* Элемент на орбите — как .constellation-item */
.amv-orbit-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease;
    z-index: 1;
}

.amv-orbit-item:hover {
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 200;
}

.amv-orbit-item-link {
    text-decoration: none;
    color: var(--amv-orbit-text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Иконка — как .sphere-icon: 52px, белый фон, обводка */
.amv-orbit-item-icon {
    width: var(--amv-orbit-icon-size);
    height: var(--amv-orbit-icon-size);
    border-radius: 50%;
    background: #fff !important;
    border: 1px solid rgba(29, 161, 243, 0.25);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.amv-orbit-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.amv-orbit-item-letter {
    font-weight: 700;
    font-size: 1em;
    color: #2271b1;
}

.amv-orbit-item:hover .amv-orbit-item-icon {
    box-shadow: 0 6px 20px rgba(29, 161, 243, 0.18);
    border-color: rgba(29, 161, 243, 0.45);
}

/* Спутники в углах — меньший размер как в макете */
.amv-orbit-item-satellite .amv-orbit-item-icon {
    width: var(--amv-orbit-satellite-icon-size);
    height: var(--amv-orbit-satellite-icon-size);
    font-size: calc(var(--amv-orbit-satellite-icon-size) * 0.42);
    opacity: 0.85;
}

.amv-orbit-item-satellite .amv-orbit-item-label {
    font-size: 8px;
}

/* Подпись — как .sphere-label */
.amv-orbit-item-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--amv-orbit-text-color);
    text-align: center;
    max-width: 60px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Выпадающее меню с подкатегориями — поверх всех иконок орбиты */
.amv-orbit-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: var(--amv-orbit-dropdown-width);
    max-width: 90vw;
    background: #fff;
    z-index: 300;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 8px 0;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.amv-orbit-item:hover .amv-orbit-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
    pointer-events: auto;
}

.amv-orbit-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.amv-orbit-dropdown li {
    margin: 0;
}

.amv-orbit-dropdown a {
    display: block;
    padding: 8px 14px;
    color: #1e1e1e;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
}

.amv-orbit-dropdown a:hover {
    background: rgba(29, 161, 243, 0.08);
    color: #2271b1;
}

/* === КНОПКА "ВСЕ КАТЕГОРИИ" для Orbit === */
.amv-orbit-widget .amv-all-categories-btn .amv-all-btn-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--amv-all-btn-size, 8px) * 0.6);
    width: var(--amv-orbit-icon-size, 52px);
    height: var(--amv-orbit-icon-size, 52px);
    border-radius: 50%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.amv-orbit-widget .amv-all-btn-dots .amv-dot {
    width: var(--amv-all-btn-size, 8px);
    height: var(--amv-all-btn-size, 8px);
    border-radius: 50%;
    background-color: var(--amv-all-btn-color, #666666);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.amv-orbit-widget .amv-all-categories-btn:hover .amv-all-btn-dots {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.amv-orbit-widget .amv-all-categories-btn:hover .amv-dot {
    background-color: #1da1f3;
}

.amv-orbit-widget .amv-all-categories-btn:hover .amv-dot:nth-child(1) {
    animation: orbitDotPulse 0.6s ease infinite;
}

.amv-orbit-widget .amv-all-categories-btn:hover .amv-dot:nth-child(2) {
    animation: orbitDotPulse 0.6s ease infinite 0.1s;
}

.amv-orbit-widget .amv-all-categories-btn:hover .amv-dot:nth-child(3) {
    animation: orbitDotPulse 0.6s ease infinite 0.2s;
}

@keyframes orbitDotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

/* Адаптив — как в vtop-smm.html */
@media (max-width: 1024px) {
    .amv-orbit-wrap {
        height: 460px;
        max-width: 560px;
    }
    .amv-orbit-item-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .amv-orbit-item-satellite .amv-orbit-item-icon {
        width: calc(var(--amv-orbit-satellite-icon-size) * 0.86);
        height: calc(var(--amv-orbit-satellite-icon-size) * 0.86);
        font-size: calc(var(--amv-orbit-satellite-icon-size) * 0.36);
    }
    .amv-orbit-item-label {
        font-size: 8px;
    }
    .amv-orbit-center {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 768px) {
    .amv-orbit-wrap {
        height: 400px;
        max-width: 100%;
    }
    .amv-orbit-item-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .amv-orbit-item-satellite .amv-orbit-item-icon {
        width: calc(var(--amv-orbit-satellite-icon-size) * 0.76);
        height: calc(var(--amv-orbit-satellite-icon-size) * 0.76);
        font-size: calc(var(--amv-orbit-satellite-icon-size) * 0.33);
    }
    .amv-orbit-item-label {
        font-size: 7px;
        max-width: 48px;
    }
    .amv-orbit-center {
        width: 72px;
        height: 72px;
    }
}
