/* ===== CSS Variables ===== */
:root {
    --bg-dark: #121212;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent: #1db954;
    --accent-hover: #1ed760;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Background ===== */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-layer {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(80px) brightness(0.4);
    transform: scale(1.3);
    transition: background-image 0.5s ease;
}

.bg-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

/* ===== Player Container ===== */
.player-container {
    width: 100%;
    max-width: 360px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* ===== Cover Section ===== */
.cover-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.album-cover {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    flex-shrink: 0;
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.album-cover img.loaded {
    display: block;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #282828;
}

.cover-placeholder i {
    font-size: 48px;
    color: var(--text-muted);
}

.album-cover img.loaded+.cover-placeholder {
    display: none;
}

/* ===== Song Info ===== */
.song-info {
    text-align: center;
    width: 100%;
}

.song-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-artist {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== Progress Section ===== */
.progress-section {
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-thumb {
    display: none;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ===== Controls Section ===== */
.controls-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--text-primary);
    color: var(--bg-dark);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.play-btn:hover {
    transform: scale(1.05);
    background: var(--accent-hover);
}

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

.play-btn i {
    margin-left: 3px;
}

.play-btn i.fa-pause {
    margin-left: 0;
}

/* ===== Detail Section ===== */
.detail-section {
    width: 100%;
}

.detail-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
}

.detail-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.detail-btn i {
    font-size: 12px;
}

/* ===== Documentation Container ===== */
.doc-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--bg-dark);
    overflow-y: auto;
}

.doc-card {
    max-width: 480px;
    width: 100%;
    padding: 0;
    background: transparent;
}

.doc-header {
    text-align: center;
    margin-bottom: 32px;
}

.doc-header i {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 16px;
}

.doc-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.doc-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.doc-section {
    margin-bottom: 24px;
}

.doc-section h2 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-section h2 i {
    font-size: 12px;
}

.doc-section p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.doc-url {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--accent);
    word-break: break-all;
    line-height: 1.6;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.doc-table th,
.doc-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.doc-table td:last-child {
    text-align: center;
}

.doc-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.doc-shortcuts span {
    font-size: 13px;
    color: var(--text-secondary);
}

kbd {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    margin-right: 4px;
}

.doc-footer {
    margin-top: 32px;
    text-align: center;
}

.doc-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s ease;
}

.doc-footer a:hover {
    color: var(--text-primary);
}

/* ===== Responsive ===== */
@media (max-width: 400px) {
    .player-container {
        padding: 24px 20px;
        gap: 20px;
    }

    .album-cover {
        width: 180px;
        height: 180px;
    }

    .song-title {
        font-size: 16px;
    }

    .play-btn {
        width: 52px;
        height: 52px;
        font-size: 18px;
    }
}