:root {
    font-family: 'Courier New', Courier, monospace !important;
}

body {
    background: linear-gradient(135deg, #1a1a1a, #333333);
    background-size: 400% 400%;
    animation: gradientAnimation 10s ease infinite;
    min-height: 100vh;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* FLEX-BASED GALLERY LAYOUT */
.gallery-row {
    display: flex;
    gap: 1rem;
    width: 100%;
    align-items: flex-start;
}

.gallery-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1 1 0;
    min-width: 0;
}

/* Responsive column widths */
.gallery-row.columns-1 > .gallery-col {
    width: 100%;
}
.gallery-row.columns-2 > .gallery-col {
    width: 50%;
}
.gallery-row.columns-3 > .gallery-col {
    width: 33.3333%;
}

/* Responsive breakpoints */
@media (max-width: 992px) {
    .gallery-row.columns-3 > .gallery-col {
        width: 50%;
    }
    .gallery-row.columns-2 > .gallery-col,
    .gallery-row.columns-3 > .gallery-col {
        width: 50%;
    }
}
@media (max-width: 768px) {
    .gallery-row > .gallery-col {
        width: 100%;
    }
}

/* Card styling */
.card {
    background: #222;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #444;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card-img {
    width: 100%;
    display: block;
    height: auto;
    background: #111;
}

/* Overlay for card action buttons */
.card-img-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0) 30%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card:hover .card-img-overlay,
.card:focus-within .card-img-overlay {
    opacity: 1;
    pointer-events: auto;
}

.action-buttons {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

/* Modal dark theme */
.modal-content {
    background-color: #343a40;
    color: #f8f9fa;
}
.modal-header {
    border-bottom: 1px solid #495057;
}
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Spinner color override for dark bg */
.spinner-border {
    color: #fff;
}

/* Mobile-specific fixes */
@media (orientation: portrait) {
    /* Fix play button z-index so it's not on top of Now Playing dialog */
    .play-button {
        z-index: 5;
    }

    /* Add margin above header to account for Now Playing widget height */
    header.container {
        margin-top: 80px;
    }
}

/* Play Button Styles */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid white;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Perfect centering for icons */
.play-button i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 1;
}

/* Slight adjustment for play icon visual centering */
.play-button .bi-play-fill {
    transform: translateX(1px);
}

.play-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-button.playing {
    animation: rotate 2s linear infinite;
}

/* Rotating stop button in Now Playing dialog */
.btn.active i {
    animation: rotateIcon 2s linear infinite;
    display: inline-block;
    transform-origin: center;
}

/* Now Playing Dialog Styles */
.now-playing-dialog {
    pointer-events: auto;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: saturate(120%) blur(6px);
    -webkit-backdrop-filter: saturate(120%) blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    max-width: min(92vw, 640px);
}

.now-playing-container {
    pointer-events: none;
    z-index: 9999;
}

/* Animation Keyframes */
@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes rotateIcon {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
