html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

/* --- Spotify Theme Base --- */
body {
    margin-bottom: 60px;
    font-family: 'Montserrat', sans-serif; /* Cozy Google Font */
    background-color: #121212 !important; /* Spotify Dark Background */
    color: #FFFFFF !important;
}

/* --- Scrollable Rows with Arrows --- */
.scroll-wrapper {
    position: relative;
    margin-bottom: 3rem;
}

    .scroll-wrapper .row-title {
        margin-bottom: 1rem;
        font-weight: 600;
    }

.scroll-row-container {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    padding-bottom: 1rem;
}

    .scroll-row-container.active {
        cursor: grabbing;
        cursor: -webkit-grabbing;
        user-select: none;
    }

    .scroll-row-container::-webkit-scrollbar {
        display: none;
    }

.scroll-row {
    display: inline-flex;
    gap: 1rem;
}

/* --- Media Card and Hover Effects --- */
.media-card-container {
    display: inline-block;
    width: 15rem;
    background-color: #181818;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

    .media-card-container:hover {
        background-color: #282828;
    }

a.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.media-card-image-wrapper {
    position: relative;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.media-card {
    position: relative;
    background-color: transparent;
    border: none;
    transition: transform 0.3s ease-in-out;
}

.card-img-top {
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background-color: #282828;
    width: 100%;
}

.media-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
}

a.card-link:hover .media-card {
    transform: scale(1.05);
}

a.card-link:hover .media-card-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 3rem;
    color: white;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 10px #1DB954); /* Green glow for play icon */
}

.my-list-btn {
    background-color: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
}

    .my-list-btn:hover {
        background-color: rgba(255,255,255,.2);
        border-color: white;
    }

.card-info {
    padding: 0.75rem;
}

.card-info-title {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.card-info-meta {
    font-size: 0.8rem;
    font-weight: 500;
}


/* --- Arrow Styles (Corrected Alignment) --- */
.scroll-arrow {
    position: absolute;
    top: 0;
    bottom: 1rem; /* Aligns with container's bottom padding */
    height: auto; /* Let top/bottom define height */
    transform: none;
    z-index: 30;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.scroll-wrapper:hover .scroll-arrow {
    opacity: 1;
}

.scroll-arrow.left-arrow {
    left: 0;
}

.scroll-arrow.right-arrow {
    right: 0;
}

.scroll-arrow:hover {
    background-color: rgba(0, 0, 0, 0.8);
}


/* --- Details Page Styles (Corrected) --- */
.details-backdrop {
    position: relative;
    color: white;
    min-height: 85vh;
    display: flex;
    align-items: center; /* Vertically center content */
    padding: 2rem;
}

.backdrop-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.backdrop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #121212 10%, rgba(18, 18, 18, 0.7) 40%, rgba(18, 18, 18, 0.1) 70%, transparent 100%);
    z-index: 2;
}

.details-content {
    position: relative;
    z-index: 3;
}

    .details-content h1 {
        font-size: 3.5rem;
        font-weight: 700;
        text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    }

    .details-content .lead {
        max-width: 50%;
        text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
    }

.badge.bg-rating {
    background-color: #1DB954 !important;
}

/* --- Trailer Modal Styles (Restored) --- */
.trailer-modal .modal-dialog {
    max-width: 90vw;
    width: 90vw;
}

@media (min-width: 992px) {
    .trailer-modal .modal-dialog {
        max-width: 900px;
    }
}

.trailer-modal .modal-content {
    background-color: #000;
    border: none;
}

.trailer-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    z-index: 1060;
}

.trailer-iframe-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

    .trailer-iframe-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

/* Trailer Button with Spotify Green */
.btn-spotify {
    background-color: #1DB954;
    color: white;
    font-weight: bold;
    border: none;
}

    .btn-spotify:hover {
        background-color: #1ED760;
        color: white;
    }


/* --- Search Styles --- */
#search-results-container .media-card-container {
    width: 100%;
}

/* --- Mobile Responsiveness for Movie Cards --- */
@media (max-width: 992px) {
    .media-card-container {
        width: 12rem;
    }
}

@media (max-width: 768px) {
    .media-card-container {
        width: 10rem;
    }

    .scroll-arrow {
        display: none; /* Hide arrows on smaller screens */
    }

    .details-content h1 {
        font-size: 2.5rem;
    }

    .details-content .lead {
        max-width: 80%;
    }
}

@media (max-width: 576px) {
    .media-card-container {
        width: 8rem;
    }

    .scroll-row {
        gap: 0.5rem;
    }

    .details-content {
        padding: 1rem;
    }

        .details-content .lead {
            max-width: 100%;
        }
}

/* ==========================================================================
    UNIQUE STYLES FOR VIDEO CATEGORY PAGE (WASABI BUCKET VIDEOS)
========================================================================== 
*/

.video-grid-item {
    background-color: transparent;
}

.video-grid-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-grid-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* YouTube-like aspect ratio */
    background-color: #282828;
    border-radius: 12px; /* More rounded corners */
    overflow: hidden;
    margin-bottom: 0.75rem;
}

    .video-grid-thumbnail-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

.video-grid-link:hover .video-grid-thumbnail-wrapper img {
    transform: scale(1.1);
}

.video-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-grid-link:hover .video-grid-overlay {
    opacity: 1;
}

.video-grid-info {
    padding-left: 0.25rem;
}

.video-grid-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    margin-bottom: 0.1rem;
}

.video-grid-meta {
    font-size: 0.8rem;
    color: #b3b3b3;
}

.video-grid-play-icon {
    font-size: 2.5rem;
    color: white;
    filter: drop-shadow(0 0 8px rgba(29, 185, 84, 0.8));
    line-height: 1; /* Helps with vertical alignment */
}


/* ==========================================================================
    UNIQUE STYLES FOR LOGGED-OUT HOMEPAGE HERO
========================================================================== 
*/

.muvy-home-carousel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -2;
}

    .muvy-home-carousel .carousel-inner,
    .muvy-home-carousel .carousel-item,
    .muvy-home-carousel .carousel-item img {
        height: 100%;
    }

        .muvy-home-carousel .carousel-item img {
            object-fit: cover;
        }

    .muvy-home-carousel .carousel-control-prev,
    .muvy-home-carousel .carousel-control-next {
        display: none;
    }

.muvy-home-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to top, rgba(18,18,18,1) 10%, rgba(18,18,18,0.7) 40%, transparent 70%), radial-gradient(ellipse at center, transparent 30%, rgba(18,18,18,1) 95%);
    z-index: -1;
}

.muvy-home-content {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}

    .muvy-home-content h1 {
        font-size: 3.5rem;
        font-weight: 700;
    }

    .muvy-home-content .lead {
        max-width: 600px;
        font-size: 1.25rem;
    }

    .muvy-home-content .telegram-link {
        color: #1DB954;
        text-decoration: none;
        font-weight: 600;
    }

        .muvy-home-content .telegram-link:hover {
            text-decoration: underline;
        }

@media (max-width: 768px) {
    .muvy-home-content h1 {
        font-size: 2.5rem;
    }
}

.text-spotify-green {
    color: #1DB954 !important;
}

/* ==========================================================================
    UNIQUE STYLES FOR LOGGED-IN HOMEPAGE & COUNTDOWN
==========================================================================
*/

.user-home-welcome-wrapper {
    padding-top: 15vh;
}

.user-home-countdown-wrapper {
    margin-top: 3rem;
    padding: 1.5rem;
    background-color: rgba(24, 24, 24, 0.5); /* #181818 with transparency */
    border-radius: 12px;
    border: 1px solid #282828;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.user-home-countdown-label {
    font-size: 1.1rem;
    color: #b3b3b3; /* Lighter gray */
    margin-bottom: 0.5rem;
}

.user-home-countdown-timer {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1DB954; /* Spotify Green */
    letter-spacing: 2px;
}

    .user-home-countdown-timer.expired {
        color: #dc3545; /* Bootstrap danger red */
    }


/* ==========================================================================
    UNIQUE STYLES FOR THE VIDEO PLAYER PAGE (NON-FULLSCREEN)
========================================================================== 
*/

/* Breadcrumb Styles */
.breadcrumb {
    --bs-breadcrumb-divider-color: #6c757d;
    --bs-breadcrumb-item-active-color: #dee2e6;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

    .breadcrumb-item a:hover {
        color: #1DB954;
    }


/* Player & Related Videos Layout */
.player-container {
    position: relative; /* Needed for the watermark to be positioned correctly */
    background-color: #000;
    width: 100%;
    line-height: 1;
}

    /* This is the crucial fix: Target the plyr container directly */
    .player-container .plyr {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

/* Watermark styles */
.watermark {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: sans-serif;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.7;
    pointer-events: none; /* Allows clicks to go through to the video */
    z-index: 100; /* Ensure it's above the player controls */
}


.video-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 1rem;
}

.play-page-sidebar {
    width: 100%;
    max-height: 80vh; /* Allow sidebar to scroll if it's too long */
    overflow-y: auto;
}

/* Style for the video count on the category page */
.category-video-count {
    margin-left: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #b3b3b3;
    background-color: #282828;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.sidebar-title {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #282828;
}

.sidebar-video-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-video-item {
    display: flex;
    gap: 0.75rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s;
    border-radius: 4px;
    padding: 0.5rem;
}

    .sidebar-video-item:hover {
        background-color: #181818;
    }

.sidebar-thumbnail {
    width: 120px;
    flex-shrink: 0;
}

    .sidebar-thumbnail img {
        width: 100%;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 4px;
    }

.sidebar-video-info {
    display: flex;
    flex-direction: column;
}

.sidebar-video-title {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.sidebar-video-meta {
    font-size: 0.8rem;
    color: #b3b3b3;
}


/* Responsive adjustments for the play page */
@media (max-width: 991px) {
    .play-page-sidebar {
        margin-top: 2rem;
    }
}



/* ==========================================================================
    UNIQUE STYLES FOR UPLOAD PROGRESS BAR
========================================================================== 
*/

.progress {
    height: 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.bg-spotify-green {
    background-color: #1DB954 !important;
}


/* ==========================================================================
    CUSTOM PAGINATION STYLES
========================================================================== 
*/

.pagination {
    --bs-pagination-color: #b3b3b3;
    --bs-pagination-bg: #282828;
    --bs-pagination-border-color: #404040;
    --bs-pagination-hover-color: #ffffff;
    --bs-pagination-hover-bg: #404040;
    --bs-pagination-hover-border-color: #505050;
    --bs-pagination-focus-color: #ffffff;
    --bs-pagination-focus-bg: #404040;
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(29, 185, 84, 0.25);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: #1DB954;
    --bs-pagination-active-border-color: #1DB954;
    --bs-pagination-disabled-color: #6c757d;
    --bs-pagination-disabled-bg: #212529;
    --bs-pagination-disabled-border-color: #404040;
}


/* ==========================================================================
    UNIQUE STYLES FOR VIDEO CATEGORY PAGE (WASABI BUCKET VIDEOS)
========================================================================== 
*/

.video-grid-item {
    background-color: transparent;
}

.video-grid-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-grid-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* YouTube-like aspect ratio */
    background-color: #282828;
    border-radius: 12px; /* More rounded corners */
    overflow: hidden;
    margin-bottom: 0.75rem;
}

    .video-grid-thumbnail-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

.video-grid-link:hover .video-grid-thumbnail-wrapper img {
    transform: scale(1.1);
}

.video-duration-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
}

.video-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-grid-link:hover .video-grid-overlay {
    opacity: 1;
}

.video-grid-info {
    padding-left: 0.25rem;
}

.video-grid-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    margin-bottom: 0.1rem;
}

.video-grid-meta {
    font-size: 0.8rem;
    color: #b3b3b3;
}

.video-grid-play-icon {
    font-size: 2.5rem;
    color: white;
    filter: drop-shadow(0 0 8px rgba(29, 185, 84, 0.8));
    line-height: 1; /* Helps with vertical alignment */
}

.video-grid-meta {
    font-size: 0.8rem;
    color: #b3b3b3;
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Adds space between view count and date */
}

.view-count {
    display: inline-flex;
    align-items: center;
}

    .view-count svg {
        margin-bottom: 2px; /* Small vertical alignment adjustment */
    }