/**
 * ExpoXR Visitor Animation Toggles v3
 * Clean, elegant pill-style toggle with no text - pure visual design
 * Version: 3.0.0
 */

.expoxr-vtoggle * {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
    box-sizing: border-box;
}

/* ── Single toggle wrapper ── */
.expoxr-vtoggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* ── Optional label next to toggle ── */
.expoxr-vtoggle-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
    line-height: 1;
}

/* ── Row for combined shortcode ── */
.expoxr-vtoggle-row {
    display: inline-flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Toggle button container (pill shape) ── */
.expoxr-btn {
    position: relative;
    width: 56px;
    height: 32px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

/* ── Invisible checkbox overlay ── */
.expoxr-checkbox {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* ── Background gradient layer ── */
.expoxr-btn-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 14px;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* ── Knob container ── */
.expoxr-knob {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    pointer-events: none;
}

/* ── Sliding knob circle ── */
.expoxr-knob span {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.25),
        0 1px 3px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Inner glow dot (subtle indicator) ── */
.expoxr-knob span::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(128, 98, 170, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── CHECKED STATE (ON) ── */
.expoxr-checkbox:checked ~ .expoxr-btn-bg {
    background: linear-gradient(135deg, #2AACE2 0%, #8062AA 100%);
    box-shadow: 
        0 0 20px rgba(42, 172, 226, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.expoxr-checkbox:checked ~ .expoxr-knob span {
    left: 28px;
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.3),
        0 1px 4px rgba(0, 0, 0, 0.2);
}

.expoxr-checkbox:checked ~ .expoxr-knob span::before {
    background: rgba(42, 172, 226, 0.6);
    box-shadow: 0 0 8px rgba(42, 172, 226, 0.8);
}

.expoxr-checkbox:checked + .expoxr-btn {
    border-color: rgba(42, 172, 226, 0.4);
}

/* ── HOVER STATES ── */
.expoxr-btn:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

.expoxr-checkbox:checked + .expoxr-btn:hover {
    border-color: rgba(42, 172, 226, 0.6);
}

.expoxr-checkbox:checked + .expoxr-btn:hover ~ .expoxr-btn-bg {
    box-shadow: 
        0 0 30px rgba(42, 172, 226, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

/* ── ACTIVE/PRESSED STATE ── */
.expoxr-checkbox:active ~ .expoxr-knob span {
    width: 24px;
}

.expoxr-checkbox:checked:active ~ .expoxr-knob span {
    left: 24px;
}

/* ── FOCUS VISIBLE (keyboard navigation) ── */
.expoxr-checkbox:focus-visible + .expoxr-btn {
    outline: 2px solid rgba(42, 172, 226, 0.6);
    outline-offset: 2px;
}

/* ── DISABLED STATE ── */
.expoxr-checkbox:disabled + .expoxr-btn {
    opacity: 0.4;
    cursor: not-allowed;
}

.expoxr-checkbox:disabled {
    cursor: not-allowed;
}

/* ── RESPONSIVE: Larger touch targets on mobile ── */
@media (max-width: 768px) {
    .expoxr-btn {
        width: 60px;
        height: 36px;
        border-radius: 18px;
    }
    
    .expoxr-knob span {
        width: 24px;
        height: 24px;
        top: 4px;
        left: 4px;
    }
    
    .expoxr-checkbox:checked ~ .expoxr-knob span {
        left: 28px;
    }
    
    .expoxr-checkbox:checked:active ~ .expoxr-knob span {
        left: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .expoxr-btn-bg,
    .expoxr-knob,
    .expoxr-knob span {
        transition: none !important;
    }
}
