/**
 * Paint Black Effect Styles
 * Styles für das Anmalen des Briefs mit schwarzer Farbe
 */

/* Paint Overlay Container - ABSOLUTE POSITIONING für Scroll-Kompatibilität */
#paint-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    pointer-events: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
    /* Wichtig: Mindesthöhe für gescrollte Inhalte */
    min-height: 100vh;
}

/* Paint Mode aktiv */
body.paint-mode {
    user-select: none !important;
}

body.paint-mode * {
    user-select: none !important;
}

body.paint-mode #paint-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Paint Progress Indicator */
#paint-progress {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 10002;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.paint-mode #paint-progress {
    opacity: 1;
}

/* Paint Strokes - verschiedene Pinselgrößen */
.paint-stroke {
    position: absolute;
    border-radius: 50%;
    background: #000000;
    opacity: 0.9;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.paint-stroke.small {
    width: 20px;
    height: 20px;
}

.paint-stroke.medium {
    width: 35px;
    height: 35px;
}

.paint-stroke.large {
    width: 50px;
    height: 50px;
}

.paint-stroke.extra-large {
    width: 70px;
    height: 70px;
}

/* Brush Trail Effekt */
.paint-brush-trail {
    position: absolute;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: brush-trail-fade 1s forwards;
    z-index: 2;
}

@keyframes brush-trail-fade {
    0% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.3); 
    }
}

/* Completion Effect */
.paint-completion-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    z-index: 10010;
    pointer-events: none;
    opacity: 0;
    animation: completion-flash 3s forwards;
}

@keyframes completion-flash {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* === NEUE STYLES AUS JS === */

/* Paint Completion Flash Animation - für JS-generierte Elemente */
@keyframes paint-completion-flash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

.paint-completion-flash {
    animation: paint-completion-flash 2s forwards;
}

/* Enhanced eighth-scroll visibility on black background */
body.background-turning-black .eighth-scroll {
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.9), 0 0 40px rgba(255, 255, 255, 0.9) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
}

/* Canvas Erase Effect Support */
.seventh-scroll {
    transition: opacity 0.1s ease !important;
}

#erase-canvas {
    display: none !important;
}

/* === BESTEHENDE STYLES === */

/* Black Background Transition */
body.background-turning-black {
    background: #000000 !important;
    background-color: #000000 !important;
    background-image: none !important;
    transition: background-color 2s ease;
}

body.background-turning-black .bg-image,
body.background-turning-black .bg-container {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Paint Mode deaktiviert */
body.paint-mode-disabled {
    cursor: default !important;
}

body.paint-mode-disabled * {
    cursor: default !important;
}

body.paint-mode-disabled #paint-overlay {
    opacity: 0;
    pointer-events: none;
}

body.paint-mode-disabled #paint-progress {
    opacity: 0;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .paint-stroke.small {
        width: 25px;
        height: 25px;
    }
    
    .paint-stroke.medium {
        width: 40px;
        height: 40px;
    }
    
    .paint-stroke.large {
        width: 55px;
        height: 55px;
    }
    
    .paint-stroke.extra-large {
        width: 75px;
        height: 75px;
    }
    
    #paint-progress {
        top: 10px;
        left: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }
}
