body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1300px;
    margin: 50px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
}

form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

#searchQuery {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    outline: none;
    background-color: #fafafa;
}

#searchQuery:focus {
    border-color: #007bff;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#searchQuery::placeholder {
    color: #999;
}

#searchButton {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    white-space: nowrap;
}

#searchButton:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

#searchButton:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

#searchResults {
    border-top: 1px solid #ccc;
    padding-top: 20px;
}

.result {
    margin-bottom: 10px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.result-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result p {
    margin: 0;
    font-size: 16px;
    color: #333;
    flex: 1;
    line-height: 1.2;
}

/* Play Controls Wrapper */
.play-controls-wrapper {
    display: flex;
    align-items: center;
    margin-left: 15px;
    flex-shrink: 0;
    position: relative;
}

/* Progress Panel (slides from left) */
.progress-panel {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-right: 10px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
}

.progress-panel.visible {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Error Panel (slides from left, red color) */
.error-panel {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    margin-right: 10px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
    position: absolute;
    right: 58px;
}

.error-panel.visible {
    display: flex;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.error-message {
    font-size: 13px;
    color: white;
    font-weight: 500;
    text-align: center;
}

.mini-player-time {
    font-size: 13px;
    color: white;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.mini-time-separator {
    margin: 0 2px;
    opacity: 0.8;
}

.mini-progress-container {
    flex: 1;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.mini-progress-bg {
    width: 100%;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2.5px;
    position: relative;
    overflow: visible;
}

.mini-progress-fill {
    height: 100%;
    background-color: white;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.mini-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    transition: left 0.1s linear;
    pointer-events: none;
}

.mini-progress-container:hover .mini-progress-handle {
    transform: translate(-50%, -50%) scale(1.3);
}

.play-button-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.progress-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    transform: rotate(-90deg);
}

.progress-ring {
    transition: stroke-dashoffset 0.3s ease;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: #007bff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    padding: 0;
    z-index: 1;
}

.play-button:hover {
    background-color: #0056b3;
    transform: translate(-50%, -50%) scale(1.1);
}

.play-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.play-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.play-icon {
    padding-left: 1px;
}

.play-button.playing {
    background-color: #28a745;
}

.play-button.playing:hover {
    background-color: #218838;
}

.tracklist {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.tracklist.show {
    display: block;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 15px;
    }

    h1 {
        font-size: 24px;
    }

    form {
        flex-direction: column;
    }

    #searchQuery {
        margin-bottom: 10px;
    }

    .result-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result p {
        margin-bottom: 0;
        width: 100%;
    }

    .play-controls-wrapper {
        width: 100%;
        flex-direction: column-reverse;
        margin-left: 0;
        align-items: flex-end;
        gap: 8px;
    }

    .progress-panel {
        width: calc(100% - 66px);
        margin-right: 0;
        margin-bottom: 0;
        position: static;
        transform: none;
    }

    .progress-panel.visible {
        transform: none;
    }

    .error-panel {
        width: calc(100% - 66px);
        margin-right: 0;
        margin-bottom: 0;
        position: static;
        right: auto;
        transform: none;
    }

    .error-panel.visible {
        transform: none;
    }

    .play-button-wrapper {
        align-self: flex-end;
        margin: 0;
        width: 56px;
        height: 56px;
    }

    .progress-circle {
        width: 56px;
        height: 56px;
    }

    .play-button {
        width: 52px;
        height: 52px;
    }

    .play-button svg {
        width: 28px;
        height: 28px;
    }

    .progress-panel {
        padding: 12px 20px;
        gap: 16px;
    }

    .error-panel {
        padding: 12px 20px;
    }

    .error-message {
        font-size: 14px;
    }

    .mini-player-time {
        font-size: 14px;
    }

    .mini-progress-container {
        height: 28px;
    }

    .mini-progress-bg {
        height: 6px;
    }

    .mini-progress-handle {
        width: 14px;
        height: 14px;
    }
}

/* Extra small devices (phones in portrait mode) */
@media (max-width: 480px) {
    .container {
        margin: 10px;
        padding: 10px;
    }

    h1 {
        font-size: 20px;
        margin: 10px 0;
    }

    form {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    #searchQuery {
        width: 100%;
        padding: 10px 14px;
        font-size: 14px;
        margin-bottom: 0;
    }

    #searchButton {
        width: 100%;
        padding: 10px 20px;
        font-size: 14px;
    }

    .result {
        padding: 8px;
        margin-bottom: 8px;
    }

    .result-content {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .result p {
        font-size: 14px;
        line-height: 1.4;
        word-break: break-word;
    }

    .play-controls-wrapper {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-left: 0;
        gap: 8px;
    }

    .progress-panel {
        padding: 8px 12px;
        width: auto;
        flex: 1;
        min-width: 0;
        margin-right: 8px;
    }

    .error-panel {
        padding: 8px 12px;
        width: auto;
        flex: 1;
        min-width: 0;
        margin-right: 8px;
    }

    .play-button-wrapper {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
    }

    .progress-circle {
        width: 48px;
        height: 48px;
    }

    .play-button {
        width: 44px;
        height: 44px;
    }

    .play-button svg {
        width: 24px;
        height: 24px;
    }

    .mini-player-time {
        font-size: 11px;
    }

    .mini-progress-container {
        height: 24px;
        min-width: 60px;
    }

    .mini-progress-bg {
        height: 5px;
    }

    .mini-progress-handle {
        width: 12px;
        height: 12px;
    }
}
