/* 额外的自定义样式 */

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 页面加载动画 */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* 音乐卡片悬停效果 */
.music-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* 播放按钮动画 */
.play-button {
    transition: all 0.2s ease;
}

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

.play-button:active {
    transform: scale(0.95);
}

/* 搜索框聚焦效果 */
#searchInput:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 侧边栏导航项悬停效果 */
nav a {
    transition: all 0.2s ease;
}

nav a:hover {
    transform: translateX(4px);
}

/* 渐变背景动画 */
.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.orange-gradient {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 加载状态 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .music-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .glass-effect {
        backdrop-filter: blur(20px);
        background: rgba(0, 0, 0, 0.8);
    }
}

/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 音频可视化效果 */
.audio-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.audio-bar {
    width: 3px;
    height: 20px;
    background: #3b82f6;
    border-radius: 2px;
    animation: audioWave 1s ease-in-out infinite;
}

.audio-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.audio-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.audio-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.audio-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes audioWave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 5px;
    }
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3b82f6;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* 网易云音乐API集成样式 */

/* 旋转加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 来源标签样式 */
.source-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    margin-left: 8px;
}

.source-tag.netease {
    background-color: #fee2e2;
    color: #dc2626;
}

.source-tag.local {
    background-color: #dbeafe;
    color: #2563eb;
}

/* 搜索结果项增强悬停效果 */
.search-result-item {
    transition: all 0.2s ease;
    border-radius: 8px;
}

.search-result-item:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* 分割线样式优化 */
.border-b {
    border-bottom-width: 1px;
}

.border-gray-100 {
    border-color: #f3f4f6;
}

/* 最后一个元素不显示分割线 */
.last\:border-b-0:last-child {
    border-bottom-width: 0;
}

/* 悬停时分割线效果 */
.hover\:bg-gray-50:hover {
    border-color: #e5e7eb;
}

/* 搜索加载状态 */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: #6b7280;
}

.search-loading .spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    margin-bottom: 16px;
}

/* 网易云音乐特色红色主题 */
.netease-theme {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    color: white;
}

.netease-badge {
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* 搜索结果分组标题 */
.search-section-title {
    position: relative;
    padding-left: 12px;
}

.search-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: #3b82f6;
    border-radius: 2px;
}

/* 封面图片增强效果 */
.cover-image {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cover-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.cover-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.cover-image:hover::after {
    transform: translateX(100%);
}

/* 播放器封面特效 */
.player-cover {
    position: relative;
    overflow: hidden;
}

.player-cover::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b35, #f7931e, #ffd700, #32cd32, #1e90ff, #9370db, #ff1493);
    background-size: 400% 400%;
    animation: gradientBorder 3s ease infinite;
    border-radius: 10px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.player-cover.playing::before {
    opacity: 1;
}

@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 图片加载状态 */
.image-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 音量滑块样式 */
#volumeSlider {
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    outline: none;
    border-radius: 5px;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 进度条样式 */
#progressBar {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    transition: width 0.1s ease;
}

/* 播放器增强样式 */
#playerBar {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

/* 播放列表样式 */
.playlist-item {
    transition: all 0.2s ease;
}

.playlist-item:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
}

.playlist-item.current {
    background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
    border-left: 4px solid #3b82f6;
}

/* 歌词样式 */
.lyrics-container {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

.lyric-line {
    transition: all 0.3s ease;
    cursor: pointer;
}

.lyric-line:hover {
    background-color: #f3f4f6;
    border-radius: 8px;
}

.lyric-line.current {
    color: #3b82f6 !important;
    font-weight: 600;
    transform: scale(1.05);
    background-color: #eff6ff;
    border-radius: 8px;
    padding: 8px 16px;
}



/* 控制按钮状态 */
.control-btn-active {
    color: #3b82f6 !important;
}

.control-btn-active.repeat-one {
    color: #10b981 !important;
}

/* 播放列表计数器 */
#playlistCount {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 歌单分类按钮样式 */
.playlist-category-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
}

.playlist-category-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.playlist-category-btn.active {
    background: #3b82f6;
    color: white;
}

.playlist-category-btn.active:hover {
    background: #2563eb;
}

/* 歌单详情页面样式 */
.playlist-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 400px;
    position: relative;
}

.playlist-bg-blur {
    backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.3);
}

.playlist-songs {
    margin-top: -2rem;
    border-radius: 1.5rem 1.5rem 0 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
}

/* 歌曲行样式 */
.song-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.song-row:hover {
    background: #f8fafc;
}

.song-row.playing {
    background: #fef2f2;
    color: #dc2626;
}

.song-row .song-number {
    width: 48px;
    text-align: center;
    font-weight: 500;
    color: #6b7280;
}

.song-row.playing .song-number {
    color: #dc2626;
}

.song-row .song-info {
    flex: 1;
    margin-left: 1rem;
    min-width: 0;
}

.song-row .song-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row.playing .song-title {
    color: #dc2626;
}

.song-row .song-artist {
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row .song-album {
    width: 128px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row .song-duration {
    width: 64px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.song-row .song-actions {
    width: 48px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.song-row:hover .song-actions {
    opacity: 1;
}

.song-row .song-actions button {
    padding: 6px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.song-row .song-actions button:hover {
    background: #f3f4f6;
    color: #374151;
}

/* 播放按钮动画 */
.play-button-animate {
    animation: playPulse 1.5s infinite;
}

@keyframes playPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .playlist-header .flex {
        flex-direction: column;
        text-align: center;
    }

    .playlist-header .w-48 {
        width: 200px;
        height: 200px;
        margin: 0 auto 2rem;
    }

    .song-row .song-album {
        display: none;
    }

    .song-row .song-artist {
        width: 96px;
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .source-tag {
        font-size: 9px;
        padding: 1px 6px;
        margin-left: 4px;
    }

    .search-result-item:hover {
        transform: none;
        box-shadow: none;
    }

    .search-loading {
        padding: 32px 16px;
    }

    .search-loading .spinner {
        width: 36px;
        height: 36px;
    }

    .cover-image:hover {
        transform: none;
        box-shadow: none;
    }

    .cover-image::after {
        display: none;
    }

    #playerBar {
        height: 20px;
    }

    #volumeSlider {
        width: 60px;
    }
}

/* Apple Music 风格的歌单详情页面 */
.playlist-header-modern {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.playlist-songs-modern {
    background: #ffffff;
}

/* 歌曲行悬停效果 */
.song-row-modern {
    transition: all 0.2s ease;
}

.song-row-modern:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
}

/* 当前播放歌曲高亮 */
.song-row-current {
    background-color: #fef2f2;
    border-left: 3px solid #ef4444;
}

/* 播放按钮动画 */
.play-button-animate {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 歌曲封面圆角 */
.song-cover {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 毛玻璃效果增强 */
.glass-effect {
    backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 确保底部播放器覆盖在所有内容之上 */
#playerBar {
    z-index: 9999 !important;
}

/* 歌单详情页面的内容区域需要为底部播放器留出空间 */
.playlist-songs-modern {
    padding-bottom: 120px;
}

/* 歌单封面阴影效果 */
.playlist-header-modern img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.playlist-header-modern img:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* 按钮悬停效果 */
.playlist-header-modern button {
    transition: all 0.2s ease;
}

.playlist-header-modern button:hover {
    transform: translateY(-1px);
}

/* 歌曲行的播放图标动画 */
.song-playing-icon {
    animation: musicBounce 1.5s ease-in-out infinite;
}

@keyframes musicBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 粘性头部的模糊效果 */
.sticky {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 歌曲选项菜单样式 */
.song-options-menu {
    animation: menuFadeIn 0.15s ease-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

.song-options-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 菜单项悬停效果 */
.song-options-menu > div:hover {
    background-color: #f8fafc;
}

.song-options-menu > div:hover i {
    color: #3b82f6;
}

.song-options-menu > div:hover span {
    color: #1f2937;
}

/* 歌曲信息模态框样式 */
.song-info-modal {
    animation: modalFadeIn 0.2s ease-out;
}

.song-info-modal > div {
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 模态框关闭按钮悬停效果 */
.song-info-modal button:hover {
    transform: scale(1.05);
}

/* 歌单详情页面响应式 */
@media (max-width: 768px) {
    .playlist-header-modern .w-56 {
        width: 200px;
        height: 200px;
    }

    .playlist-header-modern .text-2xl {
        font-size: 1.5rem;
    }

    .playlist-songs-modern .w-16 {
        width: 3rem;
    }

    .playlist-songs-modern .w-8 {
        width: 2rem;
    }
}
