/* =============================================
   AR / VR — js/tools/ar.js styling
   ============================================= */


/* ---------------------------------------------
   AR launch button (inside view dropdown,
   matches the slider-wrap row layout)
   --------------------------------------------- */

.ar-launch-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    flex-shrink: 0;
}

.ar-launch-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
    transform: scale(1.08);
}

.ar-btn-icon {
    width: 140%;
    height: 140%;
    object-fit: contain;
    /* Color overlay — turns the PNG into a white icon regardless of source colors */
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.ar-launch-btn:hover .ar-btn-icon {
    opacity: 1;
}


/* ---------------------------------------------
   AR modal overlay + panel
   --------------------------------------------- */

.ar-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ar-modal {
    background: var(--glass-bg-solid);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    width: 440px;
    max-width: 92vw;
    max-height: 92vh;
    overflow-y: auto;
    padding: 28px 28px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* Match the gh-browser-body scrollbar — thin, subtle, on-brand */
.ar-modal::-webkit-scrollbar { width: 6px; }
.ar-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

/* Top icon */
.ar-modal-icon-wrap {
    margin-bottom: 14px;
}

.ar-modal-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* Title */
.ar-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 14px;
    text-align: center;
}

/* Description */
.ar-modal-desc {
    width: 100%;
    margin-bottom: 18px;
}

.ar-modal-desc p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 10px;
    text-align: center;
}

.ar-modal-tips {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ar-modal-tips li {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    line-height: 1.5;
}

.ar-modal-tips li strong {
    color: var(--text);
    font-weight: 600;
}

.ar-modal-compat {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin: 0 !important;
    line-height: 1.5;
}


/* ---------------------------------------------
   QR code section (revealed after Share clicked)
   --------------------------------------------- */

.ar-qr-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

#arQRCanvas {
    background: #fff;
    padding: 8px;
    border-radius: 8px;
    line-height: 0;
}

#arQRCanvas canvas,
#arQRCanvas img {
    display: block;
    border-radius: 4px;
}

.ar-qr-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.ar-qr-link {
    flex: 1;
    min-width: 0;        /* allows flex item to shrink below content size */
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 8px;
    border-radius: 6px;
    /* Single line, truncate long share URLs with an ellipsis. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ---------------------------------------------
   Loading state
   --------------------------------------------- */

.ar-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
    width: 100%;
    justify-content: center;
}

.ar-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: ar-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes ar-spin { to { transform: rotate(360deg); } }


/* ---------------------------------------------
   Action buttons row (bottom of modal)
   --------------------------------------------- */

.ar-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    margin-top: 4px;
}

.ar-modal-right-actions {
    display: flex;
    gap: 8px;
}

.ar-action-btn {
    font-size: 12px;
    padding: 8px 14px;
}

.ar-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ar-cancel-btn {
    color: var(--text-muted) !important;
    background: transparent;
    border: 1px solid transparent;
}

.ar-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
}


