/* ===== THEME DEFINITIONS ===== */

/* Theme 1: Clean White (default) */
:root,
[data-theme="white"] {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --text-secondary: #666666;
    --border: #000000;
    --track-bg: #e0e0e0;
    --track-fill: #000000;
    --thumb: #000000;
    --overlay-bg: rgba(0, 0, 0, 0.85);
    --overlay-text: #ffffff;
    --img-filter: none;
    --hover-bg: #f9f9f9;
    --loading-filter: none;
    --loading-blend: multiply;
}

/* Theme 2: Ink Black */
[data-theme="black"] {
    --bg: #0a0a0a;
    --surface: #111111;
    --text: #e0e0e0;
    --text-secondary: #888888;
    --border: #333333;
    --track-bg: #222222;
    --track-fill: #cccccc;
    --thumb: #ffffff;
    --overlay-bg: rgba(255, 255, 255, 0.9);
    --overlay-text: #000000;
    --img-filter: none;
    --hover-bg: #1a1a1a;
    --loading-filter: invert(1);
    --loading-blend: screen;
}



/* ===== BASE STYLES ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: inherit;
}

html {
    background: var(--bg);
    transition: background 0.4s ease;
}

body {
    font-family: 'Michroma', Arial, Helvetica, sans-serif;
    background: var(--bg);
    padding: 40px;
    color: var(--text);
    transition: background 0.4s ease, color 0.4s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    box-sizing: border-box;
}

/* TOP SECTION: Two Columns */
.top-section {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto 1fr auto;
    gap: 0 40px;
    margin-bottom: 15px;
    position: relative;
}

/* LEFT COLUMN: Album Info */
.album-info {
    display: contents;
}

.album-title {
    grid-column: 1;
    grid-row: 1;
    font-size: 28px;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.artist-name {
    grid-column: 1;
    grid-row: 2;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 20px;
}

.album-art {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--border);
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: var(--img-filter);
    transition: filter 0.4s ease;
}

.glossy-overlay {
    display: none;
}

/* RIGHT COLUMN: Tracklist */
.tracklist {
    display: contents;
}

.tracklist-title {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: end;
    font-size: 22px;
    font-weight: bold;
    color: var(--text);
    text-align: center;
    margin-bottom: 10px;
}

.tracks {
    grid-column: 2;
    grid-row: 3;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* spotify-section removed from grid — now .spotify-centered below top-section */

/* Audio Player Styling */
.track-item {
    border: 1px solid var(--border);
    border-top: none;
    transition: border-color 0.4s ease;
}

.track-item:first-child {
    border-top: 1px solid var(--border);
}

.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--surface);
    transition: background 0.4s ease;
}

.track-item:hover .audio-player {
    background: var(--hover-bg);
}

.track-number {
    font-size: 12px;
    color: var(--text);
    opacity: 0.5;
    min-width: 14px;
    text-align: right;
}

.play-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.play-btn:hover {
    transform: scale(1.4);
    opacity: 0.7;
}

.track-title {
    font-size: 14px;
    min-width: 150px;
    color: var(--text);
}

.time-display {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 100px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--track-bg);
    outline: none;
    cursor: pointer;
    position: relative;
}

.progress-bar::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--thumb);
    cursor: pointer;
    border-radius: 50%;
    margin-top: -4px;
    position: relative;
    z-index: 2;
}

.progress-bar::-moz-range-track {
    height: 4px;
    background: var(--track-bg);
}

.progress-bar::-moz-range-progress {
    height: 4px;
    background: var(--track-fill);
}

.progress-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--thumb);
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.4s ease;
}

.download-btn:hover {
    text-decoration: underline;
}

/* EXTRAS / REMIXES SECTION */
.extras-section {
    margin-top: 28px;
    margin-bottom: 10px;
}

.extras-title {
    font-size: 11px;
    font-weight: normal;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.extra-tracks {
    display: flex;
    flex-direction: column;
}

.extra-badge {
    font-size: 9px !important;
    opacity: 1 !important;
    letter-spacing: 1px;
    min-width: 32px !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border);
    padding: 2px 4px;
    text-align: center;
}

/* REC ARTIST LINK */
.rec-link {
    color: inherit;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.2s ease;
}

.rec-link:hover {
    color: #4a9eff;
}

/* INFO ICON (next to EP1) */
.info-icon {
    font-size: 22px;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.info-icon:hover {
    opacity: 0.6;
}

/* ABOUT MODAL */
.about-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.about-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.about-modal {
    background: #ffffff;
    max-width: 560px;
    width: 90%;
    padding: 40px;
    position: relative;
}

.about-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 20px;
    cursor: pointer;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}

.about-close:hover {
    opacity: 0.5;
}

.about-modal-title {
    font-size: 11px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #999;
    margin-bottom: 20px;
}

.about-modal-content p {
    font-size: 13px;
    line-height: 1.8;
    color: #333;
    letter-spacing: 0.3px;
}

/* GALLERY SECTION */
.gallery-section {
    padding-top: 0;
    margin-top: 40px;
    margin-bottom: 40px;
}

.gallery-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
    text-align: center;
    margin-bottom: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 32px;
}

.polaroid {
    background: transparent;
    padding: 0;
    transition: none;
    max-width: 100%;
    position: relative;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.polaroid:hover {
    transform: none;
}

.polaroid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to top right, transparent calc(50% - 1px), #000 calc(50% - 1px), #000 calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(to bottom right, transparent calc(50% - 1px), #000 calc(50% - 1px), #000 calc(50% + 1px), transparent calc(50% + 1px));
    opacity: 0;

    /* RAMKA ZAWSZE ISTNIEJE, TYLKO JEST "NIEWIDZIALNA" */
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0);

    /* TERAZ OPACITY + RAMKA ANIMUJĄ SIĘ RAZEM */
    transition: opacity 0.2s ease, box-shadow 0.2s ease;

    pointer-events: none;
    z-index: 2;
}

.polaroid:hover::after {
    opacity: 1;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 1);
}

.polaroid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: var(--img-filter);
    transition: filter 0.4s ease, transform 0.4s ease;
    background: #ffffff;
}

.polaroid:hover img {
    transform: scale(1.03);
}

.polaroid video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    transition: transform 0.4s ease;
}

.polaroid:hover video {
    transform: scale(1.03);
}

/* FULLSCREEN OVERLAY */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: default;
}

.fullscreen-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.fullscreen-content {
    display: flex;
    align-items: stretch;
    max-width: 90vw;
    max-height: 90vh;
    gap: 0;
    position: relative;
}

.fullscreen-img-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.fullscreen-overlay img {
    max-width: 65vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    background: #ffffff;
}

.fullscreen-sidebar {
    width: 260px;
    background: #ffffff;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #999999;
    margin-bottom: 2px;
}

.sidebar-artist {
    font-size: 22px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 8px;
}

.sidebar-divider {
    width: 100%;
    height: 1px;
    background: #e0e0e0;
    margin: 10px 0;
}

.sidebar-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #999999;
}

.sidebar-value {
    font-size: 14px;
    color: #333333;
    margin-top: 2px;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.sidebar-links a {
    font-size: 13px;
    color: #333333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-links a:hover {
    color: #000000;
    text-decoration: underline;
}

.fullscreen-close {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #000000;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10000;
    background: #ffffff;
    border: 2px solid #000000;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
}

.fullscreen-close:hover {
    color: #333333;
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #000000;
    color: #000000;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 10001;
    transition: background 0.2s ease, transform 0.2s ease;
    padding: 0;
    user-select: none;
}

.nav-arrow:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    left: -52px;
}

.nav-next {
    right: -52px;
}

/* Smooth image/video transition */
#fullscreen-img {
    transition: opacity 0.15s ease;
}

#fullscreen-video {
    max-width: 65vw;
    max-height: 90vh;
    background: #000;
    display: none;
    transition: opacity 0.15s ease;
}

#fullscreen-video::-webkit-media-controls-mute-button,
#fullscreen-video::-webkit-media-controls-volume-slider {
    display: none;
}

/* Gallery Search */
.gallery-search {
    margin-bottom: 20px;
}

.gallery-search input {
    width: 100%;
    max-width: 400px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.gallery-search input::placeholder {
    color: var(--text);
    opacity: 0.5;
}

.gallery-search input:focus {
    border-color: var(--text);
}

/* Streaming buttons — centered below top section */
.streaming-centered {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 28px 0 10px;
}

.streaming-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    z-index: 1; /* Establish stacking context */
}

.streaming-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface);
    z-index: -2;
    transition: background 0.3s ease;
}

.streaming-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to top right, transparent calc(50% - 1px), var(--border) calc(50% - 0.5px), var(--border) calc(50% + 0.5px), transparent calc(50% + 1px)),
        linear-gradient(to bottom right, transparent calc(50% - 1px), var(--border) calc(50% - 0.5px), var(--border) calc(50% + 0.5px), transparent calc(50% + 1px));
    opacity: 0;
    box-shadow: inset 0 0 0 1px var(--border);
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
    pointer-events: none;
    z-index: -1;
}

.streaming-btn:hover::after {
    opacity: 1;
}


.streaming-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.spotify-text {
    margin-top: 8px;
    font-size: 10px;
    color: var(--text);
    opacity: 0.5;
    letter-spacing: 0.5px;
}

/* SoundCloud icon img */
.social-link img {
    width: 24px;
    height: 24px;
    filter: var(--img-filter, none);
    transition: filter 0.4s ease;
}

[data-theme="white"] .social-link img {
    filter: invert(1);
}

[data-theme="black"] .social-link img {
    filter: none;
}

/* FOOTER */
.footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    transition: border-color 0.4s ease;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px 0;
}

.social-link {
    color: var(--text);
    transition: opacity 0.2s ease, color 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover {
    opacity: 0.6;
}

.social-link svg {
    display: block;
}

/* Footer Copyright */
.footer-copyright {
    text-align: center;
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ===== THEME SWITCHER ===== */
.theme-switcher {
    position: absolute;
    top: 0;
    right: 0;
    height: 34px; /* Matches the line-height of the 28px album-title for perfect centering */
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-radius: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--text);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text);
    border-radius: 0;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: none;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--bg);
    border-color: var(--text);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateY(-50%) translateX(24px);
    background: var(--text);
}


/* Hidden audio elements */
audio {
    display: none;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    filter: var(--loading-filter);
    mix-blend-mode: var(--loading-blend);
    border-radius: 50%;
    overflow: hidden;
    object-fit: cover;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ===== MOBILE RESPONSIVE ===== */

@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
        max-width: 100%;
    }

    body {
        padding: 16px;
        padding-top: 50px;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    .tracklist {
        display: block;
        min-width: 0;
        max-width: 100%;
    }

    .tracks,
    .extra-tracks,
    .track-item,
    .audio-player {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    /* Stack album info and tracklist */
    .top-section {
        display: block;
    }

    .album-info {
        display: block;
        text-align: center;
    }

    .album-title {
        font-size: 36px;
        justify-content: center;
    }

    .album-art {
        max-width: 250px;
        margin: 0 auto;
    }

    .tracklist {
        display: block;
        margin-top: 20px;
    }

    .tracklist-title {
        font-size: 18px;
        text-align: center;
        margin-bottom: 15px;
    }

    .tracks {
        width: 100%;
    }

    .spotify-section {
        margin-top: 10px;
    }

    /* Compact audio player */
    .audio-player {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .track-title {
        min-width: unset;
        flex: 1;
        font-size: 13px;
    }

    .time-display {
        font-size: 11px;
        min-width: unset;
    }

    .download-btn {
        margin-left: auto;
    }

    .progress-bar {
        width: 100%;
        flex-basis: 100%;
        order: 10;
    }

    /* Gallery: 2 columns on mobile */
    .gallery-section {
        margin-top: 20px;
        padding-top: 10px;
    }

    .gallery-search input {
        max-width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Fullscreen: stack image and sidebar vertically */
    .fullscreen-content {
        flex-direction: column;
        max-width: 95vw;
        max-height: 95vh;
        overflow-y: auto;
    }

    .fullscreen-overlay img {
        max-width: 95vw;
        max-height: 50vh;
    }

    #fullscreen-video {
        max-width: 95vw;
        max-height: 50vh;
    }

    .fullscreen-sidebar {
        width: 100%;
        padding: 20px;
    }

    .fullscreen-close {
        top: 6px;
        right: 6px;
        font-size: 16px;
        width: 28px;
        height: 28px;
    }

    .nav-arrow {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }

    .nav-prev {
        left: 4px;
    }

    .nav-next {
        right: 4px;
    }

    .play-btn {
        flex-shrink: 0;
    }

    .toggle-switch {
        transform: scale(0.625);
        transform-origin: top right;
    }

    .toggle-slider {
        border-width: 2px;
    }

    .toggle-slider::before {
        bottom: 2px;
        left: 2px;
    }

    /* Theme switcher */
    .theme-switcher {
        display: none;
    }

    /* Footer */
    .footer {
        margin-top: 40px;
    }

    .social-links {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
        padding-top: 55px;
    }

    .album-title {
        font-size: 32px;
    }

    .album-art {
        width: 100%;
        max-width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .audio-player {
        padding: 8px 10px;
    }

    .track-title {
        font-size: 12px;
        min-width: 60px;
    }

    .download-btn {
        font-size: 10px;
    }
}