/* Spotify Overlay Styles */
:root {
    --primary: #1DB954; /* Spotify Green */
    --accent: #ffffff;   /* White for titles, can be adjusted */
    --dark: #191414;   /* Spotify Dark Grey */
    --bg: #282828;     /* Spotify Player Grey */
    --bg-dark: #121212; /* Spotify Background Grey */
    --light: #ffffff;
    --gray: #b3b3b3;
    --header-bg: #1f1f1f; /* Slightly lighter than bg-dark for header */
    --radius: 8px;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body {
    background: transparent;
    color: var(--light);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.spotify-overlay {
    width: 320px;
    background: var(--bg-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--dark);
}

.overlay-header {
    background: var(--header-bg);
    color: var(--accent);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 6px 14px;
    border-bottom: 1px solid var(--dark);
}

.overlay-title-main {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.overlay-close {
    background: none;
    border: none;
    color: var(--gray);
    font-size: 15px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.overlay-close:hover {
    background: var(--bg);
    color: var(--light);
}

.overlay-body {
    display: flex;
    align-items: center;
    padding: 14px;
    background: var(--bg-dark);
}

.overlay-art {
    width: 52px;  /* Slightly larger for Spotify */
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--dark); /* Placeholder background */
    margin-right: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.overlay-meta {
    flex: 1;
    min-width: 0; /* Important for flex item to shrink and allow text overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.song-title-container,
.artist-container {
    width: 100%;
    overflow: hidden; /* This will clip the content */
    position: relative; /* For absolute positioning of scrolling text if needed */
}

.song-title {
    font-weight: 600;
    color: var(--light);
    font-size: 15px;
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden;    /* Hide overflow */
    display: block;      /* Ensure it takes full width of parent for overflow detection */
    max-width: 100%;
}

.artist {
    color: var(--gray);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* This will apply if not scrolling */
    display: block;      /* Ensure it takes full width of parent for overflow detection */
    margin-top: 3px;
}

/* Scrolling Text Animation */
.scroll-text .scroll-text-inner { /* This is the span created by JS inside .scroll-text */
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%; /* Makes the duplicated text start at the right edge */
    animation: scroll 15s linear infinite;
}

.scroll-text .scroll-text-inner.paused { /* If JS adds paused class to inner span */
    animation-play-state: paused;
}

/* Pause on hover for the container (handled by JS by targeting .scroll-text-inner directly) */

@keyframes scroll {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%); /* Scrolls the duplicated text to the left */
    }
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .spotify-overlay {
        width: 98vw;
        min-width: 0;
        border-radius: 0;
    }
    .overlay-header, .overlay-body {
        padding-left: 10px;
        padding-right: 10px;
    }
    .overlay-art {
        width: 42px;
        height: 42px;
        margin-right: 10px;
    }
    .song-title {
        font-size: 14px;
    }
    .artist {
        font-size: 12px;
    }
}
