/**
 * ACC Panorama Viewer - Premium Styles
 */

/* Container */
.pano-container {
    position: relative;
    width: 100%;
    height: 450px;
    min-height: 300px;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.pano-container canvas {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    cursor: grab;
    touch-action: none;
}

.pano-container canvas:active {
    cursor: grabbing;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .pano-container {
        height: 300px;
        min-height: 250px;
        border-radius: 12px;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 480px) {
    .pano-container {
        height: 250px;
        min-height: 200px;
    }
}

/* Fullscreen */
.pano-container.pano-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    z-index: 99999 !important;
    background: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
}

.pano-container.pano-fullscreen canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
}

/* Fullscreen landscape mode indicator */
.pano-orientation-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 101;
    display: none;
}

.pano-container.pano-fullscreen .pano-orientation-btn {
    display: flex;
}

.pano-orientation-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.pano-orientation-toggle svg {
    width: 20px;
    height: 20px;
}

.pano-orientation-toggle:hover,
.pano-orientation-toggle.active {
    background: rgba(201, 169, 98, 0.3);
    color: #fff;
}

/* Force landscape mode */
.pano-container.pano-fullscreen.pano-landscape {
    transform: rotate(90deg);
    transform-origin: center center;
    width: 100vh !important;
    height: 100vw !important;
    max-width: 100vh !important;
    max-height: 100vw !important;
    top: 50% !important;
    left: 50% !important;
    margin-top: calc(-50vw) !important;
    margin-left: calc(-50vh) !important;
}

.pano-container.pano-fullscreen.pano-landscape .pano-controls {
    transform: translateX(-50%) rotate(-90deg);
    bottom: auto;
    top: 20px;
    left: 50%;
}

.pano-container.pano-fullscreen.pano-landscape .pano-orientation-btn {
    transform: rotate(-90deg);
    top: auto;
    bottom: 20px;
    right: 20px;
}

/* Controls */
.pano-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.pano-controls-inner {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pano-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

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

.pano-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pano-btn.active {
    background: #c9a962;
    color: #1a1a2e;
}

.pano-btn.active:hover {
    background: #d4b978;
}

/* Loader */
.pano-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    z-index: 200;
    transition: opacity 0.3s ease;
}

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

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

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

.pano-loader-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.pano-loader-progress {
    font-size: 0.875rem;
    color: #c9a962;
    font-weight: 600;
}

/* Error */
.pano-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    z-index: 200;
}

.pano-error-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.pano-error-content svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: #ef4444;
}

.pano-error-content p {
    font-size: 1rem;
}

/* Hint */
.pano-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9375rem;
    font-weight: 500;
    z-index: 50;
    pointer-events: none;
    animation: pano-pulse 2s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.pano-hint svg {
    width: 20px;
    height: 20px;
    color: #c9a962;
}

@keyframes pano-pulse {
    0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.98); }
}

/* External Link Style */
.pano-external-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 400px;
    text-decoration: none;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    transition: all 0.4s ease;
}

.pano-external-link:hover {
    transform: scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.pano-external-content {
    text-align: center;
    padding: 3rem;
}

.pano-external-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #c9a962, #b8944d);
    border-radius: 50%;
    font-size: 2.5rem;
    color: #1a1a2e;
    box-shadow: 0 15px 40px rgba(201, 169, 98, 0.4);
    animation: pano-float 3s ease-in-out infinite;
}

@keyframes pano-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pano-external-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.pano-external-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.pano-external-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #c9a962;
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.pano-external-link:hover .pano-external-btn {
    background: #d4b978;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(201, 169, 98, 0.4);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .pano-container {
        height: 400px;
        border-radius: 16px;
    }
    
    .pano-external-content {
        padding: 2rem;
    }
    
    .pano-external-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .pano-external-content h3 {
        font-size: 1.5rem;
    }
    
    .pano-external-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
    
    .pano-controls {
        bottom: 16px;
    }
    
    .pano-controls-inner {
        padding: 6px;
        gap: 4px;
    }
    
    .pano-btn {
        width: 40px;
        height: 40px;
    }
    
    .pano-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .pano-hint {
        padding: 12px 20px;
        font-size: 0.875rem;
    }
}

/* Landscape mobile fullscreen */
@media (max-height: 500px) and (orientation: landscape) {
    .pano-container.pano-fullscreen .pano-controls {
        bottom: 10px;
    }
    
    .pano-container.pano-fullscreen .pano-controls-inner {
        padding: 4px;
    }
    
    .pano-container.pano-fullscreen .pano-btn {
        width: 36px;
        height: 36px;
    }
}

/* Gyroscope Activation Overlay */
.pano-gyro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.pano-gyro-content {
    text-align: center;
    padding: 2rem;
    max-width: 320px;
}

.pano-gyro-icon {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.pano-gyro-phone {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 80px;
    border: 3px solid #c9a962;
    border-radius: 10px;
    transform: translate(-50%, -50%);
    animation: pano-gyro-tilt 2s ease-in-out infinite;
}

.pano-gyro-phone::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #c9a962;
    border-radius: 2px;
}

.pano-gyro-phone::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid #c9a962;
    border-radius: 50%;
}

@keyframes pano-gyro-tilt {
    0%, 100% { transform: translate(-50%, -50%) rotate(-15deg); }
    50% { transform: translate(-50%, -50%) rotate(15deg); }
}

.pano-gyro-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pano-gyro-ring {
    position: absolute;
    border: 2px solid rgba(201, 169, 98, 0.3);
    border-radius: 50%;
    animation: pano-ring-pulse 2s ease-out infinite;
}

.pano-gyro-ring:nth-child(1) {
    width: 80px;
    height: 80px;
    top: -40px;
    left: -40px;
    animation-delay: 0s;
}

.pano-gyro-ring:nth-child(2) {
    width: 100px;
    height: 100px;
    top: -50px;
    left: -50px;
    animation-delay: 0.3s;
}

.pano-gyro-ring:nth-child(3) {
    width: 120px;
    height: 120px;
    top: -60px;
    left: -60px;
    animation-delay: 0.6s;
}

@keyframes pano-ring-pulse {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

.pano-gyro-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.pano-gyro-text {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.pano-gyro-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #c9a962, #b8944d);
    color: #1a1a2e;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pano-btn-glow 2s ease-in-out infinite;
}

.pano-gyro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(201, 169, 98, 0.5);
}

@keyframes pano-btn-glow {
    0%, 100% { box-shadow: 0 5px 20px rgba(201, 169, 98, 0.3); }
    50% { box-shadow: 0 5px 30px rgba(201, 169, 98, 0.6); }
}

.pano-gyro-btn svg {
    width: 18px;
    height: 18px;
}

.pano-gyro-skip {
    display: block;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.pano-gyro-skip:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== Mobile Fullscreen Experience ===== */
.pano-mobile-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 999999 !important;
    background: #000 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.pano-mobile-fullscreen canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Mobile Controls - Bottom Bar */
.pano-mobile-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 20px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.pano-mobile-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

.pano-mobile-controls-inner {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pano-mobile-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.pano-mobile-btn svg {
    width: 22px;
    height: 22px;
}

.pano-mobile-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.25);
}

.pano-mobile-btn.active {
    background: #c9a962;
    border-color: #c9a962;
    color: #1a1a2e;
}

/* Close button - Top right */
.pano-mobile-close {
    position: absolute;
    top: 16px;
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 101;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.pano-mobile-close svg {
    width: 20px;
    height: 20px;
}

.pano-mobile-close:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile hint overlay */
.pano-mobile-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 32px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    color: #fff;
    text-align: center;
    z-index: 50;
    pointer-events: none;
    animation: pano-mobile-hint-fade 3s ease-in-out forwards;
}

.pano-mobile-hint-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(201, 169, 98, 0.2);
    border-radius: 50%;
    animation: pano-mobile-hint-pulse 1.5s ease-in-out infinite;
}

.pano-mobile-hint-icon svg {
    width: 30px;
    height: 30px;
    color: #c9a962;
}

.pano-mobile-hint-text {
    font-size: 0.9375rem;
    font-weight: 500;
    opacity: 0.9;
}

@keyframes pano-mobile-hint-fade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes pano-mobile-hint-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Tap to show/hide controls indicator */
.pano-mobile-tap-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pano-mobile-fullscreen .pano-mobile-tap-indicator.visible {
    opacity: 1;
}

/* Body lock for mobile fullscreen */
body.pano-fullscreen-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

html.pano-fullscreen-active {
    overflow: hidden !important;
}
