/* public/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0b0b0b;
    color: #ffffff;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
}

.app {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: #141414;
    border-radius: 28px;
    padding: 22px 20px;
    box-shadow: 0 25px 35px -8px rgba(0,0,0,0.7);
    border: 1px solid #2c2c2c;
}

.app-header {
    margin-bottom: 24px;
}

h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(145deg, #ffdb4d, #ff9f2e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.now-playing {
    background: #1e1e1e;
    border-radius: 20px;
    padding: 16px 18px;
    border-left: 5px solid #ffdb4d;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 14px;
}

.now-playing-cover {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: #2a2a2a;
    flex-shrink: 0;
}

.now-playing-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.now-playing-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-artist {
    font-size: 14px;
    color: #b0b0b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-section {
    background: #181818;
    border-radius: 24px;
    padding: 18px 16px;
    margin-bottom: 24px;
    border: 1px solid #2a2a2a;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #3d3d3d;
}

.btn:hover {
    background: #3a3a3a;
    transform: scale(0.97);
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border-radius: 50%;
    border: 1px solid #444;
}

.btn-icon svg {
    color: #ffdb4d;
    stroke-width: 2.5;
}

.btn-primary {
    background: #ffdb4d;
    color: #121212;
    border: none;
    font-weight: 700;
}

.btn-primary:hover {
    background: #ffe066;
}

.btn-secondary {
    background: #333;
}

.btn-danger {
    background: #2c1414;
    color: #ffa3a3;
    border-color: #6e2a2a;
}

.btn-danger:hover {
    background: #4a1e1e;
}

.time-display {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: #d0d0d0;
    margin-right: auto;
    font-weight: 500;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

#volumeSlider {
    width: 90px;
    height: 5px;
    -webkit-appearance: none;
    background: #3a3a3a;
    border-radius: 10px;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ffdb4d;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

#volumeInput {
    background: #1e1e1e;
    border: 1.5px solid #333;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 15px;
    color: #fff;
    text-align: center;
    outline: none;
    transition: border 0.2s;
}
#volumeInput:focus {
    border-color: #ffdb4d;
}

.progress-container {
    margin-top: 6px;
}

.progress-bar {
    width: 100%;
    height: 7px;
    background: #262626;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffdb4d, #ffb82e);
    border-radius: 10px;
    transition: width 0.05s linear;
}

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

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

#searchInput, #urlInput {
    flex: 1;
    background: #1e1e1e;
    border: 1.5px solid #333;
    border-radius: 20px;
    padding: 14px 18px;
    font-size: 15px;
    color: #fff;
    outline: none;
    transition: border 0.2s;
}

#searchInput:focus, #urlInput:focus {
    border-color: #ffdb4d;
}

.search-results {
    max-height: 280px;
    overflow-y: auto;
    border-radius: 20px;
    background: #111;
    padding: 6px;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #1c1c1c;
    border-radius: 18px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid #2e2e2e;
    gap: 12px;
}

.track-item:hover {
    background: #282828;
    border-color: #444;
}

.track-cover {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    background: #2a2a2a;
    flex-shrink: 0;
}

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

.track-info b {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-info small {
    color: #b0b0b0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-icon-small {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border-radius: 50%;
    border: 1px solid #555;
    color: #ffdb4d;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.queue-section {
    margin-bottom: 24px; /* отступ снизу, отделяет от следующей секции */
}

.queue-section h3 {
    font-size: 17px;
    margin-bottom: 14px;
    color: #ddd;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.queue-list {
    list-style: none;
    margin-bottom: 16px;
    max-height: 220px;
    overflow-y: auto;
    background: #111;
    border-radius: 20px;
    padding: 8px;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #262626;
    font-size: 14px;
    transition: background 0.2s;
    cursor: grab;
}

.queue-item:active {
    cursor: grabbing;
}

.queue-item.dragging {
    opacity: 0.5;
    background: #2a2a2a;
    border: 1px dashed #ffdb4d;
}

.queue-item.drag-over {
    border-top: 2px solid #ffdb4d;
    background: #252525;
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.queue-cover {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    background: #2a2a2a;
    flex-shrink: 0;
}

.remove-btn {
    background: none;
    border: none;
    color: #ff7b7b;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 10px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.remove-btn:hover {
    background: #2e1616;
}

.queue-actions {
    display: flex;
    gap: 10px;
}

.queue-actions .btn {
    flex: 1;
}

.status-bar {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: #999;
    padding: 8px;
    border-top: 1px solid #2a2a2a;
}

.search-section {
    margin-bottom: 24px; /* отступ снизу до статус-бара */
}

.search-error, .search-empty {
    padding: 16px;
    text-align: center;
    color: #aaa;
}

::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 10px;
}

.drag-handle {
    cursor: grab;
    margin-right: 8px;
    color: #888;
    font-size: 18px;
    user-select: none;
    transition: color 0.2s;
}

.drag-handle:hover {
    color: #ffdb4d;
}

.queue-item.dragging .drag-handle {
    cursor: grabbing;
}

/* Вкладки в очереди */
.queue-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.queue-tab {
    background: #222;
    border: 1px solid #3a3a3a;
    color: #aaa;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.queue-tab:hover {
    background: #2e2e2e;
    color: #ddd;
}

.queue-tab.active {
    background: #ffdb4d;
    color: #121212;
    border-color: #ffdb4d;
}

.queue-tab-content {
    display: none;
}

.queue-tab-content.active {
    display: block;
}

.bg-status {
    font-size: 13px;
    color: #aaa;
    padding: 12px;
    text-align: center;
    background: #1a1a1a;
    border-radius: 16px;
    margin-top: 12px;
}

/* Индикатор играющего трека в фоновом плейлисте */
.bg-playing {
    background: #2a2a2a;
    border-left: 4px solid #ffdb4d;
    padding-left: 8px;
}

#bgRandomToggle.active {
    background: #ffdb4d;
    color: #121212;
    border-color: #ffdb4d;
}

/* Компактная кнопка для shuffle */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 32px;
    height: 28px;
    line-height: 1;
}

/* Индикатор случайного порядка (как radio button) */
.shuffle-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2a2a2a;
    border: 2px solid #4a4a4a;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.shuffle-indicator.active {
    background: #ffdb4d;
    border-color: #ffdb4d;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.2s;
}

.shuffle-indicator.active .indicator-dot {
    background: #121212;
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    color: #121212;
    font-size: 10px;
    font-weight: bold;
}

.now-playing {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.now-playing-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}
.btn-like {
    flex-shrink: 0;
    margin-left: 12px;
    background: transparent;
    border: 1px solid #444;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}
.btn-like:hover {
    background: #2e1616;
    border-color: #ff7b7b;
}

/* Подсветка паузы */
.status-bar.paused {
    background: #2a1a1a;
    color: #ffa3a3;
}