/* Iran360 Virtual Tour Viewer - Main Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    background-color: #2c3e50;
    color: #ecf0f1;
    overflow: hidden;
    font-weight: 400;
    line-height: 1.5;
}

/* Main Container */
#tour-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #2c3e50;
}

/* Three.js Canvas */
#tour-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#tour-canvas:active {
    cursor: grabbing;
}

/* Responsive Breakpoints */

/* Mobile (up to 767px) */
@media screen and (max-width: 767px) {
    body {
        font-size: 14px;
    }
    
    #tour-container {
        touch-action: none;
        /* Prevent pull-to-refresh on mobile */
        overscroll-behavior: none;
    }
    
    /* Optimize for mobile performance */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Tablet (768px to 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    body {
        font-size: 16px;
    }
    
    #tour-container {
        touch-action: none;
    }
}

/* Desktop (1024px and up) */
@media screen and (min-width: 1024px) {
    body {
        font-size: 16px;
    }
    
    /* Enable hover effects on desktop */
    #tour-canvas {
        cursor: grab;
    }
    
    #tour-canvas:active {
        cursor: grabbing;
    }
}

/* High DPI displays */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    /* Optimizations for high DPI screens */
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Viewport-specific body classes */
body.viewport-mobile {
    font-size: 14px;
}

body.viewport-tablet {
    font-size: 16px;
}

body.viewport-desktop {
    font-size: 16px;
}

/* Touch optimization for mobile and tablet */
body.viewport-mobile #tour-container,
body.viewport-tablet #tour-container {
    touch-action: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Desktop-specific optimizations */
body.viewport-desktop #tour-canvas {
    cursor: grab;
}

body.viewport-desktop #tour-canvas:active {
    cursor: grabbing;
}

/* Focus styles for keyboard navigation */
button:focus,
a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Enhanced focus styles for better accessibility */
button:focus-visible,
a:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

/* Remove focus outline for mouse users */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}