/* Reset and base styles - Mobile First */
* {
    box-sizing: border-box;
}

body {
    background: url('background.gif') center/cover no-repeat fixed;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.75rem;
    line-height: 1.6;
    color: white;
    overflow-x: hidden;
}

/* Add backdrop blur effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('background.gif') center/cover no-repeat;
    filter: blur(8px);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* Semantic layout structure - Fixed footer */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

footer {
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    text-align: center;
    box-shadow: 0 -0.125rem 0.375rem rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    margin-top: auto;
}

/* Footer link styling */
footer a {
    color: #ff69b4; /* Hot pink color */
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #ff1493; /* Deeper pink on hover */
    text-shadow: 0 0 5px rgba(255, 105, 180, 0.5);
}

footer a:visited {
    color: #da70d6; /* Orchid color for visited links */
}

/* Music player container */
.music-player {
    width: 100%;
    max-width: none;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 0.125rem solid rgba(0,0,0,0.2);
    border-radius: 0.625rem;
    color: black;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

/* Main heading */
.music-player h2 {
    font-size: 1.5rem;
    margin: 0 0 0.75rem 0;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.music-player p {
    font-size: 0.625rem;
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
    text-align: center;
}

/* Waveform visualization */
#waveform {
  width: 100%;
  max-width: 800px;
  height: 6rem; /* Or another value you like */
  margin: 0;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  background: rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* Playlist section */
.playlist {
    margin: 1.25rem 0;
}

.song-item {
    padding: 0.75rem;
    margin: 0.3125rem 0;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 0.3125rem;
    cursor: pointer;
    border: 0.125rem solid transparent;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.song-item:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.song-item.active {
    border-color: #333;
    background: rgba(0, 0, 0, 0.2);
}

.song-title {
    font-size: 0.75rem;
    font-weight: bold;
}

.song-artist {
    font-size: 0.625rem;
    color: #666;
}

/* Controls section */
.controls {
    margin: 1.25rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

/* Control button specific styling for better mobile experience */
.control-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.625rem;
    padding: 0.875rem 1rem;
    background: white;
    border: 0.125rem solid #333;
    border-radius: 0.3125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 4rem;
    flex: 1;
    max-width: 7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-btn:hover {
    background: #333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.2);
}

.control-btn:active {
    transform: translateY(0);
}

/* Regular buttons (non-control) */
button:not(.control-btn) {
    font-family: 'Arial', sans-serif;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 0.125rem solid #333;
    border-radius: 0.3125rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 3.125rem;
    flex: 1;
    max-width: 6.25rem;
}

button:not(.control-btn):hover {
    background: #333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.2);
}

button:not(.control-btn):active {
    transform: translateY(0);
}

.now-playing {
    font-size: 0.625rem;
    margin-top: 0.75rem;
    font-weight: bold;
    text-align: center;
    padding: 0.5rem;
    background: rgba(0,0,0,0.05);
    border-radius: 0.25rem;
}

/* Natural breakpoint #1: When content needs more breathing room */
@media (min-width: 30em) {
    body {
        font-size: 0.875rem;
    }
    
    .music-player {
        padding: 1.5rem;
    }
    
    .music-player h2 {
        font-size: 1.75rem;
    }
    
    .controls {
        gap: 0.75rem;
    }
    
    .control-btn {
        flex: 0 1 auto;
        min-width: 5rem;
        font-size: 0.6875rem;
    }
    
    button:not(.control-btn) {
        flex: 0 1 auto;
        min-width: 4rem;
    }
}

/* Natural breakpoint #2: When horizontal layout becomes viable */
@media (min-width: 48em) {
    main {
        padding: 2rem;
    }
    
    .music-player {
        max-width: 37.5rem;
        padding: 2rem;
    }
    
    .music-player h2 {
        font-size: 2rem;
    }
    
    .song-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .song-info {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    #waveform {
        height: 6rem;
    }
}

/* Volume slider hidden on small screens */
/* WebKit browsers (Chrome, Safari, Edge) */
#volumeSlider::-webkit-slider-thumb {
  background: #333;         /* Dark grey thumb */
  border: none;
  border-radius: 50%;
  cursor: pointer;
  height: 16px;
  width: 16px;
  margin-top: -5px;         /* center the thumb vertically */
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
  -webkit-appearance: none;
}

#volumeSlider::-webkit-slider-runnable-track {
  background: #ccc;         /* Light grey track */
  height: 6px;
  border-radius: 3px;
}

/* Firefox */
#volumeSlider::-moz-range-thumb {
  background: #333;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  height: 16px;
  width: 16px;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

#volumeSlider::-moz-range-track {
  background: #ccc;
  height: 6px;
  border-radius: 3px;
}

/* Microsoft Edge (old) */
#volumeSlider::-ms-thumb {
  background: #333;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  height: 16px;
  width: 16px;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

#volumeSlider::-ms-track {
  background: #ccc;
  height: 6px;
  border-radius: 3px;
  border-color: transparent;
  color: transparent;
}

@media (min-width: 30em) {
#volumeSlider {
    display: inline-block;
    width: 8rem;
    accent-color: #333;
    cursor: pointer;
    margin-left: 0.75rem;
    vertical-align: middle;
}
}

/* Natural breakpoint #3: When we have plenty of space */
@media (min-width: 64em) {
    .page-wrapper {
        grid-template-areas: 
            "main main"
            "footer footer";
    }
    
    .music-player {
        max-width: 50rem;
        padding: 2.5rem;
    }
    
    .music-player h2 {
        font-size: 2.5rem;
        margin-bottom: 2rem;
    }
    
    .controls {
        gap: 1rem;
    }
    
    .control-btn {
        padding: 1rem 1.5rem;
        font-size: 0.75rem;
        min-width: 6rem;
    }
    
    button:not(.control-btn) {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    #waveform {
        height: 8rem;
    }
}

/* High-resolution displays */
@media (min-resolution: 2dppx) {
    body {
        text-rendering: optimizeLegibility;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}