@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-elevated: #1a1a1a;
    --bg-hover: #222;
    --text-primary: #fff;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --accent: #e52d27;
    --accent-hover: #ff3b30;
    --border: rgba(255,255,255,0.08);
    --radius: 10px;
    --radius-sm: 6px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px;
}

header {
    text-align: center;
    margin-bottom: 48px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}

.logo svg {
    filter: drop-shadow(0 0 20px rgba(229, 45, 39, 0.4));
}

.logo h1 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
}

#playlistUrl {
    flex: 1;
    padding: 14px 18px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

#playlistUrl:focus {
    border-color: rgba(229, 45, 39, 0.5);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(229, 45, 39, 0.1);
}

#playlistUrl::placeholder {
    color: var(--text-muted);
}

button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

#extractBtn {
    padding: 14px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    letter-spacing: 0.2px;
}

#extractBtn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 45, 39, 0.3);
}

#extractBtn:active {
    transform: translateY(0);
}

#extractBtn:disabled {
    background: var(--bg-hover);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px;
    color: var(--text-secondary);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--bg-hover);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.error {
    background: rgba(229, 45, 39, 0.1);
    border: 1px solid rgba(229, 45, 39, 0.3);
    color: #ff6b6b;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.results {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.playlist-info h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

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

#copyAllBtn {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-sm);
}

#copyAllBtn:hover {
    background: var(--accent);
    color: #fff;
}

#trackList {
    list-style: none;
    max-height: 480px;
    overflow-y: auto;
}

#trackList::-webkit-scrollbar {
    width: 6px;
}

#trackList::-webkit-scrollbar-track {
    background: transparent;
}

#trackList::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px;
}

#trackList::-webkit-scrollbar-thumb:hover {
    background: #333;
}

.track {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
    gap: 4px;
}

.track:hover {
    background: var(--bg-elevated);
}

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

.track-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    margin-right: 14px;
    flex-shrink: 0;
}

.track-info {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}

.track-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

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

.track-link {
    flex-shrink: 0;
}

.track-link a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.track-link a:hover {
    background: var(--accent);
    color: #fff;
}

.copy-btn {
    margin-left: 8px;
    padding: 6px 12px;
    background: var(--bg-hover);
    color: var(--text-primary);
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #333;
}

footer {
    text-align: center;
    margin-top: 48px;
    color: var(--text-muted);
    font-size: 12px;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.25s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {
    .container {
        padding: 32px 16px;
    }

    .input-section {
        flex-direction: column;
    }

    #extractBtn {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }

    #copyAllBtn {
        width: 100%;
    }

    .track {
        padding: 12px 16px;
    }

    .track-link a,
    .copy-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}
