body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Changed from center to allow scrolling */
    min-height: 100vh;
}

.container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px;
    text-align: center;
    margin-bottom: 40px; /* Space for scrolling */
}

.video-wrapper {
    margin: 20px 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
}

video {
    width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    background: black;
}

button {
    background-color: #007aff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.controls-section {
    margin-bottom: 20px;
}

.speed-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.speed-controls button {
    margin-top: 0;
    padding: 10px 20px;
    font-size: 20px;
    line-height: 1;
    width: 50px;
}

.select-wrapper {
    position: relative;
    display: inline-block;
}

#speedSelect {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 10px 30px 10px 15px;
    font-size: 16px;
    border-radius: 8px;
    color: #333;
    font-weight: bold;
    text-align: center;
    min-width: 80px;
}

.select-wrapper::after {
    content: '▼';
    font-size: 12px;
    color: #666;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.settings-section {
    text-align: left;
    margin: 10px 0 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
}

.settings-section summary {
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 5px;
}

.settings-options {
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-section {
    margin: 20px 0;
}

input[type="file"] {
    margin-bottom: 10px;
    width: 100%;
}

.drop-zone {
    border: 2px dashed #007aff;
    border-radius: 8px;
    padding: 20px;
    margin: 10px 0;
    color: #007aff;
    background-color: #f9f9f9;
    transition: background-color 0.3s;
    display: block;
}

.drop-zone.dragover {
    background-color: #e0efff;
}

/* Playlist Styles */
.playlist-section {
    text-align: left;
    margin-top: 20px;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    margin-bottom: 10px;
}

.playlist-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #eee;
    gap: 10px;
    user-select: none;
}

.playlist-item.playing {
    background-color: #e0efff;
    font-weight: bold;
    border-left: 4px solid #007aff;
}

.playlist-item.dragging {
    opacity: 0.5;
    background: #f0f0f0;
}

.drag-handle {
    cursor: move;
    font-size: 20px;
    color: #999;
    padding: 0 5px;
    touch-action: none; /* Important for touch dragging */
}

.track-info {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-btn {
    background: none;
    color: #ff3b30;
    border: none;
    padding: 5px 10px;
    margin: 0;
    font-size: 14px;
}

.help-section {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 10px;
    border-radius: 8px;
}

#status {
    margin-top: 10px;
    font-size: 0.9em;
    color: #555;
}
