/* --- GŁÓWNY KONTENER --- */
.asp-container {
    position: fixed;
    top: var(--asp-top);
    width: var(--asp-width);
    z-index: 99999;
    display: none; /* JS zarządza widocznością */
    /* Głęboki cień unoszący banery nad stroną */
    filter: drop-shadow(0 15px 35px rgba(0,0,0,0.25));
    will-change: transform, opacity;
}
.asp-left { left: var(--asp-offset); }
.asp-right { right: var(--asp-offset); }

/* --- SCENA 3D (SLOT) --- */
.asp-slot {
    position: relative;
    height: var(--asp-height);
    width: 100%;
    overflow: visible; /* Pozwala efektom 3D wychodzić poza ramki */
    perspective: 1200px;
    transform-style: preserve-3d;
}

/* --- BANER (KARTA) --- */
.asp-banner {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,0.05);
    
    /* Ukrywanie nieaktywnych */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1;
    
    /* Płynne czasy dla rotacji */
    transition: 
        transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), 
        opacity 0.6s ease,
        box-shadow 0.3s ease;
        
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform-origin: center center;
}

/* --- STAN AKTYWNY --- */
.asp-banner.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 10;
    transform: translateX(0) rotateY(0deg) scale(1);
}

/* --- EFEKT HOLOGRAPHIC GLARE (ODBLASK) --- */
.asp-glare {
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    border-radius: 12px;
    z-index: 20;
    pointer-events: none;
    
    /* Gradient symulujący światło */
    background: radial-gradient(
        circle at 50% 50%, 
        rgba(255, 255, 255, 0.9) 0%, 
        rgba(255, 255, 255, 0.3) 30%, 
        transparent 70%
    );
    
    opacity: 0;
    mix-blend-mode: overlay;
    transition: opacity 0.2s ease;
}

/* --- PASEK POSTĘPU --- */
.asp-progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0,0,0,0.05);
    z-index: 100;
    pointer-events: none;
}

.asp-progress-bar {
    height: 100%;
    background: var(--asp-border);
    width: 0%;
    box-shadow: 0 0 8px var(--asp-border); /* Świecenie paska */
    transition: width 0.1s linear;
}

/* --- EFEKT SHINE (BŁYSK) --- */
.asp-banner::after {
    content: '';
    position: absolute;
    top: 0; left: -150%;
    width: 100%; height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.5) 50%, transparent 100%);
    transform: skewX(-25deg);
    z-index: 50;
    animation: asp-shine-anim 6s infinite;
    pointer-events: none;
}

@keyframes asp-shine-anim {
    0% { left: -150%; }
    15% { left: 150%; }
    100% { left: 150%; }
}

/* --- GHOST CLOSE BUTTON (ZAMKNIĘCIE) --- */
.asp-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 50%;
    color: #555;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    font-family: sans-serif;
    font-weight: bold;
}

.asp-container:hover .asp-close {
    opacity: 1;
    transform: scale(1);
    top: -12px; 
    right: -12px;
}

.asp-close:hover {
    background: #ff4757;
    color: white;
    transform: scale(1.1) rotate(90deg);
    border-color: #ff4757;
}

/* --- ANIMACJE WEJŚCIA (ELASTIC FLY-IN) --- */
@keyframes asp-slide-in-left {
    0% { opacity: 0; transform: translateX(-150px); }
    60% { opacity: 1; transform: translateX(15px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes asp-slide-in-right {
    0% { opacity: 0; transform: translateX(150px); }
    60% { opacity: 1; transform: translateX(-15px); }
    100% { opacity: 1; transform: translateX(0); }
}

.asp-animate-left {
    animation: asp-slide-in-left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.asp-animate-right {
    animation: asp-slide-in-right 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- ANIMACJE PRZEJŚĆ --- */
/* Slide */
.asp-banner.transition-slide { transform: translateX(120%) scale(0.95); opacity: 0; }
.asp-banner.transition-slide.active { transform: translateX(0) scale(1); opacity: 1; }
.asp-banner.transition-slide.out { transform: translateX(-20%) scale(0.95); opacity: 0; }
/* Crossfade */
.asp-banner.transition-crossfade { opacity: 0; transform: scale(1.05); }
.asp-banner.transition-crossfade.active { opacity: 1; transform: scale(1); }
.asp-banner.transition-crossfade.out { opacity: 0; transform: scale(1); }
/* Flip */
.asp-banner.transition-flip { transform: rotateY(-90deg); opacity: 0; }
.asp-banner.transition-flip.active { transform: rotateY(0deg); opacity: 1; }
.asp-banner.transition-flip.out { transform: rotateY(90deg); opacity: 0; }

/* --- RESPONSIVE & IMG --- */
.asp-banner img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    border-radius: 12px;
}
@media (max-width: 1024px) {
    .asp-hide-mobile .asp-container { display: none !important; }
}
.asp-default-banner {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    height: 100%; text-align: center; color: #555; padding: 10px; font-family: sans-serif;
}
.asp-default-banner h3 { color: var(--asp-border); margin-bottom: 5px; }