/* Base-2 Canvas - Radial Pie Menu Styles */

.radial-menu {
    position: fixed;
    transform: translate(-50%, -50%);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.radial-menu.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Center cancel button */
.radial-center {
    position: absolute;
    width: 80px;
    height: 80px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    z-index: 10;
}

.radial-center:hover {
    background: #ff4444;
    border-color: #ff4444;
    transform: translate(-50%, -50%) scale(1.1);
}

.radial-center:hover .radial-center-icon {
    color: white;
}

.radial-center:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.radial-center-icon {
    font-size: 24px;
    color: var(--text-secondary);
    font-weight: bold;
    transition: color 0.15s;
}

/* Cancel button below center */
.radial-cancel-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, 55px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    z-index: 15;
}

.radial-cancel-btn:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: white;
}

/* Menu item container */
.radial-item {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.radial-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Slice SVG */
.radial-slice {
    position: absolute;
    width: 360px;
    height: 360px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    overflow: visible;
    pointer-events: none;
}

.radial-slice-bg {
    fill: var(--bg-secondary);
    stroke: var(--border-color);
    stroke-width: 1;
    opacity: 0.95;
    transition: fill 0.15s, transform 0.15s;
    pointer-events: auto;
    cursor: pointer;
}

.radial-item.hover .radial-slice-bg,
.radial-item:hover .radial-slice-bg {
    fill: var(--accent-primary);
    transform: scale(1.02);
    transform-origin: center;
}

.radial-item.disabled .radial-slice-bg {
    fill: var(--bg-tertiary);
    cursor: not-allowed;
}

/* Label */
.radial-label {
    position: absolute;
    left: 50%;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
    transition: transform 0.1s;
    z-index: 5;
}

.radial-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.3px;
}

.radial-shortcut {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 3px;
    opacity: 0.8;
}

.radial-item.hover .radial-text,
.radial-item:hover .radial-text {
    color: white;
}

.radial-item.hover .radial-shortcut,
.radial-item:hover .radial-shortcut {
    color: rgba(255, 255, 255, 0.7);
}

/* Animation */
@keyframes radial-menu-appear {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.radial-menu.visible {
    animation: radial-menu-appear 0.15s ease-out forwards;
}

/* Slice animation */
.radial-menu.visible .radial-item {
    opacity: 0;
    animation: radial-item-appear 0.2s ease-out forwards;
}

@keyframes radial-item-appear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.radial-menu.visible .radial-item:nth-child(2) { animation-delay: 0.02s; }
.radial-menu.visible .radial-item:nth-child(3) { animation-delay: 0.04s; }
.radial-menu.visible .radial-item:nth-child(4) { animation-delay: 0.06s; }
.radial-menu.visible .radial-item:nth-child(5) { animation-delay: 0.08s; }
.radial-menu.visible .radial-item:nth-child(6) { animation-delay: 0.10s; }
.radial-menu.visible .radial-item:nth-child(7) { animation-delay: 0.12s; }
.radial-menu.visible .radial-item:nth-child(8) { animation-delay: 0.14s; }

/* Touch device adjustments */
@media (pointer: coarse) {
    .radial-menu {
        --radius: 140px;
        --inner-radius: 50px;
    }

    .radial-center {
        width: 80px;
        height: 80px;
    }

    .radial-center-icon {
        font-size: 28px;
    }

    .radial-icon {
        font-size: 24px;
    }

    .radial-text {
        font-size: 13px;
    }
}
