@import url('https://fonts.googleapis.com/css2?family=Lato:wght@700&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');

:root {
    --a: 0;
    /* Define heights for different screen sizes */
    --top-bar-height-desktop: 63px; /* Reduced from 120px */
    --player-bar-height-desktop: 90px;

    --top-bar-height-tablet: 70px; /* Reduced from 80px */
    --player-bar-height-tablet: 80px;

    --top-bar-height-mobile: 60px; /* Reduced from 70px */
    --player-bar-height-mobile: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Crucial for consistent sizing */
    font-family: 'Roboto', sans-serif;
    /* This is the key change to remove the blue outline on focus */
    outline: none;
}

/* Specific focus styles for inputs can be re-added if desired, e.g.: */
input:focus {
    border-color: #1DB954; /* Example: green border on focus for inputs */
}

/* NEW: Remove outline and tap highlight for interactive elements */
button:focus,
button:active,
a:focus,
a:active,
input:focus,
input:active,
.auth-button:focus,
.auth-button:active,
.main-button:focus,
.main-button:active,
.transparent-button:focus,
.transparent-button:active,
.close-button:focus,
.close-button:active,
.prev-button:focus,
.prev-button:active {
    outline: none !important; /* Ensure outline is removed */
}

/* NEW: Remove tap highlight color for WebKit browsers (iOS/Android Chrome) */
body {
    -webkit-tap-highlight-color: transparent;
}


body {
    background-color: black;
    color: white;
    height: 100vh; /* Body takes full viewport height */
    overflow: hidden; /* Prevents body from scrolling, inner containers will scroll */
    display: flex; /* Make body a flex container */
    flex-direction: column; /* Stack children vertically */
}

/* Blur effect for player bar when popup is active */
body.popup-active .player-bar {
    filter: blur(5px); /* Increased blur for a more noticeable effect */
    transition: filter 0.3s ease-in-out; /* Smooth transition for blur */
}

/* --- Main Layout Container --- */
.container {
    display: flex;
    flex-direction: row;
    width: 100vw; /* Ensure container takes full viewport width */
    flex-grow: 1; /* Allow container to grow and take available space */
    overflow: hidden; /* Prevents container content from overflowing horizontally */
}

/* Left Sidebar - Desktop View */
.left {
    width: 25%;
    height: 100%; /* Takes full height of container */
    overflow-y: auto; /* Allows vertical scrolling within sidebar */
    background-color: #292424;
    flex-shrink: 0; /* Prevents sidebar from shrinking */
}

.left img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.logo img {
    width: 120px;
    height: auto;
}

/* --- Top Bar (Fixed position, positioned over .right) --- */
.top-bar {
    position: fixed; /* Stays in place when content scrolls */
    top: 0;
    left: 25%; /* Aligned with the start of the .right section */
    width: 75%; /* Matches the width of the .right section */
    background: linear-gradient(to right, #450707, #450707); /* Subtle gradient for depth */
    border-bottom: 1px solid rgba(0, 0, 0, 0.4); /* Thinner, subtle border */
    border-radius: 10px 10px 10px 10px; /* Slightly more rounded corners */
    padding: 1px 5px; /* Increased padding for more breathing room */
    display: flex;
    justify-content: space-between; /* Space out items */
    align-items: center; /* Vertically center items */
    height: var(--top-bar-height-desktop); /* Using variable for height */
    box-sizing: border-box; /* Include padding in height */
    z-index: 100; /* Ensure it's above other content */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Added subtle shadow */
    transition: all 0.3s ease; /* Smooth transition for height/style changes */
}

/* --- Right Content Area: Handles dynamic height and padding for fixed bars --- */
.right {
    width: 75%; /* Remains 75% of 100vw on desktop */
    flex-grow: 1; /* Allows it to take available height */
    /* IMPORTANT: Padding for fixed top and player bars */
    padding-top: var(--top-bar-height-desktop); /* Adjust padding based on new top-bar height */
    /* Increased padding-bottom to ensure content is not hidden under the player bar */
    padding-bottom: calc(var(--player-bar-height-desktop) + 30px);
    display: flex;
    flex-direction: column; /* Stacks sections vertically */
    margin: 0;
    overflow-y: auto; /* Allows vertical scrolling for the main content area on desktop */
    overflow-x: hidden; /* Prevents horizontal scroll from content */
    -ms-overflow-style: auto; /* For IE/Edge: default scrollbar on desktop */
    scrollbar-width: auto; /* For Firefox: default scrollbar on desktop */
}

/* --- Header (Internal to content, if it should stick below top-bar) --- */
.header {
    position: sticky; /* Make it sticky */
    top: var(--top-bar-height-desktop); /* This header will stick at the position below the top-bar */
    width: 101%;
    display: flex;
    border-radius: 30px;
    justify-content: space-between;
    background-color: rgb(70, 9, 9);
    z-index: 10; /* Lower than top-bar, higher than normal content */
    padding: 6px;
    flex-shrink: 0; /* Prevents it from shrinking */
}

.header>* {
    padding: 0; /* Resetting padding as already applied to .header */
}

/* --- Spotify Playlists Section (Height proportional to .right's available space) --- */
.spotifyPlaylists {
    box-sizing: border-box;
    flex-grow: 1; /* Allows this section to fill all available vertical space */
    width: 100%;
    display: flex; /* Make it a flex container */
    flex-direction: column; /* Stack its children (heading, carousel) vertically */
    flex-shrink: 0; /* Prevent this section from shrinking if other sections are too large */
    padding: 20px 0; /* Example padding, adjust as needed */
    min-height: 0; /* Important for flex-grow to work correctly with content */
}

.section-heading {
    position: relative;
    display: flex;
    justify-content: space-between;
    height: auto; /* Let content dictate height */
    align-items: center;
    padding: 0 10px 10px 10px; /* Adjusted padding-bottom for consistent gap */
    margin: 0;
    box-sizing: border-box;
    flex-shrink: 0; /* Prevents heading from shrinking if space is tight */
}

.section-heading h1 {
    position: relative;
    left: 0.6%;
    font-size: clamp(1.2rem, 2vw, 1.5rem); /* Responsive font size */
}

.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    flex-grow: 1; /* Allow carousel to fill remaining height of spotifyPlaylists */
    overflow: hidden; /* Prevents arrows from causing overflow */
    min-height: 0; /* Essential for flex-grow in a column layout */
}

.cardcontainer {
    position: relative;
    box-sizing: border-box;
    display: flex;
    width: 100%;
    height: auto; /* Let content define height */
    gap: 1%; /* Responsive gap between cards */
    overflow-x: auto; /* Allows horizontal scrolling */
    scroll-behavior: smooth;
    scrollbar-width: none;
    flex-shrink: 0; /* Ensure cardcontainer itself doesn't shrink vertically in carousel-wrapper */
    align-items: flex-start; /* Align cards to the top of cardcontainer's height */
    padding: 0 10px; /* Padding for cards within the carousel */
    flex-wrap: nowrap; /* Prevent wrapping to ensure horizontal scroll */
    margin-top: 10px; /* Adjusted top margin for consistent gap from heading */
}

/* Hide scrollbar in WebKit browsers */
.cardcontainer::-webkit-scrollbar {
    display: none;
}

/* --- Individual Card: Height responsive to its own width via aspect-ratio --- */
.card {
    position: relative;
    box-sizing: border-box;
    background-color: #181818;
    padding: 10px; /* Keep padding to create space around content */
    border-radius: 8px;
    overflow: hidden; /* Hides content outside border-radius */
    transition: background-color 0.4s ease-out;

    /* Flexible width using flex-basis, min-width, and max-width */
    flex: 0 0 180px; /* Base width: cards try to be 180px */
    min-width: 150px; /* Allow shrinking down to 150px */
    max-width: 250px; /* Allow growing up to 250px */

    /* THIS IS THE KEY: Card's height scales proportionally to its calculated width */
    aspect-ratio: 1 / 1.4; /* For every 1 unit of width, height is 1.4 units (taller than wide) */
    /* Adjust this ratio to control the card's overall shape */

    /* Internal layout to prevent overlap and distribute space */
    display: flex;
    flex-direction: column; /* Stack children vertically */
    justify-content: flex-start; /* Align content to the top */
    gap: 6px; /* Consistent spacing between internal elements (image, title, artists) */
    /* Remove fixed height to let aspect-ratio and content manage height */
    height: auto; /* Let aspect-ratio and content dictate height */
}

/* --- Image inside Card --- */
.card img {
    position: relative;
    width: 100%; /* Image takes 100% of card's content width */
    aspect-ratio: 1 / 1; /* Forces the image itself to be a perfect square */
    object-fit: cover;
    border-radius: 8px;
    display: block;
    flex-shrink: 0; /* Prevents image from shrinking (important for sizing consistency) */
}

/* --- Play Button inside Card --- */
.card .play-button {
    position: absolute; /* Absolute positioning relative to .card */
    bottom: 10px; /* Default position, will be overridden by media queries */
    right: 10px;
    width: 40px;
    height: 40px;
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.3s ease, transform 0.2s ease;
    pointer-events: auto;
    z-index: 2; /* Ensure it's above image/text */
}

.card:hover {
    background-color: #282828;
}

.card:hover .play-button {
    opacity: 1;
}

.card:hover img {
    opacity: 0.8;
    transition: opacity 0.3s ease-in-out;
}

.card .play-button:hover {
    transform: scale(1.2);
}

.card.hidden {
    display: none;
}

/* --- Card Title and Artists --- */
.card-title,
.card-artists {
    white-space: nowrap; /* Prevent text from wrapping */
    overflow: hidden; /* Hide overflowing text */
    text-overflow: ellipsis; /* Add "..." for overflowed text */
    flex-shrink: 0; /* Prevents text from shrinking, maintaining its size */
    color: white; /* Ensure title is white */
}

.card-artists {
    color: #b3b3b3; /* Ensure artists are grey */
}

.card-title {
    font-size: clamp(14px, 1.2vw, 15px); /* Responsive font size */
    font-weight: 600;
}

.card-artists {
    font-size: clamp(12px, 1vw, 13px); /* Responsive font size */
}

/* --- Carousel Arrows --- */
.left-arrow,
.right-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    font-size: 24px;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 2;
    border-radius: 4px;
}

.left-arrow:hover,
.right-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.left-arrow {
    left: 0; /* Aligned with container edge */
}

.right-arrow {
    right: 0; /* Aligned with container edge */
}

/* --- Horizontal Scrolling Card Containers (Artist, Radio, Album) --- */
.AlbumPlaylists {
    position: relative;
    top: 0; /* Set to 0 to rely on margin-top of card container */
}

.artist-card-container,
.radio-card-container,
.album-card-container {
    position: relative;
    display: flex;
    gap: 0px;
    overflow-x: auto; /* Allows horizontal scrolling */
    scroll-behavior: smooth;
    top: 0; /* Set to 0 to rely on margin-top */
    left: 11px;
    scrollbar-width: none; /* Firefox */
    box-sizing: border-box;
    width: 100%;
    flex-wrap: nowrap; /* Ensure they don't wrap */
    margin-top: 10px; /* Adjusted top margin for consistent gap from heading */
}

.artist-card-container::-webkit-scrollbar,
.radio-card-container::-webkit-scrollbar,
.album-card-container::-webkit-scrollbar {
    display: none; /* Webkit browsers */
}

/* Specific card flex-basis for these containers */
.artist-card-container .card,
.radio-card-container .card,
.album-card-container .card {
    /* These cards are slightly more fixed in width, but still responsive */
    flex: 0 0 180px; /* Cards try to be 180px */
    min-width: 150px; /* Prevent them from being too small */
    max-width: 250px; /* Prevent them from being too large */
    height: auto; /* Let aspect-ratio and content dictate height */
}

/* Individual artist cards (background transparent) */
.popular-artists {
    position: relative;
    top: 30px; /* Set to 0 to rely on margin-top of card container */
}

.card.artist-card {
    background-color: transparent; /* Override default card background */
    border-radius: 8px;
    text-align: center;
    padding: 10px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

/* Circular artist images */
.card.artist-card img {
    width: 100%; /* Take 100% of card's content width */
    height: auto; /* Height adapts to maintain aspect ratio */
    border-radius: 50%; /* Make circular */
    object-fit: cover;
    display: block;
    margin: 0 auto 12px auto;
    aspect-ratio: 1 / 1; /* Force square for the image */
}

.album-card .play-button {
    bottom: 75px; /* Specific position for album cards */
    right: 16px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease;
    width: 48px;
    height: 48px;
    pointer-events: auto;
}

/* Titles and artist labels (using flex gap) */
.card.artist-card .card-title {
    font-size: clamp(14px, 1.2vw, 16px);
    font-weight: 700;
    margin: 0; /* Rely on flex gap */
}

.card.artist-card .card-artists {
    font-size: clamp(12px, 1vw, 14px);
    color: #b3b3b3;
    margin: 0; /* Rely on flex gap */
}

.card.artist-card:hover {
    background-color: #181818;
}

/* --- Left Sidebar Navigation --- */
.home ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    padding: 14px 10px;
    font-weight: bold;
    font-size: 14px;
}

.heading {
    display: flex;
    gap: 15px;
    width: 100%;
    padding: 23px 14px;
    font-weight: bold;
    align-items: center;
    font-size: 13px;
}

.heading img {
    width: 30px;
}

.library {
    min-height: 80vh;
    position: relative;
}

.footer {
    display: flex;
    font-size: 10px;
    color: grey;
    gap: 13px;
    position: absolute;
    bottom: 0;
    padding: 10px 0;
}

.footer a {
    color: grey;
}

/* --- Music Player Container --- */
.player-bar {
    position: fixed; /* Stays in place */
    bottom: 0;
    /* On desktop, align with .right section */
    left: 25%;
    width: 75%;
    background-color: #171a0f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    color: white;
    z-index: 999; /* Changed z-index to be lower than popup-overlay */
    font-family: 'Roboto', sans-serif;
    height: var(--player-bar-height-desktop); /* Use variable for height */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    overflow: hidden; /* Prevent overflow */
    box-sizing: border-box; /* Include padding in height */
    transition: filter 0.3s ease-in-out; /* Added transition for blur */
}

/* --- Player Bar Sections (Adjusted for responsiveness) --- */
.player-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1; /* Allows it to grow/shrink */
    min-width: 0; /* Essential for flex items with text-overflow */
    max-width: 200px; /* Constrain max width for album section */
}

.player-left img {
    width: 100%;
    height: auto;
    max-width: 56px; /* Max size of album cover */
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.track-info {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1; /* Allow text to take space */
    min-width: 0; /* Important for ellipsis to work */
}

.track-title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 12px;
    color: #b3b3b3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-to-library {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 2; /* Allows it to grow/shrink more than left/right */
    max-width: 500px;
    min-width: 0;
}

.controls {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 300px; /* Max width for controls section */
    flex-shrink: 0; /* Controls don't shrink */
}

.controls button {
    background: none;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.controls button.play {
    background-color: white;
    color: black;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

.progress input[type="range"] {
    flex-grow: 1;
    height: 4px;
    background: #404040;
    appearance: none;
    border-radius: 2px;
}

.progress input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    height: 12px;
    width: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.time {
    font-size: 12px;
    color: #b3b3b3;
}

.player-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
    max-width: 300px;
    flex-shrink: 0;
}

.player-right input[type="range"] {
    width: 80px;
    height: 4px;
    background: #404040;
    appearance: none;
    border-radius: 2px;
}

.player-right input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    height: 12px;
    width: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* --- Album Overlay (Fixed position, positioned over .right content) --- */
.album-overlay {
    position: fixed;
    top: var(--top-bar-height-desktop); /* Starts below top-bar */
    left: 25%; /* Starts where .left ends */
    width: 75%; /* Matches .right width */
    /* Height fills space between top-bar and player-bar */
    height: calc(97.5vh - var(--top-bar-height-desktop) - var(--player-bar-height-desktop));
    background: #2e0e0e; /* Default background, will be dynamically set by JS for album art color */
    z-index: 999;
    display: none; /* Hidden by default */
    transition: all 0.3s ease-in-out;
    overflow-y: hidden; /* The direct container should not scroll, its content should */
    box-sizing: border-box;
}

.album-overlay.show {
    display: block; /* Make it visible */
}

.album-overlay-content {
    width: 100%;
    height: 100%; /* Fills the calculated height of the overlay */
    background: linear-gradient(to bottom, rgba(70, 9, 9, 0.8), #121212 50%); /* Gradient from image */
    padding: 20px;
    color: white;
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column; /* Stack children vertically */
    /* align-items: center; /* Removed to allow left alignment */
    overflow-y: auto; /* Allows internal content to scroll */
    overflow-x: hidden;
}

.album-overlay-content::-webkit-scrollbar {
    display: none;
}

.album-overlay-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.close-overlay {
    background-color: black;
    border: 1px solid white;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 7px;
    right: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 1000; /* Ensure close button is on top */
}

.close-overlay:hover {
    transform: scale(0.9);
}

.album-header {
    display: flex;
    gap: 20px;
    align-items: center; /* Changed from flex-start to center */
    margin-bottom: 20px;
    width: 100%; /* Ensure header takes full width */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: flex-start; /* Changed from center to flex-start */
    flex-shrink: 0; /* IMPORTANT: Prevents header from shrinking when content overflows */
    padding: 20px; /* Added padding to match image */
}

.album-cover {
    width: 180px; /* Increased size to match image */
    height: 180px; /* Increased size to match image */
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0; /* Prevent shrinking */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); /* Added shadow */
}

.album-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left; /* Changed from center to left */
    flex-grow: 1; /* Allows info to take available space */
}

.album-info .album-type {
    font-size: 14px;
    color: #b3b3b3;
    text-transform: uppercase;
    font-weight: bold;
}

.album-info h1 {
    font-size: clamp(28px, 4vw, 48px); /* Larger font size for title */
    font-weight: bold;
    margin: 0;
}

.album-info p {
    font-size: clamp(14px, 2vw, 16px); /* Responsive font size */
    color: #b3b3b3;
    margin: 0;
}

.album-buttons {
    display: flex; /* Ensure it's a flex container for the buttons */
    padding: 20px;
    gap: 15px; /* Increased gap */
    justify-content: flex-start; /* Changed from center to flex-start */
    align-items: center; /* Vertically align them */
    flex-wrap: wrap; /* Allow buttons to wrap on very small screens */
    flex-shrink: 0; /* IMPORTANT: Prevents button section from shrinking/scrolling away */
    width: 100%; /* Take full width of parent */
    margin-bottom: 20px; /* Added margin below buttons to separate from tracklist */
}

.album-tracklist {
    background-color: transparent; /* Changed to transparent to blend with overlay gradient */
    padding: 15px 25px;
    border-top: none; /* Removed border-top */
    width: 100%; /* Takes full width of parent */
    flex-grow: 1; /* IMPORTANT: Allows tracklist to fill remaining vertical space */
    overflow-y: auto; /* IMPORTANT: Makes only the tracklist scrollable */
}

.album-tracklist table {
    width: 100%;
    border-collapse: collapse;
}

/* Updated: Increased padding for better spacing */
.album-tracklist th,
.album-tracklist td {
    padding: 12px 15px; /* Increased padding for more vertical space */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Lighter, more subtle border */
    font-size: 16px; /* Slightly larger font */
    color: #ddd;
    text-align: left; /* Default to left alignment */
}

.album-tracklist th:first-child {
    width: 40px; /* Narrower for # */
    text-align: center;
}

/* Adjusted width for Title, Artist, and Duration columns */
.album-tracklist th:nth-child(2) { /* Title column */
    width: 40%; /* Allocate more space for title */
}

.album-tracklist th:nth-child(3) { /* Artist column */
    width: 30%; /* Allocate space for artist */
}

.album-tracklist th:last-child {
    width: 80px; /* Narrower for duration */
    text-align: right;
}

.album-tracklist td:first-child {
    text-align: center;
}

.album-tracklist td:last-child {
    text-align: right;
}

/* Updated: Hover effect for table rows */
.album-tracklist table tbody tr {
    transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease; /* Smooth transitions for hover */
}

.album-tracklist table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.15); /* More noticeable hover effect */
    transform: scale(1.01); /* Slightly enlarge on hover */
    color: white; /* Change text color to white on hover */
    cursor: pointer;
}

/* Styles for the currently playing track in the album overlay */
#albumDetails-tracks tr.playing td { /* Changed to albumDetails-tracks to match HTML */
    color: #1ED760; /* Green color for playing track */
    font-weight: bold;
}

#albumDetails-tracks tr.playing td:first-child { /* Changed to albumDetails-tracks to match HTML */
    position: relative; /* Needed for positioning the ::before pseudo-element */
    padding-left: 30px; /* Add padding to make space for the indicator */
    color: transparent; /* Hide the number when playing */
}

/* Updated: Playing indicator icon similar to image */
#albumDetails-tracks tr.playing td:first-child::before { /* Changed to albumDetails-tracks to match HTML */
    content: "";
    position: absolute;
    left: 10px; /* Position at the very left of the cell */
    top: 50%; /* Vertically center */
    transform: translateY(-50%); /* Initial transform for positioning */
    width: 16px; /* Width of the icon area */
    height: 16px; /* Height of the icon area (max height for bars) */
    display: flex;
    justify-content: space-between; /* Distribute bars horizontally */
    align-items: flex-end; /* Align bars to the bottom */
    overflow: hidden; /* Hide overflow if bars extend beyond */
    background: linear-gradient(to right,
        #1ED760 0%, #1ED760 25%, /* First bar */
        transparent 25%, transparent 37.5%, /* Gap */
        #1ED760 37.5%, #1ED760 62.5%, /* Second bar */
        transparent 62.5%, transparent 75%, /* Gap */
        #1ED760 75%, #1ED760 100% /* Third bar */
    );
    background-size: 100% 100%; /* Ensure gradient covers the area */
    animation: pulse-bars 1s infinite ease-in-out;
}

/* Removed the invalid nested pseudo-elements as they are not valid CSS */
/* Individual bars within the playing indicator are now simulated with linear-gradient on ::before */


@keyframes pulse-bars {
    0% {
        transform: translateY(-50%) scaleY(0.5);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-50%) scaleY(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50%) scaleY(0.5);
        opacity: 0.7;
    }
}


/* --- Hamburger Menu (Left) --- */
.hamburgerContainer {
    position: relative;
    top: -3px;
    left:-21px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex-shrink: 0; /* Prevent hamburger from shrinking */
}

.hamburgerContainer img,
.hamburgerContainer svg {
    width: 37px;
    height: 37px;
    transition: transform 0.2s;
}

.hamburgerContainer img:hover,
.hamburgerContainer svg:hover {
    transform: scale(1.2);
}

/* --- Search Box Styling (Responsive) --- */
.search-box {
    display: flex;
    align-items: center;
    background-color: #2a2a2a;
    border-radius: 50px;
    padding: 6px 12px;
    flex-grow: 1; /* Allows it to grow in the top-bar */
    max-width: 500px; /* Max width for larger screens */
    min-height: 40px;
    box-sizing: border-box;
    overflow: hidden;
    transition: all 0.2s ease; /* Added transition for hover effect */
}

.search-box:focus-within { /* Added focus-within for a more interactive feel */
    background-color: #3a3a3a;
    box-shadow: 0 0 0 2px #1ED760; /* Green border on focus */
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #ddd;
    font-size: clamp(14px, 1.5vw, 18px); /* Responsive font size */
    flex-grow: 1;
    padding: 6px;
    margin: 0 10px;
    word-wrap: break-word;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.search-box .search-icon img {
    width: clamp(16px, 1.5vw, 24px); /* Responsive icon size */
    filter: invert(1);
    flex-shrink: 0;
}

/* --- Buttons --- */
.buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.signupbtn,
.loginbtn {
    font-size: 16px;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease; /* Consistent transition */
}

.signupbtn::after { /* Stylish underline on hover */
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #1ED760;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.signupbtn:hover::after {
    width: 100%;
}

.loginbtn {
    font-weight: bold;
    background: white;
    color: black;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow for button */
}

.signupbtn:hover {
    color: white;
}

.loginbtn:hover {
    background: #f0f0f0;
    color: black;
    transform: translateY(-2px); /* Lift effect on hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Enhanced shadow */
}

/* --- Default state for .close-btn (hidden on desktop) --- */
.close-btn {
    display: none; /* Hidden by default on all screen sizes */
    position: absolute; /* Keep absolute position relative to sidebar */
    top: 10px; /* Adjust as needed */
    right: 10px; /* Adjust as needed */
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10001; /* Ensure it's above the sidebar content and everything else */
}

.close-btn:hover {
    transform: scale(1.1);
}


/* --- Responsive Media Queries --- */

/* Tablet & Smaller Screens (max-width: 768px) */
@media screen and (max-width: 768px) {
    /* Sidebar (JS controlled) */
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 260px;
        /* Calculate height to span between top and player bars */
        height: 100vh;
        background-color: #121212; /* Darker background for distinct look */
        z-index: 10000; /* Higher than player-bar (9999) */
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4); /* Shadow for opened sidebar */
        /* Padding to ensure content starts below top-bar and ends above player-bar (if content reaches those edges) */
        padding-top: var(--top-bar-height-tablet);
        padding-bottom: var(--player-bar-height-tablet);
        box-sizing: border-box; /* Include padding in height calculation */

        /* NEW: Make sidebar a flex container and hide its own scrollbar */
        display: flex;
        flex-direction: column;
        overflow-y: hidden; /* Prevent the sidebar itself from having a scrollbar */
    }

    .sidebar.open {
        left: 0;
    }

    /* Close button for sidebar - explicitly visible on tablet/mobile */
    .close-btn {
        display: block; /* Make it visible on small screens */
    }

    /* Right content area when sidebar is open/closed */
    .right {
        width: 100%; /* Take full width when sidebar is hidden */
        transition: transform 0.3s ease;
        padding-top: var(--top-bar-height-tablet); /* Adjust padding based on new top-bar height */
        /* Increased padding-bottom to ensure content is not hidden under the player bar */
        padding-bottom: calc(var(--player-bar-height-tablet) + 150px); /* Increased buffer for tablet */
        margin-left: 0; /* No margin-left on tablet/mobile as left sidebar is hidden/overlay */
        overflow-y: auto; /* Allow scrolling */
        -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }

    .right::-webkit-scrollbar { /* Hide scrollbar for WebKit browsers */
        display: none;
    }

    .right.shifted {
        transform: translateX(260px);
    }

    /* Overlay for sidebar (JS controlled) */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998; /* Below sidebar, above everything else */
        display: none;
    }

    .overlay.show {
        display: block;
    }
    /* Adjust top-bar for tablet */
    .top-bar {
        left: 0; /* Spans full width of viewport */
        width: 100%;
        height: var(--top-bar-height-tablet); /* Using new tablet height */
        padding: 8px 15px; /* Slightly reduced padding for tablet */
        border-radius: 0 0 20px 20px; /* Slightly less rounded for tablet */
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    }

    /* Internal Header */
    .header {
        top: var(--top-bar-height-tablet); /* Stick below tablet top-bar */
        padding: 15px; /* Slightly less padding */
    }

    .search-box {
        width: calc(100% - 140px); /* Adjust width to make space for other elements */
        min-height: 36px;
    }

    .search-box input {
        font-size: clamp(12px, 2vw, 16px);
    }

    .search-box .search-icon img {
        width: clamp(14px, 2vw, 20px);
    }

    /* Player bar for tablet */
    .player-bar {
        height: var(--player-bar-height-tablet);
        left: 0; /* Full width on tablet */
        width: 100%; /* Full width on tablet */
        z-index: 999; /* Ensure player bar is below the open sidebar but above content */
    }

    .player-left img {
        width: 48px;
        height: 48px;
    }

    .track-info {
        gap: 2px;
    }

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

    .track-artist {
        font-size: 10px;
    }

    .controls {
        gap: 12px;
    }

    .controls button {
        font-size: 16px;
    }

    .progress {
        gap: 8px;
    }

    .player-right input[type="range"] {
        width: 60px;
    }

    /* Album overlay for tablet */
    .album-overlay {
        top: var(--top-bar-height-tablet);
        left: 0; /* Full width on tablet */
        width: 100%;
        height: calc(96vh - var(--top-bar-height-tablet) - var(--player-bar-height-tablet));
    }

    .album-header {
        flex-wrap: wrap;
        justify-content: center;
        padding: 15px;
        text-align: center;
    }

    .album-cover {
        max-width: 120px;
        height: auto;
        min-width: 80px;
    }

    .album-info h1 {
        font-size: 18px;
    }

    .album-info p {
        font-size: 14px;
    }

    .album-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .album-buttons button {
        font-size: 14px;
        padding: 8px 16px;
    }

    .album-tracks table {
        font-size: 14px;
    }

    /* Card adjustments for tablet */
    .card {
        min-width: 130px; /* Base for cards */
        flex: 0 0 130px; /* Prefer 130px, no shrinking from basis */
        max-width: 160px;
        padding: 8px; /* Slightly less padding */
    }

    .card .play-button {
        width: 32px; /* Slightly smaller play button */
        height: 32px;
        bottom: 8px; /* Adjusted to be more visible */
        right: 8px;
    }

    .card-title {
        font-size: 13px; /* Slightly smaller font */
    }

    .card-artists {
        font-size: 11px; /* Slightly smaller font */
    }

    /* Adjustments for artist cards on tablet */
    .card.artist-card {
        min-width: 120px; /* Slightly smaller for artists */
        flex: 0 0 120px;
    }

    /* NEW: Library and Footer adjustments for tablet sidebar */
    .library {
        min-height: auto; /* Remove fixed min-height */
        flex-grow: 1; /* Allow library to take available vertical space */
        overflow-y: auto; /* Allow content inside library to scroll if it overflows */
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }

    .library::-webkit-scrollbar { /* Webkit browsers */
        display: none;
    }

    .footer {
        position: relative; /* Change from absolute to relative to flow with flex */
        margin-top: auto; /* Pushes the footer to the bottom */
        flex-shrink: 0;
    }
}

/* Mobile Screens (max-width: 480px) */
@media (max-width: 480px) {
    /* Adjust top-bar for mobile */
    .top-bar {
        height: var(--top-bar-height-mobile); /* Using new mobile height */
        padding: 6px 10px; /* Further reduced padding for mobile */
        border-radius: 0 0 15px 15px; /* Less rounded for mobile */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .left{
        height: 100vh;
    }

    .hamburgerContainer img,
    .hamburgerContainer svg {
        width: 20px;
        height: 20px;
    }

    /* Right content area */
    .right {
        padding-top: var(--top-bar-height-mobile);
        /* Increased padding-bottom to ensure content is not hidden under the player bar */
        padding-bottom: calc(var(--player-bar-height-mobile) + 150px); /* Increased buffer for mobile */
        overflow-y: auto; /* Allow scrolling */
        -ms-overflow-style: none; /* Hide scrollbar for IE/Edge */
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }

    .right::-webkit-scrollbar { /* Hide scrollbar for WebKit browsers */
        display: none;
    }

    /* Internal Header */
    .header {
        top: var(--top-bar-height-mobile); /* Stick below mobile top-bar */
        padding: 10px; /* Further reduced padding */
    }

    .search-box {
        position: relative;
        left:-12px;
        
        width: calc(100% - 100px);
        min-height: 32px;
        margin-right: -30px;
    }

    .search-box input {
        font-size: clamp(10px, 2.5vw, 14px);
    }

    .search-box .search-icon img {
        width: clamp(12px, 2.5vw, 18px);
    }

    .signupbtn,
    .loginbtn {
        font-size: 12px;
        padding: 4px 8px;
    }

    /* Player bar for mobile */
    .player-bar {
        height: var(--player-bar-height-mobile);

        left: 0; /* Full width on mobile */
        width: 100%; /* Full width on mobile */
        padding: 0 10px; /* Reduced padding for mobile */
        flex-wrap: wrap; /* Allow elements to wrap if needed */
        justify-content: center; /* Center content horizontally */
    }

    .player-left {
        position: relative;
        top:2px;
        width: 100%; /* Take full width */
        justify-content: center; /* Center items */
        margin-bottom: -24px; /* Space between sections */
    }

    .player-left img {
        width: 40px;
        height: 40px;
    }

    .track-info {
        text-align: center;
        flex-grow: 0; /* Don't grow too much */
        width: auto; /* Let content define width */
    }

    .track-title {
        font-size: 11px;
    }

    .track-artist {
        font-size: 9px;
    }

    .add-to-library {
        display: none; /* Hide for very small screens */
    }

    .player-center {
        width: 100%; /* Take full width */
        order: 3; /* Place below left and right sections */
        margin-top: 4px;
    }

    .controls {
        position: relative;
        top:-17px;
        gap: 10px;
    }

    .controls button {
        font-size: 14px;
    }

    .controls button.play {
        width: 28px;
        height: 28px;
    }

    .progress {
        position: relative;
        width: 90%; /* Adjust width for progress bar */
        margin-top: -12px;
        left:-60px;
    }

    .time {
        font-size: 10px;
    }

    .player-right {
        width: 100%; /* Take full width */
        justify-content: center; /* Center items */
        margin-top: -36px;
    }

    .player-right input[type="range"] {
        width: 50px;
    }

    /* Album overlay for mobile */
    .album-overlay {
        top: var(--top-bar-height-mobile);
        height: calc(92vh - var(--top-bar-height-mobile) - var(--player-bar-height-mobile));
    }

    .album-overlay-content {
        padding: 10px;
    }

    .album-header {
        flex-direction: column; /* Stack image and info vertically */
        align-items: center; /* Center items */
        gap: 10px;
        margin-bottom: 15px;
    }

    .album-cover {
        width: 100px;
        height: 100px;
    }

    .album-info h1 {
        font-size: 16px;
    }

    .album-info p {
        font-size: 11px;
    }

    .album-buttons {
        gap: 8px;
        padding: 10px;
    }

    .album-buttons button {
        font-size: 12px;
        padding: 6px 12px;
    }

    .album-tracks table {
        font-size: 14px;
    }

    /* Card adjustments for mobile - increased size slightly */
    .card {
        min-width: 110px; /* New minimum for mobile */
        flex: 0 0 110px;
        max-width: 140px;
        padding: 6px; /* Reduced padding */
    }

    .card .play-button {
        width: 28px; /* Corrected from 25px */
        height: 28px; /* Corrected from 25px */
        bottom: 6px;
        right: 6px;
    }

    .card-title {
        font-size: 12px; /* Corrected from 11px */
    }

    .card-artists {
        font-size: 10px; /* Corrected from 9px */
    }
    /* Further adjustment for artist cards on mobile */
    .card.artist-card {
        min-width: 100px; /* Slightly larger for artists */
        flex: 0 0 100px;
    }

    /* Sidebar for mobile - Adjust height and z-index */
    .sidebar {
        height: 100vh;
        padding-top: var(--top-bar-height-mobile);
        padding-bottom: var(--player-bar-height-mobile);
        /* NEW: Make sidebar a flex container and hide its own scrollbar */
        display: flex;
        flex-direction: column;
        overflow-y: hidden; /* Prevent the sidebar itself from having a scrollbar */
    }

    /* Ensure close button is explicitly block for mobile */
    .close-btn {
        display: block;
        font-size: 24px; /* Slightly smaller for mobile if 30px is too big */
        width: 30px; /* Example: make it square */
        height: 30px;
        line-height: 30px; /* Center content vertically */
        text-align: center;
    }

    /* NEW: Library and Footer adjustments for mobile sidebar */
    .library {
        min-height: auto; /* Remove fixed min-height */
        flex-grow: 1; /* Allow library to take available vertical space */
        overflow-y: auto; /* Allow content inside library to scroll if it overflows */
        -ms-overflow-style: none; /* IE and Edge */
        scrollbar-width: none; /* Firefox */
    }

    .library::-webkit-scrollbar { /* Webkit browsers */
        display: none;
    }

    .footer {
        position: relative; /* Change from absolute to relative to flow with flex */
        margin-top: auto; /* Pushes the footer to the bottom */
        flex-shrink: 0;
    }
}

/* Adjustments for very small screens to ensure visibility */
@media (max-width: 320px) {
    .search-box input {
        font-size: 10px;
    }
    .search-box .search-icon img {
        width: 12px;
    }
    .buttons {
        gap: 4px;
    }
    .signupbtn,
    .loginbtn {
        font-size: 10px;
        padding: 3px 6px;
    }
    .card {
        /* Further adjustment for very small screens */
        min-width: 95px; /* Minimum card width */
        flex: 0 0 95px;
        padding: 4px;
    }
    .card .play-button {
        width: 22px; /* Smallest play button */
        height: 22px;
        bottom: 4px;
        right: 4px;
    }
    .card-title {
        font-size: 9px;
    }
    .card-artists {
        font-size: 7px;
    }
    /* Further adjustment for artist cards on very small screens */
    .card.artist-card {
        min-width: 85px;
        flex: 0 0 85px;
    }
}

/* --- Specific Styles for Album Overlay Buttons --- */
.album-buttons {
    /* These styles were already good, just re-included in the full set */
    display: flex;
    padding: 20px;
    gap: 10px;
    justify-content: flex-start; /* Changed to flex-start */
    align-items: center; /* Vertically align them */
    flex-wrap: wrap; /* Allow wrapping on very small screens */
}

#album-play {
    background-color: #1ED760;
    color: #1c0202;
    border: none;
    padding: 0;
    border-radius: 50%;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 56px; /* Increased size to match image */
    height: 56px; /* Increased size to match image */
    position: relative;
    z-index: 2; /* Ensure it's above potential background elements within album-overlay-content */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Added shadow */
}

.btn1,
.btn2 {
    background-color: transparent; /* Changed to transparent */
    color: #b3b3b3; /* Changed color to match image */
    border: 1px solid #b3b3b3; /* Changed border to match image */
    padding: 0;
    border-radius: 50%;
    font-size: 24px; /* Slightly smaller */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 38px; /* Adjusted size */
    height: 38px; /* Adjusted size */
    position: relative;
    z-index: 2; /* Ensure it's above potential background elements within album-overlay-content */
}

.btn1:hover,
.btn2:hover {
    transform: scale(1.1);
    color: white; /* Hover color to white */
    border-color: white; /* Hover border to white */
}

.btn3 {
    padding: 0;
    background-color: transparent; /* Changed to transparent */
    border: none; /* No border for this button */
    color: #b3b3b3; /* Changed color to match image */
    font-size: 24px; /* Adjusted size */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    height: 38px; /* Adjusted size */
    width: 38px; /* Adjusted size */
    transition: all 0.3s ease;
    position: relative;
}

.btn3:hover {
    transform: scale(1.1);
    color: white; /* Hover color to white */
}

#album-play:hover {
    transform: scale(1.05); /* Slightly less aggressive scale on hover */
    background-color: #1db954;
}

/* --- Search Box Hover Effect --- */
.search-box:hover {
    transform: scale(1.02);
    background-color: rgb(66, 66, 66);
}

/* --- Track Highlight for Search --- */
.highlighted {
    background-color: rgba(30, 215, 96, 0.2);
    border-left: 3px solid #1ED760;
}

/* Ensure the 'playing' class overrides or works with 'highlighted' if needed */
#albumDetails-tracks tr.playing { /* Target the row for playing state */
    background-color: rgba(30, 215, 96, 0.1); /* Subtle green background for playing row */
}

#albumDetails-tracks tr.playing td {
    color: #1ED760; /* Green color for playing track text */
    font-weight: bold;
}

/* For visual clarity, you might want to adjust the highlighted background if it's also playing */
#albumDetails-tracks tr.playing.highlighted {
    background-color: #1ED760; /* Solid green if both playing and highlighted */
    color: black; /* Text color becomes black for contrast */
}

/* style.css */

/* 1. Target the main album overlay content area */
.album-details {
    /* Removed padding-top and padding-bottom !important to allow album-overlay-content padding to apply */
    width: 100%;
}

/* 2. Target the album header within the overlay */
.album-details .album-header {
    /* Removed margin-bottom and padding-bottom !important */
    margin-bottom: 20px; /* Re-added margin for spacing below header */
    padding-bottom: 0; /* Keep padding-bottom 0 if it's internal to the header, rely on margin-bottom for external spacing */
}

/* 3. Target the dedicated container for full HTML embeds */
#album-full-embed-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: none;
    border-radius: 12px;
    background-color: transparent;
    z-index: 10;
    margin-top: 0px;
}

/* 4. Target the iframe directly inside the embed container */
#album-full-embed-container iframe {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block;
    border: none;
}

/* 5. Adjust the album-tracks section if it's still visible and causing issues */
.album-tracks {
    margin-top: 0 !important;
    padding-top: 0 !important;
}



body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
    /* Crucial: Prevents body scrolling when popup is active */
    overflow: hidden;
}

header, main {
    padding: 20px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Pop-up Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 0;
    box-sizing: border-box;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Pop-up Container */
.popup-container {
    background-color: #282828; /* Will be overridden to #000 for mobile */
    border-radius: 8px; /* Will be overridden to 0 for mobile */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 480px; /* Default max-width for smaller desktops/tablets */
    position: relative; /* Essential for absolute positioning of screens */
    box-sizing: border-box;
    min-height: 200px;
    height: auto; /* Let content dictate height, within max-height */
    max-height: 100vh; /* Default max-height */
    overflow: hidden; /* Crucial to hide sliding content outside */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Screen management */
.popup-screen {
    position: absolute; /* All screens are absolutely positioned within the container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Take full height of container */
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Default, overridden for mobile */
    align-items: center;
    /* Enhanced transition for smooth slide and fade */
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    opacity: 0;
    pointer-events: none; /* Inactive screens are not interactive */
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling for content that overflows */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    transform: translateX(100%); /* Inactive screens start off-screen to the right */
    z-index: 0; /* Default z-index for inactive screens */
}

.popup-screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0); /* Active screen slides into view */
    z-index: 1; /* Bring active screen to the front */
    flex-grow: 1; /* Allows content to expand within the screen */
    /* Removed position: static; to ensure consistent absolute positioning for transitions */
}

/* Close Button */
.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #fff; /* Changed to white for better visibility */
    font-size: 28px; /* Larger font size */
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
    font-weight: bold; /* Made bold */
}

.close-button:hover {
    color: #ccc;
}

/* Common Styles for Pop-up Content */
.popup-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-grow: 1;
    min-height: 0;
}

.popup-content h2 {
    font-size: 32px; /* Increased font size */
    margin-bottom: 30px;
    color: #fff; /* Changed to white */
    line-height: 1.2;
    text-align: center;
    flex-shrink: 0;
    font-weight: bold; /* Made bold */
}

/* Logo (Swarify logo, referenced by .log2 img in HTML) */
.log2 img {
    width: 110px; /* Default size */
    margin-bottom: 30px;
    flex-shrink: 0;
}

/* Album art (on initial screen) */
.album-art-placeholder {
    width: 180px;
    height: 180px;
    background-color: #292727;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.album-art-image {
    width: 100%;
    height: 100%;
    border-radius:150px;
    object-fit: cover;
    display: block;
}

/* Auth Buttons (Google, Facebook, Apple, Phone) */
.auth-button {
    width: 100%;
    padding: 18px 20px; /* Increased padding */
    margin-bottom: 15px;
    border: 1px solid #878787;
    border-radius: 50px;
    background-color: transparent;
    color: #fff; /* Changed to white */
    font-size: 19px; /* Increased font size */
    font-weight: bold; /* Made bold */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    text-align: center;
    min-height: 55px; /* Increased min-height */
    box-sizing: border-box;
    flex-shrink: 0;
}

.auth-button:hover {
    border-color: #fff;
    background-color: #3e3e3e;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.auth-button .logo-placeholder {
    margin-right: 15px;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

/* Specific Google Button Styling */
.auth-button.google-button {
    background-color: transparent;
    color: #fff;
    border: none;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 55px; /* Increased min-height */
    border-radius: 50px;
}

.g_id_signin {
    width: 100% !important;
    min-height: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 0 !important;
}

.g_id_signin > div {
    width: 100% !important;
    border-radius: 50px !important;
    box-sizing: border-box;
}

.g_id_signin iframe {
    width: 100% !important;
    border-radius: 50px !important;
    background-color: transparent !important;
    box-sizing: border-box;
}

/* Separator */
.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: #fff; /* Changed to white */
    width: 100%;
    flex-shrink: 0;
    font-weight: bold; /* Made bold */
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #535353;
}

.separator:not(:empty)::before {
    margin-right: .25em;
}

.separator:not(:empty)::after {
    margin-left: .25em;
}

/* Input Group */
.input-group {
    text-align: left;
    margin-bottom: 20px;
    width: 100%;
    flex-shrink: 0;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 17px; /* Increased font size */
    color:#fff; /* Changed to white */
    font-weight: bold; /* Made bold */
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="tel"],
.input-group input[type="password"],
.input-group input[type="date"] {
    width: 100%;
    padding: 15px 15px; /* Increased padding */
    border: 1px solid #535353;
    border-radius: 4px;
    background-color: #0d0c0c;
    color: #fff; /* Changed to white */
    font-size: 18px; /* Increased font size */
    box-sizing: border-box;
    font-weight: bold; /* Made bold */
}

.input-group input[type="text"]::placeholder,
.input-group input[type="email"]::placeholder,
.input-group input[type="tel"]::placeholder,
.input-group input[type="password"]::placeholder {
    color: #b3b3b3;
}

.input-group input[type="text"]:focus,
.input-group input[type="email"]:focus,
.input-group input[type="tel"]:focus,
.input-group input[type="password"]:focus,
.input-group input[type="date"]:focus {
    outline: none;
    border-color: #1DB954;
}

/* Main Buttons (Green and Transparent) */
.main-button {
    width: 100%;
    padding: 16px 20px; /* Increased padding */
    border: none;
    border-radius: 50px;
    font-size: 20px; /* Increased font size */
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 20px;
    min-height: 55px; /* Increased min-height */
    box-sizing: border-box;
    flex-shrink: 0;
}

.main-button:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.green-button {
    background-image: linear-gradient(to right, #cf5151, #1d8d8f);
    color: #fff; /* Changed to white */
}

.green-button:hover {
    background-image: linear-gradient(to right, #e06060, #229ea0); /* Slightly stronger gradient on hover */
}

.transparent-button {
    background-color: transparent;
    border: 1px solid #878787;
    color: #fff; /* Changed to white */
    margin-top: 15px;
    font-size: 18px; /* Increased font size */
    font-weight: bold; /* Made bold */
    flex-shrink: 0;
}

.transparent-button:hover {
    border-color: #fff;
    background-color: #3e3e3e;
}

/* Small Text and Links */
.small-text {
    font-size: 16px; /* Increased font size */
    color: #ccc; /* Slightly lighter grey for contrast */
    margin-top: 20px;
    line-height: 1.4;
    text-align: center;
    flex-shrink: 0;
    padding-bottom: 0;
    font-weight: bold; /* Made bold */
}

.small-text a {
    color: #fff; /* Changed to white */
    text-decoration: none;
    transition: color 0.3s ease;
}

.small-text a:hover {
    color: #1DB954;
    text-decoration: underline;
}

/* Initial Choice Screen Specifics */
.initial-choice-screen {
    background-color: #000; /* Will be overridden to #000 for mobile */
    padding: 40px;
    justify-content: center;
    align-items: center;
}

.initial-choice-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    flex-grow: 1;
    justify-content: center;
    min-height: 0;
}

.initial-choice-text h2 {
    font-size: 28px; /* Increased font size */
    margin-bottom: 15px;
    color: #fff; /* Changed to white */
    line-height: 1.3;
    text-align: center;
    flex-shrink: 0;
    font-weight: bold; /* Made bold */
}

/* Prev Button */
.prev-button {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    color: #fff; /* Changed to white */
    font-size: 28px; /* Larger font size */
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
    font-weight: bold; /* Made bold */
}

.prev-button:hover {
    color: #ccc;
}

/* Specific styling for the header with back button (used in create-password-screen) */
.header-with-back {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
    position: relative;
    flex-shrink: 0;
}

.header-with-back .prev-button {
    position: static;
    margin-right: 15px;
    color: #fff; /* Changed to white */
}

.header-with-back h2 {
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

/* ====================================
    Media Queries for Responsiveness
    ==================================== */

/* For Desktops */
@media (min-width: 769px) {
    .popup-container {
        width: 62vw; /* Increased max-width for desktop */
     /* Let content dictate height */
        height: 75vh; /* Ensure it doesn't exceed 90% of viewport height */
    }
    .popup-screen {
        overflow-y: auto; /* Enable scrolling for desktop screens */
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }
}


/* For Tablets and iPads (Portrait and Landscape) */
@media (max-width: 768px) {
    .popup-container {
        width: 90%;
        max-width: 480px;
        background-color: #0b0b0b;
       /* Let content dictate height */
    height: 91vh; /* Ensure it doesn't exceed 90% of viewport height */
    }

    .popup-screen {
        padding: 25px;
        justify-content: flex-start; /* Changed to flex-start for tablets to allow more space at top */
        overflow-y: auto; /* Changed to auto to allow scrolling */
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    .popup-content {
        justify-content: flex-start; /* Changed to flex-start for tablets */
    }

    .popup-content h2 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .log2 img {
        width: 80px;
        margin-bottom: 20px;
    }

    .auth-button, .main-button {
        padding: 14px 18px;
        font-size: 17px;
        min-height: 50px;
        margin-bottom: 10px;
    }
    .main-button {
        margin-top: 15px;
    }
    .transparent-button {
        margin-top: 10px;
    }

    .separator {
        margin: 20px 0;
    }

    .input-group {
        margin-bottom: 15px;
    }

    .input-group label {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .input-group input {
        padding: 12px 12px;
        font-size: 17px;
    }

    .initial-choice-screen {
        padding: 25px;
    }

    .album-art-placeholder {
        width: 150px;
        height: 150px;
    }

    .initial-choice-text h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .small-text {
        font-size: 15px;
        margin-top: 10px;
    }

    .close-button {
        font-size: 26px;
        top: 58px; /* Increased top for tablets */
        right: 25px; /* Increased right for tablets */
    }
    .prev-button {
        font-size: 40px;
        top: 47px; /* Increased top for tablets */
        left: 25px; /* Increased left for tablets */
    }
    .header-with-back {
        margin-bottom: 20px;
    }
    .header-with-back .prev-button {
        margin-right: 10px;
    }
    .header-with-back h2 {
        font-size: 28px;
    }
}

/* For Mobile Devices (Phones) */
@media (max-width: 480px) {
    .popup-overlay {
        background-color: rgba(0, 0, 0, 1); /* Solid black background for full screen */
    }

    .popup-container {
        width: 100%;
        height: 76vh; /* Take entire screen height */
        max-width: none; /* Remove max-width restriction */
        max-height: none; /* Remove max-height restriction */
        border-radius: 0; /* No border-radius for full screen */
        background-color: #000; /* Dark black background */
        padding-top: 60px; /* Increased padding to the top of the container for buttons */
    }

    .popup-screen {
        padding: 15px; /* Adjusted padding to give more content space while fitting */
        height: 100%; /* Ensure screen takes full height */
        justify-content: flex-start; /* Changed to flex-start to allow content to flow from top */
        overflow-y: auto; /* Changed to auto to allow scrolling */
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    .close-button {
        font-size: 28px;
        top: 58px; /* Adjusted position to be more visible */
        right: 15px; /* Adjusted position */
        color: #fff;
    }

    .prev-button {
        font-size: 40px;
        top: 44px; /* Adjusted position to be more visible */
        left: 15px; /* Adjusted position */
        color: #fff;
    }

    .popup-content h2 {
        font-size: 28px; /* Increased font size for mobile */
        margin-bottom: 12px; /* Adjusted margin */
        color: #fff;
    }

    .log2 img {
        width: 70px;
        margin-bottom: 12px; /* Adjusted margin */
    }

    .auth-button, .main-button {
        padding: 12px 15px; /* Adjusted padding */
        font-size: 17px; /* Adjusted font size */
        min-height: 48px; /* Adjusted min-height */
        margin-bottom: 6px; /* Adjusted margin */
    }
    .main-button {
        margin-top: 8px; /* Adjusted margin */
    }
    .transparent-button {
        margin-top: 6px; /* Adjusted margin */
    }

    .separator {
        margin: 12px 0; /* Adjusted margin */
        font-size: 15px; /* Adjusted font size */
    }

    .input-group {
        margin-bottom: 10px; /* Adjusted margin */
    }

    .input-group label {
        font-size: 15px; /* Adjusted font size */
        margin-bottom: 4px; /* Adjusted margin */
    }

    .input-group input {
        padding: 9px 10px; /* Adjusted padding */
        font-size: 15px; /* Adjusted font size */
    }

    .initial-choice-screen {
        padding: 15px;
    }

    .album-art-placeholder {
        width: 150px;
        height: 150px;
    }

    .initial-choice-text h2 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .small-text {
        font-size: 13px; /* Adjusted font size */
        margin-top: 8px;
    }

    .header-with-back {
        margin-bottom: 15px;
    }
    .header-with-back .prev-button {
        margin-right: 10px;
        font-size: 24px;
    }
    .header-with-back h2 {
        font-size: 28px;
    }
    .prev-button {
        font-size: 41px;
        top: -5px;
        left: 15px;
        font-weight: bold;/* Pushed further to the left */
    }
    .close-button {
        font-size: 24px;
        top: 2px;
        right: 15px; /* Pushed further to the right */
    }
    .voice-search-icon {
        position: relative;
        left:-5px;
    }
}
@media (max-width: 345px) {
    .voice-search-icon {
        position: relative;
        left:-37px;
    }
}
/* For even smaller mobile devices (e.g., iPhone SE) */
@media (max-width: 375px) {
    .popup-container {
        padding-top: 55px; /* Adjusted padding for smaller screens */
    }
    .popup-screen {
        padding: 10px; /* Further reduced padding */
    }

    .popup-content h2 {
        font-size: 24px; /* Adjusted font size */
        margin-bottom: 10px;
    }

    .log2 img {
        width: 60px;
        margin-bottom: 10px;
    }

    .auth-button, .main-button {
        font-size: 15px; /* Adjusted font size */
        padding: 10px 10px;
        min-height: 42px; /* Adjusted min-height */
        margin-bottom: 5px;
    }
    .main-button {
        margin-top: 6px;
    }
    .transparent-button {
        margin-top: 5px;
    }

    .separator {
        margin: 10px 0;
        font-size: 13px;
    }

    .input-group {
        margin-bottom: 8px;
    }

    .input-group label {
        font-size: 13px;
        margin-bottom: 3px;
    }

    .input-group input {
        padding: 8px 8px;
        font-size: 14px;
    }

    .initial-choice-screen {
        padding: 10px;
    }

    .album-art-placeholder {
        width: 120px;
        height: 120px;
    }

    .initial-choice-text h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .small-text {
        font-size: 11px;
        margin-top: 6px;
    }

    /* Adjusted positioning for prev and close buttons for smaller mobile screens */
    .close-button {
        font-size: 24px;
        top: 2px;
        right: 15px; /* Pushed further to the right */
    }
    .prev-button {
        font-size: 41px;
        top: -5px;
        left: 15px;
        font-weight: bold;/* Pushed further to the left */
    }
    .header-with-back {
        margin-bottom: 10px;
    }
    .header-with-back .prev-button {
        font-size: 22px;
    }
    .header-with-back h2 {
        font-size: 24px;
    }
    .voice-search-icon {
        position: relative;
        left:-15px;
    }
}


/* For the custom message box */
.custom-message-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 1.1em; /* Increased font size */
}

.custom-message-box.active {
    opacity: 1;
    visibility: visible;
}

.custom-message-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.8em; /* Increased font size */
    cursor: pointer;
    margin-left: 15px;
    padding: 0 5px;
}

/* Tailwind-like classes for message box (add these to your utility.css or style.css) */
.bg-green-600 { background-color: #22c55e; }
.bg-red-600 { background-color: #ef4444; }
.bg-blue-600 { background-color: #3b82f6; }
.invisible { visibility: hidden; }
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }

/* For the user avatar and dropdown */
.user-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    z-index: 20;
    width: 45px; /* Slightly larger avatar */
    height: 45px;
    border-radius: 50%;
    background-color: #1ED760;
    color: black;
    font-weight: bold;
    font-size: 1.3em; /* Increased font size */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    border: 3px solid black;
}

.user-avatar-container:hover {
    background-color: #1AA34A;
    transform: scale(1.05);
}

/* NEW: User Avatar Tooltip for hover */
.user-avatar-tooltip {
    position: fixed;
    background-color: #282828;
    color: #fff;
    padding: 10px 15px; /* Increased padding */
    border-radius: 6px;
    font-size: 1em; /* Increased font size */
    white-space: nowrap;
    z-index: 100;
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, transform 0.2s ease-in-out;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    font-weight: bold; /* Made bold */
}

.user-avatar-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-120%);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #282828;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 12px; /* Increased padding */
    min-width: 200px; /* Slightly wider */
    display: flex;
    flex-direction: column;
    gap: 10px; /* Increased gap */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-username {
    color: #fff; /* Changed to white */
    font-size: 1.1em; /* Increased font size */
    padding: 5px 0;
    border-bottom: 1px solid #404040;
    margin-bottom: 5px;
    text-align: center;
    font-weight: bold;
}

.dropdown-logout-btn {
    background-color: #404040;
    color: white;
    border: none;
    padding: 10px 15px; /* Increased padding */
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em; /* Increased font size */
    font-weight: bold;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-align: center;
}

.dropdown-logout-btn:hover {
    background-color: #535353;
    color: #1DB954;
}

/* For the login/signup buttons in the top bar */
.top-bar .buttons .signupbtn,
.top-bar .buttons .loginbtn {
    display: block;
}


/* General utility classes for hiding elements */
.hidden {
    display: none !important;
}


/* User Avatar and Dropdown Styles (reiterated for clarity, ensure no conflicts) */
.user-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #1ED760;
    color: black;
    font-weight: bold;
    font-size: 1.3em;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s ease;
    border: 3px solid black;
}

.user-avatar-container:hover {
    background-color: #1AA34A;
    transform: scale(1.05);
}



/* Dropdown Menu Styles */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #282828;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 12px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-username {
    color: #fff;
    font-size: 1.1em;
    padding: 5px 0;
    text-align: center;
    border-bottom: 1px solid #3a3a3a;
    margin-bottom: 5px;
}

.dropdown-logout-btn {
    background-color: transparent;
    color: white;
    border: none;
    padding: 10px 15px;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-size: 1.1em;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-logout-btn:hover {
    background-color: #3a3a3a;
    color: #1ED760;
}
/* Ensure header has space for the avatar */
.top-bar .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 20px; /* Adjust padding as needed */
}

/* Adjust search box to accommodate avatar */
.search-box {
    flex-grow: 1; /* Allow search box to take available space */
    max-width: 550px; /* Limit search box width */
    margin-right: -15px; /* Space between search and buttons/avatar */
}

/* Ensure buttons container aligns correctly */
.buttons {
    position: relative;
    display: flex;
    right: -20px;
    align-items: center;
    gap: 2px; /* Space between login/signup and avatar */
}

/* You can put this CSS in a <style> tag in your HTML's <head>
    or in a separate .css file linked to your HTML. */

.swarify-footer {
    position: relative;
    bottom: -250px;
    background-color: #000; /* Black background */
    color: #fff; /* White text color for the footer */
    padding: 24px; /* Adjust padding as needed, similar to Tailwind's p-6 */
    /* Adjust margin as needed, similar to Tailwind's mt-12 */
    text-align: center; /* Center all content horizontally */
    font-size: 14px; /* Small font size, similar to Tailwind's text-sm */
}

.swarify-footer-container {
    max-width: 1200px; /* Max width for content, adjust as needed */
    margin-left: auto; /* Center the container */
    margin-right: auto; /* Center the container */
}

.swarify-footer-nav {
    margin-bottom: 16px; /* Space between nav links and copyright */
}

.swarify-footer-links {
    list-style: none; /* Remove bullet points from list */
    padding: 0; /* Remove default padding */
    margin: 0; /* Remove default margin */
    display: flex; /* Arrange links horizontally */
    flex-wrap: wrap; /* Allow links to wrap to the next line on small screens */
    justify-content: center; /* Center the links horizontally */
    gap: 16px; /* Space between list items, similar to Tailwind's space-x-4 */
    /* For older browsers not supporting gap: */
    /* margin: 0 -8px; */ /* Negative margin to offset padding on items */
}

/* For older browsers (if using margin for gap) */
/* .swarify-footer-links li {
    padding: 0 8px;
} */


.swarify-footer-links a {
    color: #fff; /* White color for links */
    text-decoration: none; /* Remove underline */
    transition: color 0.3s ease; /* Smooth transition for hover effect */
    font-weight: 500; /* Medium font weight for links */
}

.swarify-footer-links a:hover {
    color: #1DB954; /* Spotify green on hover */
}

.swarify-footer-copyright {
    color: #a0a0a0; /* Light gray for copyright text, similar to Tailwind's text-gray-400 */
}

/* Responsive adjustments */
@media (min-width: 768px) { /* Similar to Tailwind's md breakpoint */
    .swarify-footer-links {
        gap: 24px; /* Increase space between links on larger screens, similar to md:space-x-6 */
      }
    }

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 550px;
    margin-right: -31px;
    left:-12px;
    top: -3px;
}
@media (max-width: 480px) {
.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 550px;
    margin-right: -31px;
    left:-12px;
    top: -3px;
}
}

.voice-search-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex; /* Use flex to center icon within the button */
    align-items: center;
    justify-content: center;
    height: 100%; /* Make buttons fill the height of the search-box */
    padding: 0 10px; /* Horizontal padding for the button area */
    color: #B3B3B3; /* Lighter grey for icons */
    transition: color 0.3s ease, transform 0.2s ease;
    flex-shrink: 0; /* CRITICAL: Prevents icons from shrinking or disappearing */
}
.search-icon:hover, .voice-search-icon:hover {
    color: #1ED760; /* Spotify green on hover */
    transform: scale(1.05); /* Slight enlargement on hover */
}
.top-bar .header {
    display: flex
;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 3px 20px;
}

/* --- Adjustments for Carousel Navigation Buttons (Green Theme) --- */

.carousel-nav-btn {
    /* Essential positioning and base styles (keep these) */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 50%; /* Make them round */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10; /* Ensure they are above the cards */
    
    /* --- NEW & UPDATED STYLES FOR GREEN THEME --- */
    background-color: #373837; /* Spotify Green background */
    color: #f8f6f6; /* White arrow icon */
    border: none; /* No border, let the color speak */
    width: 45px; /* Slightly larger button size */
    height: 45px;
    font-size: 28px; /* Larger arrow icon */
    font-weight: bold; /* Make arrow bolder */
    
    /* Smooth transition for all properties on hover */
    transition: opacity 0.3s ease, background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.5); /* Stronger shadow for depth */

    /* Initial opacity (still hidden by default, visible on hover) */
    opacity: 0; 
}

.carousel-nav-btn:hover {
    opacity: 1; /* Fully visible on direct button hover */
    background-color: #242323; /* Slightly darker green on hover for a subtle change */
    transform: translateY(-50%) scale(1.08); /* More noticeable scale up for interaction */
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.7); /* Even stronger shadow on hover */
}

/* Show buttons when hovering over the whole carousel wrapper */
.carousel-wrapper:hover .carousel-nav-btn {
    opacity: 0.9; /* Make them more visible (almost fully opaque) when hovering over the section */
}

/* Positioning (keep as is, or adjust slightly if needed) */
.carousel-nav-btn.prev-btn {
    left: 10px; /* Inset from the left edge */
}

.carousel-nav-btn.next-btn {
    right: 10px; /* Inset from the right edge */
}

/* Ensure your .carousel-wrapper has padding so buttons don't overlay the first/last card content */
.carousel-wrapper {
    position: relative; 
    overflow: hidden; 
    padding: 0 0px; 
}

/* Rest of your existing CSS for .cardcontainer and .card */
.cardcontainer {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cardcontainer::-webkit-scrollbar {
    display: none;
}

.carousel-wrapper:hover .carousel-nav-btn {
    opacity: 0.9; /* <--- REMOVE OR COMMENT THIS LINE */
    pointer-events: auto; /* <--- REMOVE OR COMMENT THIS LINE */
}

.carousel-nav-btn:hover {
    opacity: 1 !important; /* Use !important to ensure it overrides JS's inline style */
    background-color: #2c2c2c; /* Slightly darker green on hover for a subtle change */
    transform: translateY(-50%) scale(1.08); /* More noticeable scale up for interaction */
    box-shadow: 0px 6px 20px rgba(0, 0, 0, 0.7); /* Even stronger shadow on hover */
    pointer-events: auto !important; /* Ensure it's always clickable on direct hover */
}

/* --- DEBUG & OVERRIDE STYLES FOR PLAYER BAR --- */
/* Add this at the VERY END of your CSS file or in a <style> tag in HTML for testing */

.player-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 25% !important;
    width: 75% !important;
    background-color: #1a1a1a !important; /* Make sure background is visible */
    border-top: 1px solid #333 !important;
    padding: 8px 10px !important; /* Fixed padding for mobile */
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important; /* Distribute content */
    z-index: 9999 !important; /* Highest possible z-index to ensure visibility */
    box-sizing: border-box !important;
    min-height: 92px !important; /* Ensure a minimum height */
    height: 60px !important; /* Fixed height */
    overflow: hidden !important; /* Ensure nothing spills outside the bar itself */
}

/* Ensure body has enough padding at the bottom for the fixed player bar */
body {
    padding-bottom: 0px !important; /* Must be larger than player-bar height + its padding */
    margin: 0 !important; /* Remove default body margins */
    overflow-x: hidden !important; /* Prevent horizontal scrolling caused by hidden content */
    box-sizing: border-box !important;
}
html {
    overflow-x: hidden !important; /* Prevent horizontal scrolling on the html element too */
    box-sizing: border-box !important;
}


/* Specific styles for screens smaller than or equal to 768px (Tablets and Mobiles) */
@media (max-width: 768px) {
    .player-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
        padding: 8px 10px !important; /* Consistent padding */
        height: 81px !important;
        min-height: 60px !important;
        gap: 6px !important; /* Gap between flex items */
    }

    .player-left {
        display: flex !important;
        align-items: center !important;
        flex: 1 1 auto !important; /* Allow to grow and shrink, auto basis */
        min-width: 0 !important; /* Crucial for text ellipsis */
        /* background-color: rgba(255, 0, 0, 0.3) !important; /* DEBUG: See player-left boundary */ */
        overflow: hidden !important; /* Ensure text is clipped */
    }

    .player-left img {
        position: relative;
        top:-12px;
        width: 63px !important;
        height: 62px !important;
        margin-right: 6px !important;
        border-radius: 4px !important;
        object-fit: cover !important;
        box-shadow: none !important; /* Remove shadow to save space if needed */
        flex-shrink: 0 !important; /* CRITICAL: Prevent album art from shrinking */
    }

    .track-info { /* Targeting track-info directly */
        display: block !important;
        flex: 1 1 0% !important; /* Take all remaining space */
        min-width: 0 !important; /* CRITICAL for text ellipsis */
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .track-title { /* Targeting track-title directly */
        font-size: 0.85em !important;
        font-weight: bold !important;
        color: #e0e0e0 !important;
        margin-bottom: 1px !important;
    }

    .track-artist { /* Targeting track-artist directly */
        font-size: 0.7em !important;
        color: #b0b0b0 !important;
    }

    .add-to-library {
        display: none !important;
    }

    .player-center {
        flex: 0 0 auto !important; /* No grow, no shrink, auto basis */
        /* background-color: rgba(0, 255, 0, 0.3) !important; /* DEBUG: See player-center boundary */ */
      
        align-items: center !important;
        justify-content: flex-end !important; /* Push button to the end of its container */
    }

    .player-center .controls {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .player-center .controls .btn:not(.play) {
        display: none !important;
    }

    .player-center .controls .play {
        background-color: #0c0e0d !important;
        color: #fff !important;
        border: none !important;
        border-radius: 50% !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 1.7em !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        cursor: pointer !important;
        box-shadow: none !important; /* Remove shadow for max space/simplicity */
        padding: 0 !important; /* Ensure no internal padding pushes it */
        margin: 0 !important; /* Ensure no external margin pushes it */
    }

    .progress,
    .player-right {
        display: none !important;
    }
}

/* Very small screens */
@media (max-width: 375px) {
    .player-bar {
        padding: 5px 6px !important;
        height: 81px !important;
        min-height: 55px !important;
        gap: 4px !important;
    }

    .player-left img {
        position: relative;
        width: 61px !important;
        height: 60px !important;
        top:-7px;
        margin-right: 5px !important;
    }

    .track-title {
        font-size: 0.75em !important;
    }

    .track-artist {
        font-size: 0.6em !important;
    }

    .player-center .controls .play {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.5em !important;
    }
    body {
        padding-bottom: 65px !important; /* Adjust if bar is 55px + padding */
    }
}

@media (max-width: 480px) {
    .controls {
        position: relative;
        top: -59px;
        right:-176px;
        gap: 10px;
    }
}

@media (max-width: 380px) {
    .controls {
        position: relative;
        top: -44px;
        font-size: 30px;
        right:-130px;
        gap: 10px;
    }
}



/* Ensure the main player-bar is hidden when album overlay is active on small screens */
@media (max-width: 768px) {
    .album-overlay.active + .player-bar {
        display: none;
    }
}

/* --- Player Bar General Styling (Adjust if needed) --- */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 90px; /* Adjust height as needed for both playbar types */
    background-color: #181818; /* Dark background */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px; /* Horizontal padding */
    z-index: 1000; /* Ensure it's above other content */
    border-top: 1px solid #282828; /* Subtle top border */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5); /* Shadow for depth */
    transition: height 0.3s ease-in-out, background-color 0.3s ease-in-out; /* Smooth transitions */
}

.player-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0; /* Prevent shrinking when space is tight */
    padding: 8px; /* Consistent padding for the left section */
}

.player-left #player-img {
    width: 60px; /* Smaller image in the main bar */
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.player-left .track-info {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-left .track-info .track-title {
    font-size: 0.9em;
    font-weight: bold;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-left .track-info .track-artist {
    font-size: 0.75em;
    color: #b3b3b3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-left .add-to-library {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.player-left .add-to-library:hover {
    color: #1ED760;
}


/* --- Main Frontpage Playbar Details (Default View) --- */
.main-frontpage-playbar-details {
    display: flex;
    flex-grow: 1; /* Allows it to take up available space */
    justify-content: center; /* Center controls */
    align-items: center;
    gap: 20px;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.main-frontpage-playbar-details .player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    max-width: 720px; /* Limit width for larger screens */
}

.main-frontpage-playbar-details .player-center .controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.main-frontpage-playbar-details .player-center .controls .btn {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 1.5em;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
}

.main-frontpage-playbar-details .player-center .controls .btn:hover {
    color: #fff;
    transform: scale(1.05);
}

.main-frontpage-playbar-details .player-center .controls .btn.play {
    color: #1ED760; /* Green play button */
    font-size: 2.2em;
}

.main-frontpage-playbar-details .player-center .progress {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.main-frontpage-playbar-details .player-center .progress .time {
    font-size: 0.75em;
    color: #b3b3b3;
    min-width: 35px; /* Ensure time display doesn't collapse */
    text-align: center;
}

.main-frontpage-playbar-details .player-center .progress #progress-bar {
    width: 100%;
    height: 4px;
    background: #535353;
    -webkit-appearance: none;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

.main-frontpage-playbar-details .player-center .progress #progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1ED760;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.main-frontpage-playbar-details .player-center .progress #progress-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1ED760;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.main-frontpage-playbar-details .player-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.main-frontpage-playbar-details .player-right .volume-icon {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 1.2em;
    cursor: pointer;
}

.main-frontpage-playbar-details .player-right #volume-bar {
    width: 100px; /* Adjust as needed */
    height: 4px;
    background: #535353;
    -webkit-appearance: none;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

.main-frontpage-playbar-details .player-right #volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1ED760;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.main-frontpage-playbar-details .player-right #volume-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1ED760;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* --- Main Album Playbar Details (Detailed View for Mobile/Tablet) --- */
.main-album-playbar-details {
    display: flex; /* Will be toggled to flex by JS */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    width: 100%; /* Take full width of player-bar */
    height: 100%; /* Take full height of player-bar */
    padding: 0 16px; /* Match player-bar padding */
    box-sizing: border-box; /* Include padding in width/height */
    opacity: 0; /* Hidden by default for transition */
    transform: translateY(100%); /* Slide up from bottom */
    pointer-events: none; /* Prevent interaction when hidden */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.main-album-playbar-details.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.main-album-playbar-track-info {
    text-align: center;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* Ensure it respects padding */
}

.main-album-playbar-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-album-playbar-artist {
    font-size: 0.8em;
    color: #b3b3b3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-album-playbar-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px; /* Limit width for larger screens */
}

.main-album-playbar-progress {
    display: flex;
    align-items: center;
    width: 90%; /* Adjust width to give some margin */
    gap: 8px;
    margin-bottom: 15px;
}

.main-album-playbar-progress-bar {
    flex-grow: 1;
    height: 6px; /* Thicker progress bar */
    background: #535353;
    -webkit-appearance: none;
    border-radius: 3px;
    cursor: pointer;
    outline: none;
}

.main-album-playbar-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; /* Larger thumb */
    height: 16px;
    border-radius: 50%;
    background: #1ED760;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.main-album-playbar-progress-bar::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #1ED760;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.main-album-playbar-current-time,
.main-album-playbar-duration {
    font-size: 0.8em;
    color: #b3b3b3;
    min-width: 40px; /* Ensure time display doesn't collapse */
    text-align: center;
}

.main-album-playbar-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px; /* Increased gap between buttons */
}

.main-album-playbar-btn {
    background: none;
    border: none;
    color: #b3b3b3;
    font-size: 1.6em; /* Larger icons */
    cursor: pointer;
    padding: 8px;
    border-radius: 50%; /* Make buttons circular */
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.1s ease;
}

.main-album-playbar-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.main-album-playbar-btn.main-album-playbar-play {
    color: #1ED760; /* Green play button */
    font-size: 2.5em; /* Even larger play button */
    padding: 10px;
}

.main-album-playbar-btn.main-album-playbar-play:hover {
    background-color: rgba(30, 215, 96, 0.2);
}

/* --- Responsive Media Queries --- */

/* Hide main frontpage playbar details and show album details on smaller screens */
@media (max-width: 736px) { /* Adjust breakpoint as needed for tablet/mobile */
    .main-frontpage-playbar-details {
        opacity: 0;
        transform: translateY(100%);
        pointer-events: none;
        display: none; /* Hide completely when not active to prevent layout issues */
    }

    .main-album-playbar-details {
        /* This will be shown by JS, but ensure it's positioned correctly */
        display: flex; /* Ensure it's ready to be shown as flex */
        opacity: 0; /* Still hidden by default, JS will add .show */
        transform: translateY(100%);
        pointer-events: none;
    }

    /* Adjust player-left to take less space on small screens */
    .player-bar .player-left {
        flex-basis: auto; /* Allow content to dictate width */
        max-width: 150px; /* Limit width */
        gap: 10px;
    }

    .player-left .track-info {
        max-width: 80px; /* Limit track info width */
    }

    .player-left #player-img {
        width: 50px;
        height: 50px;
    }

    .player-left .add-to-library {
        font-size: 1.2em;
        padding: 0;
    }
}

/* Hide album details and show main frontpage playbar details on larger screens */
@media (min-width: 737px) { /* Adjust breakpoint as needed for desktop */
    .main-album-playbar-details {
        opacity: 0;
        transform: translateY(100%);
        pointer-events: none;
        display: none; /* Hide completely when not active */
    }

    .main-frontpage-playbar-details {
        display: flex; /* Ensure it's ready to be shown as flex */
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}



@media (min-width: 480px) { 
    .right{
        height: 80vh;
    }
}

@media (max-width: 480px) { 
.right{
    height:95vh;
}
  
    .search-box {
        top:-1px
    }
}

