/*
 * Tool-specific styles for: Music
 * Inherits all CSS variables from main.css — use them, don't redefine.
 */

.music-player {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    position: sticky;
    top: 76px;
    z-index: 10;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.now-playing-art {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent-dim), rgba(74, 124, 89, 0.2));
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

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

.now-playing-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.player-controls {
    display: grid;
    grid-template-columns: auto auto auto auto 1fr auto auto;
    align-items: center;
    gap: 0.6rem;
}

.ctl-btn {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    padding: 0;
}

.ctl-btn:hover {
    background: var(--accent-dim);
    border-color: var(--border-accent);
    color: var(--accent);
}

.ctl-btn-primary {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-base);
    font-size: 1.05rem;
}

.ctl-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--bg-base);
}

.time-current, .time-total {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 3.2rem;
    text-align: center;
}

.seek, .volume {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--border);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.seek { width: 100%; }
.volume { width: 90px; }

.seek::-webkit-slider-thumb,
.volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    cursor: pointer;
    transition: transform 0.1s;
}

.seek::-moz-range-thumb,
.volume::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    cursor: pointer;
}

.seek::-webkit-slider-thumb:hover,
.volume::-webkit-slider-thumb:hover { transform: scale(1.2); }

.volume-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.volume-icon {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* --- Albums + track list ------------------------------------------------ */
.track-list-section {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.album { display: block; }

.album-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.album-heading { min-width: 0; flex: 1; }

.album-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.album-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.2rem 0 0;
}

.album-play {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent);
    color: var(--bg-base);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.album-play:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.album-play.is-playing {
    background: var(--bg-card-hover);
    color: var(--accent);
}

.album-play-icon { font-size: 0.75rem; line-height: 1; }

.track-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.track {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.9rem;
    transition: background 0.15s, border-color 0.15s;
}

.track:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.track.is-active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* Featured tracks — stand out above the rest of their album. */
.track.is-featured {
    border-color: var(--border-accent);
    background: linear-gradient(135deg, var(--accent-dim), rgba(232, 147, 42, 0.04));
    box-shadow: 0 0 0 1px var(--border-accent), var(--shadow-card);
}

.track.is-featured:hover {
    border-color: var(--accent);
}

/* When a featured track is also playing, the active accent still wins. */
.track.is-featured.is-active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.featured-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg-base);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
    white-space: nowrap;
}

.track-play {
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    padding: 0;
    font-size: 0.85rem;
}

.track-play:hover {
    background: var(--accent);
    color: var(--bg-base);
    border-color: var(--accent);
}

.track.is-active .track-play {
    background: var(--accent);
    color: var(--bg-base);
    border-color: var(--accent);
}

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

.track-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.track.is-active .track-title { color: var(--accent); }

.track-desc {
    color: var(--text-secondary);
    font-size: 0.825rem;
    margin-top: 0.1rem;
}

.track-download,
.track-share {
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.track-download:hover,
.track-share:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

.track-share.is-copied {
    color: var(--green-hover);
    background: rgba(74, 124, 89, 0.18);
}

@media (max-width: 640px) {
    .player-controls {
        grid-template-columns: auto auto auto 1fr auto;
        gap: 0.5rem;
    }
    .time-current, .time-total { min-width: 2.8rem; font-size: 0.75rem; }
    .volume-wrap { grid-column: 1 / -1; justify-content: flex-end; }
    .volume { width: 110px; }
    .music-player { position: static; }

    .album-header {
        flex-direction: column;
        align-items: stretch;
    }
    .album-play { align-self: flex-start; }
}
