body, html {
    touch-action: manipulation;
}

.mobile-menu {
    display: none;
}

.tab-button {
    position: relative;
    background: transparent;
    color: #9ca3af;
    border: none;
    cursor: pointer;
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 3px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.tab-button.active {
    color: #ffffff !important;
    background: transparent !important;
}

.tab-button.active::after {
    background-color: #9333ea;
}

.tab-button:hover:not(.active) {
    color: #d1d5db;
}

.menu-btn {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .menu-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

.menu-btn:active {
    background-color: #4b5563;
}

@media (min-width: 1024px) {
    .mobile-menu {
        display: none !important;
    }
}

.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid #ffffff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.favorite-btn {
    position: relative;
    transition: all 0.2s ease;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .favorite-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

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

.favorite-icon {
    transition: all 0.2s ease;
}

.favorite-btn.is-favorite .favorite-icon {
    fill: #ffffff;
    stroke: #ffffff;
}

.favorite-btn.is-favorite:hover .favorite-icon {
    fill: #e5e7eb;
    stroke: #e5e7eb;
}

.favorite-btn:not(.is-favorite):hover .favorite-icon {
    stroke: #d1d5db;
}

/* Song card cover styles */
.song_playable .flex-shrink-0:first-child {
    position: relative;
}

.song_playable .flex-shrink-0:first-child img {
    cursor: pointer;
}

.song_playable .flex-shrink-0:first-child::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>') no-repeat center/2rem;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 0.375rem;
    pointer-events: none;
    z-index: 10;
}

.song_playable:hover .flex-shrink-0:first-child::after,
.song_playable.now-playing .flex-shrink-0:first-child::after {
    opacity: 1;
}

.song_playable:hover .flex-shrink-0:first-child img {
    opacity: 0.8;
}

.song_playable.now-playing {
    background: #374151 !important;
}

.song_playable.now-playing .flex-shrink-0:first-child::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><rect x="6" y="5" width="4" height="14" rx="1"/><rect x="14" y="5" width="4" height="14" rx="1"/></svg>');
}

.song_playable.now-playing.paused .flex-shrink-0:first-child::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>');
}

.song_playable .flex-grow a,
.song_playable .flex-grow a h3 {
    display: inline;
}

/* Floating Player */
.floating-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #1a1a2e, #16213e);
    border-top: 2px solid rgba(255, 255, 255, 0.06);
    padding: 12px 16px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.floating-player.active {
    transform: translateY(0);
}

body.player-active {
    padding-bottom: 90px;
}

.player-container {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-title {
    color: white;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
}

.player-title:hover {
    text-decoration: underline;
}

.player-time {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 2px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.player-btn.play-pause {
    background: white;
    color: #1f2937;
    width: 44px;
    height: 44px;
}

.player-btn.play-pause:hover {
    background: #f3f4f6;
    color: #111827;
}

.player-btn.close-player-btn {
    color: #9ca3af;
    padding: 4px;
}

.player-btn.close-player-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.progress-container {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #374151;
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
}

.progress-bar:hover {
    height: 6px;
}

.progress-fill {
    height: 100%;
    background: white;
    width: 0;
    transition: width 0.1s linear;
}

.progress-bar:hover .progress-fill {
    background: #f3f4f6;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: #374151;
    border-radius: 2px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

@media (max-width: 640px) {
    .floating-player {
        padding: 10px 12px;
    }

    .player-container {
        gap: 10px;
    }

    .player-cover {
        width: 44px;
        height: 44px;
    }

    .progress-container, .volume-container {
        display: none;
    }

    .player-btn.play-pause {
        width: 38px;
        height: 38px;
    }
}
