/* AR Experience Styles */

.ar-container {
    position: relative;
    width: 100vw;
    height: calc(100vh - 80px); /* Adjust for navbar */
    background-color: #000;
    overflow: hidden;
    margin-top: 80px; /* Push below navbar */
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

#ar-fallback-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    background-image: url('https://images.unsplash.com/photo-1499856871940-529f6990d5d5?ixlib=rb-4.0.3&auto=format&fit=crop&w=2057&q=80');
    background-size: cover;
    background-position: center;
    display: none;
}

.ar-ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to controls */
}

/* Scanner Overlay */
.scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.scanner-reticle {
    width: 250px;
    height: 250px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    position: relative;
    margin-bottom: 16px;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3); /* Darken surrounding area */
}

.scanner-reticle::before, .scanner-reticle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #fff;
    border-style: solid;
    transition: all 0.3s ease;
}

.scanner-reticle::before {
    top: -2px;
    left: -2px;
    border-width: 4px 0 0 4px;
}

.scanner-reticle::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 4px 4px 0;
}

.scanner-status {
    color: white;
    font-family: var(--font-mono);
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* AR Points of Interest */
.ar-point {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s ease;
    z-index: 20;
}

.ar-point-dot {
    width: 16px;
    height: 16px;
    background-color: var(--color-white);
    border: 3px solid var(--color-accent);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--color-accent);
    animation: ripple 2s infinite;
}

.ar-point-label {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 12px;
    color: var(--color-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ar-point:hover .ar-point-label {
    opacity: 1;
}

.ar-point:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 30;
}

/* Bottom Controls */
.ar-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ar-mode-selector {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 30px;
}

.ar-mode-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ar-mode-btn.active {
    background: var(--color-white);
    color: var(--color-primary);
}

.ar-info-card {
    background: var(--color-white);
    width: 100%;
    max-width: 400px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ar-info-card.hidden {
    transform: translateY(120%);
}

.ar-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.ar-card-header .tag {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

.close-card {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-secondary);
}

.ar-card-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.ar-action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: transparent;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.ar-action-btn.primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Permission Modal */
.permission-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.permission-modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
}

.icon-circle {
    width: 80px;
    height: 80px;
    background: var(--color-background);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
}

.modal-content h2 {
    margin-bottom: 12px;
    color: var(--color-primary);
}

.modal-content p {
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.modal-content button {
    width: 100%;
    margin-bottom: 12px;
}

@keyframes ripple {
    0% { box-shadow: 0 0 0 0 rgba(224, 122, 95, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(224, 122, 95, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 122, 95, 0); }
}

