/* AR Experience Styles for Temporarily Closed NYC */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    background: #000;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #C94A36;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

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

.loading-content h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.loading-subtitle {
    font-size: 14px;
    color: #C94A36;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 24px;
}

.loading-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Scanning Instructions */
.scan-instructions {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.3s ease;
}

.scan-instructions.hidden {
    opacity: 0;
}

.scan-frame {
    width: 70%;
    max-width: 300px;
    aspect-ratio: 3/4;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {

    0%,
    100% {
        border-color: rgba(255, 255, 255, 0.3);
    }

    50% {
        border-color: rgba(201, 74, 54, 0.8);
    }
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #C94A36;
    border-style: solid;
}

.corner.top-left {
    top: -2px;
    left: -2px;
    border-width: 3px 0 0 3px;
    border-radius: 4px 0 0 0;
}

.corner.top-right {
    top: -2px;
    right: -2px;
    border-width: 3px 3px 0 0;
    border-radius: 0 4px 0 0;
}

.corner.bottom-left {
    bottom: -2px;
    left: -2px;
    border-width: 0 0 3px 3px;
    border-radius: 0 0 0 4px;
}

.corner.bottom-right {
    bottom: -2px;
    right: -2px;
    border-width: 0 3px 3px 0;
    border-radius: 0 0 4px 0;
}

.scan-text {
    margin-top: 24px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    animation: fade-pulse 2s ease-in-out infinite;
}

@keyframes fade-pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* AR Gallery - Full Screen Overlay */
.ar-gallery {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 250;
    background: linear-gradient(180deg, rgba(5, 5, 5, 0.97) 0%, rgba(10, 10, 10, 0.95) 100%);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.ar-gallery.visible {
    opacity: 1;
    visibility: visible;
}

.ar-gallery.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Gallery Header with Controls */
.ar-gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 16px 60px;
    /* Left padding for back button */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ar-gallery-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ar-gallery-header h3 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0;
}

.ar-gallery-header p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
}

.ar-gallery-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ar-gallery-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ar-gallery-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.ar-gallery-btn:active {
    transform: scale(0.95);
}

.ar-gallery-btn svg {
    width: 22px;
    height: 22px;
}

.ar-gallery-btn.camera-btn {
    background: rgba(201, 74, 54, 0.2);
    border-color: rgba(201, 74, 54, 0.4);
}

.ar-gallery-btn.camera-btn:hover {
    background: rgba(201, 74, 54, 0.35);
    border-color: rgba(201, 74, 54, 0.6);
}

/* Thumbnail Track */
.ar-gallery-thumbnails {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ar-gallery-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.ar-gallery-track::-webkit-scrollbar {
    display: none;
}

.ar-gallery-item {
    min-width: 72px;
    max-width: 72px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.ar-gallery-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.ar-gallery-item img {
    width: 100%;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 6px;
}

.ar-gallery-item span {
    display: block;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.ar-gallery-item.active {
    border-color: #C94A36;
    background: rgba(201, 74, 54, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(201, 74, 54, 0.3);
}

/* Main Photo Display */
.ar-gallery-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 0;
    overflow: hidden;
}

.ar-gallery-photo-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ar-gallery-photo-container img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    display: block;
}

.ar-gallery-photo-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
    border-radius: 0 0 16px 16px;
}

.ar-gallery-photo-label h2 {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ar-gallery-photo-label p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Footer Info Panel in Gallery */
.ar-gallery-footer {
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.ar-gallery-footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.ar-gallery-footer-text h4 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.ar-gallery-footer-text p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

.ar-gallery-learn-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #C94A36 0%, #a83c2b 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.ar-gallery-learn-btn:hover {
    background: linear-gradient(135deg, #d4564a 0%, #b84535 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201, 74, 54, 0.4);
}

/* Scan hint at bottom */
.ar-gallery-scan-hint {
    text-align: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    letter-spacing: 0.03em;
}

.ar-gallery-scan-hint span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Fullscreen toggle */
.ar-gallery-fullscreen-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.ar-gallery-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
}

.ar-gallery-fullscreen-btn svg {
    width: 18px;
    height: 18px;
}

/* Info Panel */
.info-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    z-index: 200;
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.info-panel.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.info-content h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.info-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.info-actions {
    display: flex;
    gap: 12px;
}

.info-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.info-btn:first-child {
    background: #C94A36;
    color: #fff;
}

.info-btn:first-child:hover {
    background: #a83c2b;
}

.info-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.close-info-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Target Found Indicator */
.target-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.target-indicator.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

.target-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Back Button */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Utility */
.hidden:not(.ar-gallery) {
    display: none !important;
}

/* Safe area adjustments for notched devices */
@supports (padding: env(safe-area-inset-top)) {
    .back-btn {
        top: calc(20px + env(safe-area-inset-top));
    }

    .target-indicator {
        top: calc(20px + env(safe-area-inset-top));
    }
}

/* HTTPS Error Message */
.https-error {
    text-align: center;
    padding: 20px;
    max-width: 340px;
}

.https-error .error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.https-error h1 {
    font-size: 24px;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.https-error .error-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 20px;
}

.https-error .error-solutions {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.https-error .error-solutions p {
    margin-bottom: 8px;
    color: #fff;
}

.https-error .error-solutions ul {
    list-style: none;
    padding: 0;
}

.https-error .error-solutions li {
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.https-error .error-solutions li::before {
    content: '→ ';
    color: #C94A36;
}

.https-error .error-solutions code {
    background: rgba(201, 74, 54, 0.2);
    color: #C94A36;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.https-error .back-link {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    background: #C94A36;
    border-radius: 25px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.https-error .back-link:hover {
    background: #a83c2b;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {

    /* Gallery mobile adjustments */
    .ar-gallery-header {
        padding: 12px 16px 12px 52px;
        /* Left padding for back button */
    }

    .ar-gallery-header h3 {
        font-size: 13px;
    }

    .ar-gallery-header p {
        font-size: 10px;
    }

    .ar-gallery-btn {
        width: 40px;
        height: 40px;
    }

    .ar-gallery-btn svg {
        width: 20px;
        height: 20px;
    }

    .ar-gallery-thumbnails {
        padding: 12px 16px;
    }

    .ar-gallery-item {
        min-width: 64px;
        max-width: 64px;
        padding: 5px;
    }

    .ar-gallery-item img {
        height: 40px;
    }

    .ar-gallery-item span {
        font-size: 8px;
    }

    .ar-gallery-main {
        padding: 16px;
    }

    .ar-gallery-photo-container img {
        max-height: 60vh;
    }

    .ar-gallery-photo-label {
        padding: 20px 16px 16px;
    }

    .ar-gallery-photo-label h2 {
        font-size: 18px;
    }

    .ar-gallery-photo-label p {
        font-size: 12px;
    }

    .ar-gallery-footer {
        padding: 12px 16px;
    }

    .ar-gallery-footer-text h4 {
        font-size: 14px;
    }

    .ar-gallery-footer-text p {
        font-size: 11px;
    }

    .ar-gallery-learn-btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .ar-gallery-scan-hint {
        padding: 8px 16px;
        font-size: 10px;
    }

    .loading-content h1 {
        font-size: 22px;
        letter-spacing: 1px;
    }

    .loading-subtitle {
        font-size: 12px;
        letter-spacing: 2px;
    }

    .scan-frame {
        width: 80%;
        max-width: 260px;
    }

    .scan-text {
        font-size: 13px;
        padding: 0 20px;
    }

    .info-panel {
        padding: 20px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .info-content h2 {
        font-size: 18px;
    }

    .info-content p {
        font-size: 13px;
    }

    .info-actions {
        flex-direction: column;
        gap: 10px;
    }

    .info-btn {
        padding: 16px 20px;
        font-size: 15px;
    }

    .back-btn {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .target-indicator {
        font-size: 11px;
        padding: 6px 12px;
    }

    .https-error {
        padding: 16px;
    }

    .https-error h1 {
        font-size: 20px;
    }

    .https-error .error-solutions {
        padding: 12px;
    }

    .https-error .error-solutions li {
        font-size: 12px;
    }
}

/* Landscape mode adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .ar-gallery {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .ar-gallery-header {
        width: 100%;
        padding: 8px 16px;
    }

    .ar-gallery-thumbnails {
        width: 30%;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        overflow-y: auto;
    }

    .ar-gallery-track {
        flex-direction: column;
    }

    .ar-gallery-main {
        width: 70%;
        padding: 12px;
    }

    .ar-gallery-photo-container img {
        max-height: 40vh;
    }

    .ar-gallery-footer {
        display: none;
    }

    .ar-gallery-scan-hint {
        display: none;
    }

    .scan-frame {
        width: 40%;
        max-width: 200px;
    }

    .scan-text {
        margin-top: 12px;
    }

    .info-panel {
        padding: 16px;
    }

    .info-actions {
        flex-direction: row;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {

    /* Prevent zoom on double-tap */
    body {
        touch-action: manipulation;
    }

    /* Better button tap targets for iOS */
    .back-btn,
    .info-btn,
    .close-info-btn {
        -webkit-tap-highlight-color: transparent;
    }
}