/**
 * Background System Styles
 * Infrastructure for Three.js animations, images, and videos
 */

/* =============================================================================
   CANVAS ANIMATION (Three.js)
   ============================================================================= */

.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    display: block;
}

/* Hide if disabled */
.canvas-animations-disabled .background-canvas {
    display: none;
}

/* =============================================================================
   BACKGROUND IMAGE
   ============================================================================= */

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* iOS fix: background-attachment: fixed doesn't work well on iOS */
@supports (-webkit-touch-callout: none) {
    .background-image {
        background-attachment: scroll;
    }
}

/* =============================================================================
   BACKGROUND VIDEO
   ============================================================================= */

.background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    object-fit: cover;
    /* Ensure video always covers viewport */
    min-width: 100%;
    min-height: 100%;
}

/* =============================================================================
   OVERLAY
   ============================================================================= */

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* =============================================================================
   CUSTOM PAGE CLASSES (examples)
   ============================================================================= */

/* User can add custom styles for page-specific classes */
/* Example:
.home-animation {
    opacity: 0.8;
}

.about-animation {
    filter: blur(2px);
}

.hero-background {
    filter: brightness(0.8);
}
*/

/* =============================================================================
   REDUCED MOTION
   ============================================================================= */

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .background-canvas,
    .background-video {
        /* Pause animations for users who prefer reduced motion */
        animation-play-state: paused !important;
    }

    .background-video {
        /* Show poster instead of video */
        display: none;
    }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    .background-canvas,
    .background-image,
    .background-video,
    .background-overlay {
        display: none !important;
    }
}
