/* ═══════════════════════════════════════════════
   ShreddedPaper72 v1.1.0 – Stylesheet
   ═══════════════════════════════════════════════ */

/* ── Widget container ── */
.sp72-canvas-wrap {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    cursor: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    border-radius: 8px;
    background: #1a1a1a;
}

.sp72-canvas {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ── Cursor glow ── */
.sp72-cursor-glow {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.4s ease, width 0.3s ease, height 0.3s ease;
    background: radial-gradient(circle,
        rgba(255,230,100,0.22) 0%,
        rgba(255,200,60,0.10)  40%,
        transparent 70%
    );
    mix-blend-mode: screen;
    z-index: 10;
    animation: sp72GlowPulse 2s ease-in-out infinite;
}

/* "Ready to click" state – golden ring intensifies */
.sp72-cursor-glow--ready {
    background: radial-gradient(circle,
        rgba(255,220,60,0.38) 0%,
        rgba(255,180,20,0.18) 45%,
        transparent 70%
    );
    animation: sp72GlowReady 1s ease-in-out infinite;
}

@keyframes sp72GlowPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,200,60,0.12); }
    50%      { box-shadow: 0 0 28px 8px rgba(255,200,60,0.06); }
}
@keyframes sp72GlowReady {
    0%,100% { box-shadow: 0 0 0 0 rgba(255,200,60,0.3); }
    50%      { box-shadow: 0 0 40px 16px rgba(255,200,60,0.15); }
}

/* ── Hints ── */
.sp72-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.6s ease;
}
.sp72-hint__icon {
    font-size: 2rem;
    color: rgba(255,255,255,0.55);
    animation: sp72Spin 4s linear infinite;
    display: block;
    margin-bottom: 0.5rem;
}
.sp72-hint__text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}
@keyframes sp72Spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Click-to-gallery hint ── */
.sp72-click-hint {
    position: absolute;
    bottom: 14px;
    right: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0);
    pointer-events: none;
    z-index: 6;
    transition: color 0.5s ease;
    background: rgba(0,0,0,0.4);
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
/* Shown when cursor glow is in "ready" state */
.sp72-canvas-wrap:has(.sp72-cursor-glow--ready) .sp72-click-hint {
    color: rgba(255,220,100,0.9);
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════ */
.sp72-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.sp72-lb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: sp72FadeIn 0.3s ease;
}

.sp72-lb-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(92vw, 1400px);
    max-height: 96vh;
    animation: sp72ScaleIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Top bar ── */
.sp72-lb-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 0 10px;
}

.sp72-lb-counter {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

.sp72-lb-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s, transform 0.2s;
    outline: none;
}
.sp72-lb-close:hover,
.sp72-lb-close:focus { color: #fff; transform: scale(1.15); }

/* ── Content (canvas lives here) ── */
.sp72-lb-content {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.sp72-lb-canvas {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06);
    object-fit: contain;
}

/* ── Effect label badge ── */
.sp72-lb-effect-label {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.55);
    padding: 5px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    transition: opacity 1.2s ease;
}

/* ── Nav arrows ── */
.sp72-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sp72-lb-nav:hover,
.sp72-lb-nav:focus {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.sp72-lb-prev { left: -64px; }
.sp72-lb-next { right: -64px; }

@keyframes sp72FadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp72ScaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sp72-canvas-wrap { cursor: default; }
    .sp72-lb-prev { left: -52px; }
    .sp72-lb-next { right: -52px; }
}
@media (max-width: 767px) {
    .sp72-canvas-wrap { height: 320px; border-radius: 4px; }
    .sp72-lb-prev { left: 4px; top: auto; bottom: -56px; transform: none; }
    .sp72-lb-next { right: 4px; top: auto; bottom: -56px; transform: none; }
    .sp72-lb-wrap { max-height: 92vh; }
    .sp72-lb-canvas { max-height: 70vh; }
}
@media (max-width: 480px) {
    .sp72-canvas-wrap { height: 240px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .sp72-hint__icon  { animation: none; }
    .sp72-cursor-glow { animation: none; }
    .sp72-lb-wrap     { animation: none; }
    .sp72-lb-overlay  { animation: none; }
}
