/* ==========================================================================
 1. GRUNDSTYLING & DESKTOP LAYOUT
 ========================================================================== */
body {
    font-family: '-apple-system', BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #0b0b0b; 
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overscroll-behavior: none;
}
.player-container {
    background-color: #161616; 
    padding: 24px;
    border-radius: 32px; 
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.85);
    border: 1px solid #222222; 
    width: 340px;
    height: 735px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: box-shadow 0.5s ease; 
    position: relative;
}
.player-container.is-playing {
    box-shadow: 0 0 40px rgba(255, 102, 0, 0.15), 0 25px 55px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
 2. SONG-INFOS (ORDNER & TITEL)
 ========================================================================== */
.track-info {
    margin-top: 10px;
    margin-bottom: 25px;
    text-align: center;
}
.track-folder {
    font-size: 0.72rem;
    color: #a0a0a0;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.track-title {
    font-size: 1.35rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ==========================================================================
 3. STEUERUNGSELEMENTE (MAIN BUTTONS)
 ========================================================================== */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px; 
    margin-bottom: 12px; 
}
.btn {
    background-color: #222222;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
}
.btn.side-btn {
    width: 52px;
    height: 52px;
}
.btn.side-btn svg {
    width: 24px;
    height: 24px;
    fill: #b3b3b3;
}
.btn:hover {
    background-color: #2a2a2a;
    transform: scale(1.06);
}
.btn:hover svg {
    fill: #ffffff;
}
.btn.play-btn {
    background-color: #ff6600;
    width: 64px;
    height: 64px;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}
.btn.play-btn svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
}
.btn.play-btn:hover {
    background-color: #ff771a;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
}
/* ==========================================================================
 4. PERFORMANCE-WELLENFORM
 ========================================================================== */
.waveform-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px; 
}
.canvas-wrapper {
    width: 100%;
    height: 55px; 
    position: relative;
    cursor: pointer;
}
#waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.time-labels {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-size: 0.65rem; 
    color: #a0a0a0;
    font-family: monospace;
}

/* ==========================================================================
 5. SUCHFELD (Volle Breite)
 ========================================================================== */
.search-area {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    width: 100%;
}
.search-box {
    display: flex;
    align-items: center;
    background-color: #222222;
    border-radius: 12px; 
    padding: 10px 14px;
    gap: 10px;
    flex-grow: 1;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
}
.search-box:focus-within {
    border-color: #444444; 
}
.search-icon {
    width: 18px;
    height: 18px;
    fill: #777777;
}
#search-input {
    background: none;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}
#search-input::placeholder {
    color: #666666;
}

/* ==========================================================================
 6. PLAYLIST BEREICH, UTILITIES & TEXT-SLIDER
 ========================================================================== */
.playlist-container {
    margin-top: 7px;
    text-align: left;
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden; 
}
.playlist-header {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #222222;
    justify-content: space-between; 
}
.playlist-header h3 {
    font-size: 0.8rem;
    color: #ff6600;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.sort-buttons {
    display: flex;
    gap: 8px; 
}
.sort-btn {
    background-color: #222222;
    border: none;
    width: 34px; 
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    touch-action: manipulation;
}
.sort-btn svg {
    width: 16px;
    height: 16px;
    fill: #666666;
}
.sort-btn:hover {
    background-color: #2a2a2a;
}
.sort-btn:hover svg {
    fill: #ffffff;
}
.sort-btn.active svg {
    fill: #ff6600;
}
#playlist {
    list-style: none;
    padding: 5px 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    border-bottom: 1px solid #222222;
    -webkit-overflow-scrolling: touch;
}
#playlist::-webkit-scrollbar {
    width: 4px; 
}
#playlist::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 10px;
}
.playlist-item {
    padding: 11px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    color: #cccccc;
    margin-bottom: 2px;
    overflow: hidden; 
    position: relative;
}
.playlist-item .text-wrapper {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    width: 100%;
    transform: translateX(0);
}
.playlist-folder {
    color: #666666; 
    margin-right: 6px;
    font-weight: 500;
}
.playlist-item.can-slide:hover .text-wrapper {
    overflow: visible;
    text-overflow: clip;
    display: inline-block;
    width: auto;
    animation: slideText 7s linear infinite; 
}
@keyframes slideText {
    0% { transform: translateX(0); }
    10% { transform: translateX(0); } 
    85% { transform: translateX(calc(-100% + 270px)); } 
    100% { transform: translateX(calc(-100% + 270px)); } 
}
.playlist-item:hover {
    background-color: #222222;
    color: #ffffff;
}
.playlist-item.active {
    background-color: #222222;
    color: #ff6600;
    font-weight: 600;
}
.playlist-item.active .playlist-folder {
    color: #555555; 
}
.no-tracks {
    font-size: 0.85rem;
    color: #666666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Tooltip & Pop-up */
.waveform-tooltip {
    position: absolute;
    top: -30px; 
    transform: translateX(-50%);
    background-color: #ff6600;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    pointer-events: none; 
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.4);
    z-index: 10;
}
.canvas-wrapper:hover .waveform-tooltip {
    opacity: 1;
}
.resume-popup {
    position: fixed;
    bottom: -150px; 
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    border: 1px solid #ff6600;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 102, 0, 0.1);
    z-index: 100;
    width: 300px;
    text-align: center;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.resume-popup.show {
    bottom: 24px; 
}
.resume-popup p {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    color: #cccccc;
}
.resume-popup strong {
    color: #ffffff;
    display: block;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.resume-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.resume-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    touch-action: manipulation;
}
.resume-btn.yes {
    background-color: #ff6600;
    color: #ffffff;
}
.resume-btn.yes:hover {
    background-color: #ff771a;
}
.resume-btn.no {
    background-color: #2a2a2a;
    color: #888888;
}
.resume-btn.no:hover {
    background-color: #333333;
    color: #ffffff;
}

/* ==========================================================================
 7. INTELLIGENTES SMARTPHONE-VOLLBILD (Optimiert)
 ========================================================================== */
@media screen and (max-width: 480px) {
    body {
        background-color: #161616; 
        align-items: flex-start; 
        height: 100dvh; 
    }
    .player-container {
        width: 100vw; 
        height: 100dvh; 
        border-radius: 0; 
        border: none; 
        box-shadow: none; 
        padding: 20px; 
    }
    #playlist {
        max-height: none; 
    }
}

/* ==========================================================================
 8. EXTRA UTILITIES & HEADER-BUTTONS
 ========================================================================== */
.close-window-btn {
  position: absolute;
  right: 14px;
  top: 5px;
  color: #bbb;
}
.close-window-btn button {
  color: #f60;
  text-transform: lowercase;
  font-size: 0.6rem;
  text-decoration: none;
  background: none;
  border: none;
  touch-action: manipulation;
}
.list-help {
  text-transform: lowercase;
  font-size: 12px;
  font-weight: 300;
}
.lh-o {
  color: #666;
}
.lh-s {     
  color: #ccc;
}
