/* ═══════════════════════════════════════════════════════════════
   COMMON STYLES FOR ALL PAGES
   Color Palette: Black & Purple - matching main page
   ═══════════════════════════════════════════════════════════════ */

/* ==================== */
/* PAGE HERO SECTION */
/* ==================== */
.page-hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.page-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-size: cover;
    background-position: center;
    transform: scale(1.1);
    transition: transform 0.1s ease-out;
}

.page-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(76, 29, 149, 0.3) 50%,
        rgba(0, 0, 0, 0.95) 100%
    );
}

.page-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

/* Title container with 3D perspective - jak na stronie głównej */
.title-container {
    position: relative;
    display: inline-block;
    padding: 80px 120px;
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* Animated glow behind title */
.title-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130%;
    height: 130%;
    background: radial-gradient(ellipse, var(--purple-glow) 0%, transparent 70%);
    filter: blur(50px);
    opacity: 0.5;
    animation: glowPulse 4s ease-in-out infinite;
    z-index: 1;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.15); }
}

.page-hero-title {
    font-family: var(--font-minecraft);
    font-size: clamp(1rem, 3vw, 2rem);
    letter-spacing: 0.15em;
    color: var(--white);
    margin-bottom: 1rem;
    position: relative;
    z-index: 10;
    
    /* 3D Text Effect - jak na stronie głównej */
    text-shadow: 
        /* Główna poświata */
        0 0 10px var(--purple-light),
        0 0 20px var(--purple),
        0 0 40px var(--purple),
        /* 3D głębia - warstwy */
        1px 1px 0 rgba(100, 50, 150, 0.8),
        2px 2px 0 rgba(90, 45, 140, 0.7),
        3px 3px 0 rgba(80, 40, 130, 0.6),
        4px 4px 0 rgba(70, 35, 120, 0.5),
        5px 5px 0 rgba(60, 30, 110, 0.4),
        6px 6px 0 rgba(50, 25, 100, 0.3),
        /* Cień pod 3D */
        8px 8px 15px rgba(0, 0, 0, 0.5);
    
    /* 3D transform */
    transform-style: preserve-3d;
    perspective: 500px;
    animation: pageTitle3DFloat 4s ease-in-out infinite, pageTitlePulse3D 2s ease-in-out infinite;
}

@keyframes pageTitle3DFloat {
    0%, 100% {
        transform: rotateX(5deg) rotateY(-2deg) translateZ(0);
    }
    25% {
        transform: rotateX(3deg) rotateY(2deg) translateZ(10px);
    }
    50% {
        transform: rotateX(-3deg) rotateY(3deg) translateZ(5px);
    }
    75% {
        transform: rotateX(2deg) rotateY(-3deg) translateZ(8px);
    }
}

@keyframes pageTitlePulse3D {
    0%, 100% {
        text-shadow: 
            0 0 10px var(--purple-light),
            0 0 20px var(--purple),
            0 0 40px var(--purple),
            1px 1px 0 rgba(100, 50, 150, 0.8),
            2px 2px 0 rgba(90, 45, 140, 0.7),
            3px 3px 0 rgba(80, 40, 130, 0.6),
            4px 4px 0 rgba(70, 35, 120, 0.5),
            5px 5px 0 rgba(60, 30, 110, 0.4),
            6px 6px 0 rgba(50, 25, 100, 0.3),
            8px 8px 15px rgba(0, 0, 0, 0.5);
        filter: brightness(1);
    }
    50% {
        text-shadow: 
            0 0 20px #fff,
            0 0 40px var(--purple-light),
            0 0 60px var(--purple),
            0 0 80px var(--purple-electric),
            1px 1px 0 rgba(140, 80, 200, 0.9),
            2px 2px 0 rgba(130, 70, 190, 0.8),
            3px 3px 0 rgba(120, 60, 180, 0.7),
            4px 4px 0 rgba(110, 50, 170, 0.6),
            5px 5px 0 rgba(100, 40, 160, 0.5),
            6px 6px 0 rgba(90, 30, 150, 0.4),
            10px 10px 20px rgba(0, 0, 0, 0.6);
        filter: brightness(1.2);
    }
}

.page-hero-subtitle {
    font-size: 1rem;
    color: #ffffff;
    letter-spacing: 0.1em;
}

/* ==================== */
/* HEADER FOR SUBPAGES */
/* ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    /* Bazowe przezroczyste tło */
    background: transparent;
    padding: 16px 0;
    transition: padding 0.3s ease;
}

/* Pseudo-element dla animowanego tła headera */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: -1;
    /* Domyślnie widoczne (po scrollu) - animacja od góry */
    transform: translateY(0%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Na górze strony - tło headera chowa się do góry */
.header.scrolled::before {
    transform: translateY(-100%);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--white);
}

.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--purple);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--purple-glow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.logo-text {
    font-size: 0.7rem;
    letter-spacing: 2px;
}

.nav {
    display: flex;
    gap: 40px;
}

.nav a {
    position: relative;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}

.nav a:hover,
.nav a.active {
    color: var(--white);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--purple), var(--purple-light));
    transition: var(--transition-medium);
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

/* ==================== */
/* PAGE CONTENT */
/* ==================== */
.page-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 40px 12px 80px;
    background: var(--black);
    overflow: hidden;
    box-sizing: border-box;
}

.section-title {
    font-family: var(--font-minecraft);
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: var(--white);
    text-shadow: 0 0 30px var(--purple-glow);
    letter-spacing: 0.2em;
    text-align: center;
    margin-bottom: 60px;
}

/* ==================== */
/* CARDS GRID */
/* ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.card {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    border: none;
    transition: var(--transition-medium);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    max-width: 100%;
}

.card:hover {
    transform: scale(1.02);
}

.card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: var(--black-lighter);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform var(--transition-slow);
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-medium);
    border-radius: 8px;
}

.card:hover .card-overlay {
    opacity: 1;
}

.spotify-play-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.spotify-play-icon svg {
    filter: drop-shadow(0 0 10px rgba(29, 185, 84, 0.5));
}

.card-info {
    padding: 12px 4px;
}

.card-title {
    font-family: var(--font-minecraft);
    font-size: 0.55rem;
    margin-bottom: 4px;
    color: var(--white);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-artist {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-year {
    font-size: 0.7rem;
    color: var(--gray);
}

/* ==================== */
/* FILTERS */
/* ==================== */
.filters {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 8px;
    color: var(--gray);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    background: rgba(124, 58, 237, 0.25);
    color: var(--white);
}

.filter-btn.active {
    background: var(--purple);
    border-color: var(--purple);
    color: var(--white);
    box-shadow: 0 0 20px var(--purple-glow);
}

/* ==================== */
/* FOOTER */
/* ==================== */
.footer {
    padding: 50px 0;
    background: var(--black);
    border-top: 1px solid rgba(124, 58, 237, 0.15);
}

.footer .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: var(--font-minecraft);
    font-size: 0.5rem;
    background: linear-gradient(90deg, var(--purple), var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--purple-light);
}

.footer-year {
    color: var(--gray);
    font-size: 0.875rem;
}

/* ==================== */
/* EMPTY STATE */
/* ==================== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--gray);
}

.empty-state p {
    font-size: 1rem;
}

/* ==================== */
/* LOADING */
/* ==================== */
.loading {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 60px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(124, 58, 237, 0.2);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== */
/* RESPONSIVE */
/* ==================== */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav {
        gap: 20px;
    }
    
    .page-hero {
        height: 40vh;
        min-height: 300px;
    }
    
    .title-container {
        padding: 40px 60px;
    }
    
    .page-hero-title {
        font-size: clamp(0.8rem, 4vw, 1.5rem);
    }
    
    .page-content {
        padding: 50px 2px 70px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        max-width: calc(100vw - 24px);
        width: calc(100% - 24px);
        margin: 0 auto;
    }
    
    .card-image {
        border-radius: 6px;
    }
    
    .card-overlay {
        border-radius: 6px;
    }
    
    .card-info {
        padding: 8px 2px;
        margin-top: 5px !important;
        position: relative;
        transform: translateY(5px) !important;
    }
    
    .card-title {
        font-size: 0.5rem;
        margin-bottom: 2px;
    }
    
    .card-artist {
        font-size: 0.7rem;
        margin-bottom: 2px;
    }
    
    .card-year {
        font-size: 0.6rem;
    }
    
    .filters {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 16px;
        font-size: 0.65rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 40px 0 60px;
    }
    
    .title-container {
        padding: 30px 40px;
    }
    
    .page-hero-title {
        font-size: clamp(0.7rem, 5vw, 1.2rem);
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        max-width: calc(100vw - 20px);
        width: calc(100% - 20px);
        margin: 0 auto;
    }
    
    .card-info {
        padding: 6px 2px;
        margin-top: 5px !important;
        position: relative;
        transform: translateY(5px) !important;
    }
    
    .card-title {
        font-size: 0.45rem;
    }
    
    .card-artist {
        font-size: 0.65rem;
    }
    
    .nav {
        gap: 15px;
        font-size: 0.75rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   MARQUEE BANNER FOR SUBPAGES
   ═══════════════════════════════════════════════════════════════ */

.marquee-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* Czarne tło jako fallback */
    background: #000;
    color: var(--white);
    padding: 10px 0;
    z-index: 10000;
    overflow: hidden;
    box-sizing: border-box;
}

/* Pseudo-element dla animowanego tła bannera */
.marquee-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% + 5px); /* +5px żeby pokryć potencjalną szparkę */
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: -1;
    /* Domyślnie widoczne (po scrollu) - animacja od góry */
    transform: translateY(0%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Na górze strony - tło chowa się do góry */
.marquee-banner.scrolled::before {
    transform: translateY(-100%);
}

/* Gradient overlay dla stanu scrolled */
.marquee-banner.scrolled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.55) 40%,
        rgba(0, 0, 0, 0.28) 70%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: -1;
}

.marquee-track {
    display: flex;
    animation: marqueeScroll 20s linear infinite;
    white-space: nowrap;
    background: none !important;
    background-color: transparent !important;
    position: relative;
    z-index: 2;
}

.marquee-track span {
    font-family: var(--font-minecraft);
    font-size: 0.65rem;
    letter-spacing: 2px;
    padding-right: 50px;
    /* Efekt starego telewizora CRT - rozwarstwianie kolorów RGB */
    text-shadow: 
        /* Czerwony kanał - przesunięty w lewo */
        -2px 0 0 rgba(255, 0, 0, 0.6),
        /* Zielony kanał - centralny */
        0 0 0 rgba(0, 255, 0, 0.5),
        /* Niebieski kanał - przesunięty w prawo */
        2px 0 0 rgba(0, 100, 255, 0.6),
        /* Dodatkowa poświata */
        0 0 10px rgba(255, 255, 255, 0.3);
    animation: crtGlitch 0.15s infinite;
}

/* Animacja glitchu CRT */
@keyframes crtGlitch {
    0%, 100% {
        text-shadow: 
            -2px 0 0 rgba(255, 0, 0, 0.6),
            0 0 0 rgba(0, 255, 0, 0.5),
            2px 0 0 rgba(0, 100, 255, 0.6),
            0 0 10px rgba(255, 255, 255, 0.3);
    }
    25% {
        text-shadow: 
            -1px 1px 0 rgba(255, 0, 0, 0.7),
            1px 0 0 rgba(0, 255, 0, 0.5),
            2px -1px 0 rgba(0, 100, 255, 0.7),
            0 0 8px rgba(255, 255, 255, 0.4);
    }
    50% {
        text-shadow: 
            -3px 0 0 rgba(255, 0, 0, 0.5),
            0 1px 0 rgba(0, 255, 0, 0.6),
            3px 0 0 rgba(0, 100, 255, 0.5),
            0 0 12px rgba(255, 255, 255, 0.3);
    }
    75% {
        text-shadow: 
            -2px -1px 0 rgba(255, 0, 0, 0.6),
            -1px 0 0 rgba(0, 255, 0, 0.5),
            1px 1px 0 rgba(0, 100, 255, 0.7),
            0 0 6px rgba(255, 255, 255, 0.5);
    }
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

body.has-marquee .header {
    top: 34px;
}

/* Rozciągnij tło headera aby pokryło szparkę */
body.has-marquee .header::before {
    top: -10px;
    height: calc(100% + 10px);
}

body.has-marquee .page-hero {
    margin-top: 38px;
}

@media (max-width: 768px) {
    html, body {
        background: #000;
    }

    .marquee-track span {
        font-size: 0.5rem;
    }
    
    .marquee-banner {
        height: 28px;
        padding: 0;
        display: flex;
        align-items: center;
        background: #000;
        transform: none;
    }
    
    /* Tło bannera nachodzi na header */
    .marquee-banner::before {
        display: none;
    }
    
    body.has-marquee .header {
        top: 27px;
        padding-top: 0;
        margin-top: 0;
        background: #000;
        border-top: 1px solid #000;
    }
    
    body.has-marquee .header::before {
        display: none;
    }
    
    body.has-marquee .page-hero {
        margin-top: 28px;
    }
}

/* ==================== */
/* CART LINK IN NAV */
/* ==================== */
.cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--purple);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
}

.cart-count:empty,
.cart-count[data-count="0"] {
    display: none;
}
