*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #fff;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.btn-rescan {
    font-size: 1.1rem;
}

.btn-rescan.scanning {
    opacity: 0.5;
    pointer-events: none;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.track-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: #999;
    margin-left: 8px;
}

/* Controls row (play, mute, search — above track title, only on active track) */
.track-controls-row {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 0 56px;
}

.track-row.active .track-controls-row {
    display: flex;
}

.btn-search {
    color: #2196F3 !important;
    font-size: 1rem;
}

.btn-search:hover {
    background: #e3f2fd !important;
}

.search-input {
    display: none;
    font-size: 0.85rem;
    padding: 4px 10px;
    border: 2px solid #2196F3;
    border-radius: 4px;
    outline: none;
    flex: 1;
    min-width: 0;
}

.search-input:focus {
    border-color: #1565C0;
}

.search-input.visible {
    display: block;
}

/* Hero landing page */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px 20px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #888;
    margin-bottom: 40px;
}

.hero-link {
    display: inline-block;
    padding: 14px 40px;
    background: #4CAF50;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.2s;
}

.hero-link:hover {
    background: #43A047;
}

/* Track list */
.track-list {
    border-top: 1px solid #eee;
}

.track-row {
    border-bottom: 1px solid #eee;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

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

.track-row.active {
    background: #fafafa;
    cursor: default;
}

.track-row.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #4CAF50;
    border-radius: 0 2px 2px 0;
}

/* Track main row */
.track-main {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
}

.track-number {
    color: #888;
    font-size: 0.85rem;
    min-width: 28px;
    text-align: right;
}

.track-title {
    flex: 1;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-row.active .track-title {
    font-weight: 600;
}


/* Inline player (hidden by default) */
.track-player {
    display: none;
    padding: 0 16px 12px 56px;
}

.track-row.active .track-player {
    display: block;
}

/* Progress row: bar + controls */
.player-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-container {
    flex: 1;
    padding: 8px 0;
    cursor: pointer;
}

.progress-bar {
    position: relative;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: visible;
}

.progress-fill {
    height: 100%;
    background: #4CAF50;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #4CAF50;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
    cursor: grab;
}

.track-row.active:hover .progress-handle,
.progress-handle.dragging {
    opacity: 1;
}

.ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.ctrl-btn:hover {
    color: #333;
    background: #eee;
}

.btn-play {
    font-size: 1.2rem;
}

/* Time display */
.time-display {
    font-size: 0.75rem;
    color: #888;
    padding-top: 2px;
}

.time-sep {
    margin: 0 3px;
}

/* Audio element */
#audioPlayer {
    display: none;
}
