/* ============================================================
   MadFlix TV — style v1.0.0
   ============================================================ */

/* --- GŁÓWNY PLAYER (panoramiczny 16:9 + pełny ekran) --- */
.mftv-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    border-radius: 8px;
}
.mftv-player:fullscreen {
    aspect-ratio: auto;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.mftv-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.mftv-audio {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* --- WARSTWA TŁA (animacja rotate/zoom) --- */
.mftv-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    animation: mftv-membrane 0.14s ease-in-out infinite;
}
.mftv-bg img,
.mftv-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(5px);
}
/* 5 wariantów animacji tła (losowo wybierane w JS) */
.mftv-bg-v1 { animation: mftv-kf-1 24s ease-in-out infinite; }
.mftv-bg-v2 { animation: mftv-kf-2 18s ease-in-out infinite; }
.mftv-bg-v3 { animation: mftv-kf-3 20s ease-in-out infinite; }
.mftv-bg-v4 { animation: mftv-kf-4 20s ease-in-out infinite; }
.mftv-bg-v5 { animation: mftv-kf-5 45s linear infinite; }

@keyframes mftv-kf-1 {
    0%   { transform: scale(1) rotate(0deg); }
    50%  { transform: scale(1.15) rotate(3deg); }
    100% { transform: scale(1) rotate(0deg); }
}
@keyframes mftv-kf-2 {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.22); }
}
@keyframes mftv-kf-3 {
    0%, 100% { transform: scale(1.15) translateX(-3%); }
    50%      { transform: scale(1.15) translateX(3%); }
}
@keyframes mftv-kf-4 {
    0%, 100% { transform: scale(1.15) translateY(-3%); }
    50%      { transform: scale(1.15) translateY(3%); }
}
@keyframes mftv-kf-5 {
    0%   { transform: scale(1.45) rotate(0deg); }
    100% { transform: scale(1.45) rotate(360deg); }
}
@keyframes mftv-membrane {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.015); }
}

/* --- OKŁADKA ALBUMU (blik światła + lekkie unoszenie) --- */
.mftv-cover {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34%;
    aspect-ratio: 1/1;
    z-index: 2;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    animation: mftv-float 5s ease-in-out infinite;
}
.mftv-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mftv-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 30%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: skewX(-20deg);
    animation: mftv-sweep 2.6s ease-in-out infinite;
    pointer-events: none;
}
@keyframes mftv-float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0) scale(1); }
    50%      { transform: translate(-50%, -50%) translateY(-8px) scale(1.04); }
}
@keyframes mftv-sweep {
    0%        { left: -100%; }
    55%, 100% { left: 160%; }
}

/* --- GIF (pełny ekran, loop) --- */
.mftv-gif {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    z-index: 0;
}

/* --- CZĄSTECZKI / PYŁEK (paralaksa, między tłem a okładką) --- */
.mftv-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}
.mftv-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    box-shadow: 0 0 8px rgba(140,160,255,0.5);
    animation: mftv-particle-float linear infinite;
}
@keyframes mftv-particle-float {
    0%   { transform: translate(0, 0) scale(1); opacity: 0; }
    10%  { opacity: 0.7; }
    90%  { opacity: 0.25; }
    100% { transform: translate(24px, -70vh) scale(0.7); opacity: 0; }
}

/* --- OVERLAY TOP10 (lista po prawej) --- */
.mftv-top-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 42%;
    z-index: 4;
    pointer-events: none;
    display: flex;
    align-items: center;
    padding: 4%;
    overflow: hidden;
}
.mftv-top-list-inner {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    background: rgba(0,0,0,0.55);
    border-radius: 8px;
    padding: 12px;
}
.mftv-top-list-inner::-webkit-scrollbar { width: 0; height: 0; }
.mftv-top-title {
    color: #ffd700;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
.mftv-top-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px;
    border-radius: 4px;
    transition: background 0.3s, opacity 0.3s;
    opacity: 0.55;
}
.mftv-top-row.active {
    background: rgba(255,255,255,0.18);
    opacity: 1;
    box-shadow: 0 0 14px rgba(255,255,255,0.7);
}
.mftv-top-row.blink {
    animation: mftv-blink 0.4s ease-in-out infinite;
}
@keyframes mftv-blink {
    0%, 100% { opacity: 1; box-shadow: 0 0 20px rgba(255,255,255,0.95); }
    50%      { opacity: 0.3; box-shadow: 0 0 4px rgba(255,255,255,0.25); }
}
.mftv-top-rank {
    color: #ffd700;
    font-weight: 700;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    font-size: 13px;
}
.mftv-top-name {
    color: #ff2d78;
    font-size: 12px;
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* --- FAJERWERKI (odcinek Best) --- */
.mftv-firework {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
    animation: mftv-firework-burst 2.1s ease-out forwards;
}
@keyframes mftv-firework-burst {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    65%  { opacity: 1; }
    100% { transform: translate(var(--fx), var(--fy)) scale(0.15); opacity: 0; }
}

/* --- SPARKLE (subtelne cząsteczki przed MP3 — NIE fajerwerki) --- */
.mftv-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    z-index: 3;
    pointer-events: none;
    animation: mftv-sparkle-burst 1s ease-out forwards;
}
@keyframes mftv-sparkle-burst {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--fx), var(--fy)) scale(0.2); opacity: 0; }
}

/* --- OVERLAY KLIKALNY (link produktu / Amazon) --- */
.mftv-click {
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: pointer;
}

/* --- LOGO MFX (prawy górny róg, nad wszystkim) --- */
.mftv-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
}

/* --- STATUS (nazwa utworu/filmu) --- */
.mftv-status {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 8;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(0,0,0,0.55);
    border-radius: 4px;
    max-width: 70%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* --- PRZYCISK PEŁNEGO EKRANU --- */
/* --- KONTROLA DŹWIĘKU + PEŁNY EKRAN (pasek na dole po prawej) --- */
.mftv-controls {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.55);
    border-radius: 8px;
    padding: 4px 8px;
}
.mftv-mute {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 15px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.mftv-mute:hover { color: #ffcc00; }
.mftv-volume {
    width: 80px;
    height: 4px;
    cursor: pointer;
    accent-color: #c2185b;
}
.mftv-prev,
.mftv-playpause,
.mftv-next {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 15px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.mftv-prev:hover,
.mftv-playpause:hover,
.mftv-next:hover { color: #ffcc00; }

.mftv-fullscreen {
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
}
.mftv-fullscreen:hover { background: rgba(194,24,91,0.9); }

/* --- LISTY (shortcode'y pomocnicze) --- */
.mftv-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.mftv-list-group {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
}
.mftv-list-title {
    color: #e91e63;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.mftv-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    overflow-wrap: break-word;
    word-break: break-word;
}
.mftv-thumb {
    width: 72px;
    height: 40px;
    border-radius: 4px;
    background: #1e1e1e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e91e63;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}
.mftv-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mftv-item-name {
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}
a.mftv-list-item:hover { color: #ffcc00; }

/* --- LISTA UTWORÓW (new / top10) --- */
.mftv-track-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mftv-track {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
}
.mftv-track:hover { background: rgba(255,255,255,0.07); }
.mftv-track-thumb {
    width: 44px;
    height: 44px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    background: #1e1e1e;
}
.mftv-track-rank {
    color: #ffcc00;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}
.mftv-track-name {
    color: #fff;
    font-size: 13px;
    flex: 1;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.3;
    min-width: 0;
}
.mftv-track-plays {
    color: #999;
    font-size: 11px;
    flex-shrink: 0;
}
