/**
 * Artmatter AR Room Viewer & Desktop QR Code Experience
 */

/* ==========================================================================
   Desktop QR Modal Styles (Light Luxury Theme)
   ========================================================================== */
.premium-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
}

.premium-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.premium-modal-content {
    background: #ffffff;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    padding: 36px 32px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #111111;
    box-sizing: border-box;
}

.premium-modal-overlay.open .premium-modal-content {
    transform: translateY(0) scale(1);
}

.premium-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333333;
    transition: background 0.2s, transform 0.2s;
}

.premium-close-btn:hover {
    background: rgba(0, 0, 0, 0.10);
    transform: scale(1.05);
}

.premium-qr-header {
    text-align: center;
    margin-bottom: 28px;
}

.premium-qr-header h3 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
    color: #111111;
    letter-spacing: -0.02em;
}

.premium-qr-header p {
    margin: 0;
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
}

.premium-qr-wrapper {
    background: #f9f9fa;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 28px;
    min-height: 220px;
}

.premium-qr-wrapper canvas,
.premium-qr-wrapper img {
    border-radius: 8px;
    max-width: 100%;
}

.premium-qr-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.premium-qr-footer .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    font-size: 12px;
    color: #555555;
    font-weight: 500;
    flex: 1;
}

.premium-qr-footer .step-num {
    width: 28px;
    height: 28px;
    background: #111111;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Mobile AR Camera Overlay & Stage
   ========================================================================== */
.ar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999999;
    background: #000000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.ar-overlay.active {
    visibility: visible;
    opacity: 1;
}

.camera-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.ar-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    overflow: hidden;
    touch-action: none;
    perspective: 1200px;
}

.poster-ar-element {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    max-width: 340px;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    transform-style: preserve-3d;
    will-change: transform;
}

.poster-ar-element img {
    width: 100%;
    height: auto;
    display: block;
    border: none !important;
    outline: none !important;
    border-radius: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), 0 1.5px 3px rgba(0, 0, 0, 0.35);
}

/* Top UI Bar */
.ar-ui-top {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    right: 20px;
    z-index: 5;
    display: flex;
    align-items: center;
}

.ar-btn-glass {
    background: rgba(14, 14, 18, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.ar-btn-glass:active {
    transform: scale(0.94);
    background: rgba(24, 24, 30, 0.9);
}

/* Instructions */
.ar-instructions {
    position: absolute;
    bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ar-instructions-box {
    background: rgba(12, 12, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 9px 20px;
    border-radius: 50px;
    font-family: -apple-system, sans-serif;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Bottom Control Dock */
.ar-ui-bottom {
    position: absolute;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: 92%;
    max-width: 380px;
}

.ar-bottom-dock {
    background: rgba(14, 14, 18, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 14px 18px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.ar-sliders {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ar-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ar-slider-label {
    color: #e4e4e7;
    font-family: -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 500;
    width: 42px;
    text-align: left;
    opacity: 0.9;
}

.ar-sliders input[type=range] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.18);
    height: 4px;
    border-radius: 4px;
    outline: none;
}

.ar-sliders input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #a9ff5d;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.ar-sliders input[type=range]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #a9ff5d;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.ar-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.ar-btn-capture {
    background: #ffffff;
    color: #111111;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.ar-btn-capture:active {
    transform: scale(0.92);
    background: #a9ff5d;
}

/* Trigger Button Component */
.artmatter-ar-btn,
.view-in-your-room-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(18, 18, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    padding: 8px 16px;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.artmatter-ar-btn:hover,
.view-in-your-room-btn:hover {
    background: rgba(28, 28, 34, 0.95);
    border-color: #a9ff5d;
    color: #a9ff5d;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(169, 255, 93, 0.15);
}

.artmatter-ar-btn svg,
.view-in-your-room-btn svg {
    color: #a9ff5d;
    flex-shrink: 0;
}
