/**
 * Spielbereich & Filter Studio CSS
 * Visual filters and Spielbereich-specific styles
 */

/* ========================================
   FILTER OVERLAY
   ======================================== */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9996;
    transition: all 0.3s ease;
}

/* ASCII Filter - Now handled by Canvas (ascii-filter.js)
   CSS class kept empty so filter toggle still works */
.filter-overlay.filter-ascii {
    /* No CSS effect - Canvas handles real ASCII art conversion */
}

/* Night Vision Filter */
.filter-overlay.filter-nightvision {
    background: radial-gradient(circle, transparent 30%, rgba(0, 255, 0, 0.2) 100%);
    backdrop-filter: hue-rotate(90deg) saturate(3) brightness(0.8) contrast(1.2);
}

.filter-overlay.filter-nightvision::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            rgba(0, 255, 0, 0.05),
            rgba(0, 255, 0, 0.05) 2px,
            transparent 2px,
            transparent 4px);
    animation: nightvision-scan 2s linear infinite;
    pointer-events: none;
}

@keyframes nightvision-scan {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(20px);
    }
}

/* VHS/Retro Filter */
.filter-overlay.filter-vhs {
    background: repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.1),
            rgba(0, 0, 0, 0.1) 2px,
            transparent 2px,
            transparent 4px);
    backdrop-filter: saturate(2) contrast(1.3) sepia(0.3);
}

.filter-overlay.filter-vhs::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(255, 0, 255, 0.1) 50%,
            transparent 100%);
    animation: vhs-glitch 0.3s infinite;
    opacity: 0.5;
}

.filter-overlay.filter-vhs::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    animation: vhs-scan 10s linear infinite;
    pointer-events: none;
}

@keyframes vhs-scan {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

@keyframes vhs-glitch {

    0%,
    100% {
        transform: translateX(0);
    }

    33% {
        transform: translateX(2px);
    }

    66% {
        transform: translateX(-2px);
    }
}

/* X-Ray Filter - Subtle blue tint for inspector mode (no color inversion) */
.filter-overlay.filter-xray {
    /* No invert - just a subtle blue overlay for inspector feel */
    backdrop-filter: saturate(0.8) brightness(0.95);
    background: rgba(0, 100, 255, 0.08);
}

.filter-overlay.filter-xray::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Very subtle scanlines */
    background:
        linear-gradient(transparent 50%, rgba(0, 100, 255, 0.015) 50%);
    background-size: 100% 2px;
}

/* Pixelate Filter - Now handled by Canvas (pixelate-filter.js)
   CSS class kept empty so filter toggle still works */
.filter-overlay.filter-pixelate {
    /* No CSS effect - Canvas handles real pixelation */
}

/* ========================================
   X-RAY DOM INSPECTOR (Chrome DevTools Style)
   ======================================== */
.xray-element-outline {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    /* Chrome DevTools Blue */
    border: 2px solid #4285f4;
    background: rgba(66, 133, 244, 0.15);
    transition: all 0.08s ease;
}

/* Margin visualization box */
.xray-margin-box {
    position: fixed;
    pointer-events: none;
    z-index: 9997;
    background: rgba(255, 155, 0, 0.15);
    border: 1px dashed rgba(255, 155, 0, 0.5);
}

/* Padding visualization box */
.xray-padding-box {
    position: fixed;
    pointer-events: none;
    z-index: 9997;
    background: rgba(113, 200, 55, 0.2);
}

.xray-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #4285f4;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    max-width: 450px;
    word-wrap: break-word;
    line-height: 1.5;
}

.xray-tooltip .tag-name {
    color: #569cd6;
    font-weight: bold;
}

.xray-tooltip .attr-name {
    color: #9cdcfe;
}

.xray-tooltip .attr-value {
    color: #ce9178;
}

.xray-tooltip .class-name {
    color: #4ec9b0;
}

.xray-tooltip .id-name {
    color: #dcdcaa;
}

.xray-tooltip .parent-path {
    color: #888;
    font-size: 10px;
    display: block;
    margin-bottom: 4px;
    border-bottom: 1px solid #333;
    padding-bottom: 4px;
}

.xray-tooltip .dimensions {
    color: #888;
    font-size: 10px;
    margin-top: 4px;
}

.xray-tooltip .box-info {
    color: #ff9b00;
    font-size: 10px;
    margin-top: 2px;
}

/* ========================================
   SPIELBEREICH SPECIFIC
   ======================================== */
.spielbereich-container {
    position: relative;
    z-index: 10;
}

/* Animation target */
.animation-target {
    will-change: transform, opacity;
}

/* Parallax layers */
.parallax-layer-1,
.parallax-layer-2 {
    will-change: transform;
}

/* Reveal animations */
.reveal-fade,
.reveal-slide-left,
.reveal-slide-right,
.reveal-scale {
    will-change: transform, opacity;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .filter-overlay {
        display: none;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    .filter-overlay,
    .filter-overlay::before,
    .filter-overlay::after {
        animation: none !important;
        transition: none !important;
    }
}