/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #1a1a1a;
    padding-bottom: 120px;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #666;
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 40px;
}

.btn-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #2a2a2a;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter:hover {
    background-color: #3a3a3a;
    transform: translateY(-1px);
}

.btn-filter.active {
    background-color: #1a1a1a;
}

.btn-filter i {
    font-size: 16px;
}

/* Pack Header */
.pack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 12px;
}

.pack-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border: 2px solid #2a2a2a;
    border-radius: 8px;
    font-weight: 600;
}

.pack-title i {
    font-size: 20px;
}

.track-count {
    color: #666;
    font-size: 14px;
}

/* Tracklist */
.tracklist {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Track Item */
.track {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s;
    cursor: grab;
}

.track:active {
    cursor: grabbing;
}

.track.dragging {
    opacity: 0.5;
}

.track.drag-over {
    border-top: 2px solid #1a1a1a;
}

.track:last-child {
    border-bottom: none;
}

.track:hover {
    background-color: #fafafa;
}

.track.active {
    background-color: #f5f5f5;
    border-left: 3px solid #1a1a1a;
}

.track-number {
    font-size: 18px;
    font-weight: 600;
    color: #999;
    width: 40px;
    flex-shrink: 0;
}

.track-waveform {
    width: 48px;
    height: 48px;
    margin-right: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border-radius: 8px;
}

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

.track-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.track-artist {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.track-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 0 20px;
}

.track-bpm {
    padding: 6px 14px;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.track-action {
    margin-left: 20px;
    flex-shrink: 0;
}

.btn-track-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.btn-track-download:hover {
    color: #1a1a1a;
    transform: scale(1.1);
}

.btn-track-download i {
    font-size: 20px;
}

/* Player */
.player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #2a2a2a;
    color: white;
    padding: 20px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.player-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.player-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

.player-btn i {
    font-size: 24px;
}

.hidden {
    display: none;
}

.player-info {
    min-width: 200px;
}

.track-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

#playerTrackArtist {
    font-size: 12px;
    color: #999;
}

.waveform {
    flex: 1;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

#waveformContainer {
    width: 100%;
    height: 100%;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error {
    text-align: center;
    padding: 40px;
    color: #d00;
}

/* Download Progress Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 400px;
    max-width: 90%;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
}

.modal-header > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header i {
    font-size: 24px;
    color: orange;
}

.cancel-btn {
    padding: 6px 12px;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn:hover {
    background-color: #cc0000;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.progress-percent {
    font-weight: 700;
    color: #1a1a1a;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background-color: orange;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

#currentFile {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 32px;
    }
    
    .player-content {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .player-info {
        min-width: 150px;
    }
    
    .waveform {
        width: 100%;
        order: -1;
    }
    
    .track {
        padding: 16px;
    }
    
    .track-number {
        width: 30px;
        font-size: 16px;
    }
}
