/**
 * Spray Paint Overlay Styles
 */

/* Trigger Button */
.spo-trigger-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: transparent !important;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: none;
    z-index: 9998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.spo-trigger-btn:hover {
    transform: scale(1.3);
    box-shadow: none;
}

.spo-trigger-btn:active {
    transform: scale(0.95);
}

.spo-trigger-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Overlay */
.spo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0 0 0 / 0%);
    z-index: 9999;
    overflow: hidden;
}

.spo-overlay.active {
    display: block;
}

/* Controls */
.spo-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10000;
}

.spo-btn {
    padding: 12px 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.spo-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.spo-btn:active {
    transform: translateY(0);
}

.spo-close-btn {
    font-size: 24px;
    padding: 8px 16px;
    line-height: 1;
background-color: #ff8cbc !important;
}

.spo-clear-btn {
    background: #3ec6ed !important;
    /* Yellow */
    color: #000;
    /* Dark text for contrast on yellow */
    border: none;
}

/* Canvas */
.spo-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: url('../images/Icons/spray-can-cursor.png') 10 10, crosshair;
    overflow: hidden;
    /* User requested transparent background */
    background: transparent;
}

/* Dark frame + subtle grid for style (pseudo-element from reference) */
/* User requested transparent overlay, so hiding this or making it minimal */
.spo-canvas::before {
    display: none;
}

/* Spray Paint Elements */
.spo-paint {
    position: absolute;
    pointer-events: none;
    transition: transform 0.18s ease-out;
    /* Match reference transition */
    will-change: transform;
    z-index: 1;
    /* Above background */
    width: 70px;
    /* Reference width, originally was dynamic/size based, but reference is fixed width? Reference says width: 110px */
}

/* Override plugin dynamic sizing if we want to match reference exactly, or keep dynamic. 
   User said "matches the structure/style". 
   Block below handles the image style */
.spo-paint img,
.spo-paint svg {
    display: block;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.65));
    /* Reference shadow */
}

/* Fade in animation - keeping plugin's fade/scale in but adjusting if needed */
@keyframes spo-fade-in {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(var(--spo-rotation, 0deg));
    }

    to {
        opacity: 1;
        transform: scale(var(--spo-scale, 1)) rotate(var(--spo-rotation, 0deg));
    }
}

.spo-paint.spo-new {
    /* Reference doesn't have a fade-in class, it sets style directly. 
       Keeping plugin's fade in for smoothness or removing if user wants EXACT match. 
       Reference has transition: transform 0.18s ease-out; 
       I will simplify to match reference feel. */
    animation: none;
}

/* Instructions */
.spo-instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 24px;
    font-weight: 300;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.spo-overlay.has-paint .spo-instructions {
    opacity: 0;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .spo-trigger-btn {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .spo-trigger-btn svg {
        width: 24px;
        height: 24px;
    }

    .spo-controls {
        top: 10px;
        right: 10px;
        gap: 8px;
    }

    .spo-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .spo-close-btn {
        font-size: 20px;
        padding: 6px 12px;
    }

    .spo-instructions {
        font-size: 18px;
        padding: 0 20px;
    }
}

/* Accessibility */
.spo-trigger-btn:focus,
.spo-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Prevent text selection while painting */
.spo-canvas.painting {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}