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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.3s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

header h1 {
    color: white;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.music-icon {
    width: 50px;
    height: 50px;
    color: #ff0000;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.player-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

#playlistInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#playlistInput:focus {
    outline: none;
    border-color: #667eea;
}

.load-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.load-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.load-btn:active {
    transform: translateY(0);
}

.video-info {
    text-align: center;
    margin-bottom: 30px;
}

.thumbnail {
    width: 100%;
    max-width: 480px;
    height: auto;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#videoTitle {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 10px;
}

#channelName {
    color: #666;
    font-size: 1.1em;
}

#playerContainer {
    margin: 30px 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#player {
    width: 100%;
    aspect-ratio: 16/9;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.control-btn:hover:not(:disabled) {
    background: #e0e0e0;
    transform: scale(1.1);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn svg {
    width: 30px;
    height: 30px;
    color: #333;
}

.play-btn {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.play-btn svg {
    color: white;
    width: 40px;
    height: 40px;
}

.play-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7c8ff0 0%, #8a5bb0 100%);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 15px;
}

.volume-icon {
    width: 30px;
    height: 30px;
    color: #667eea;
}

#volumeSlider {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    background: #e0e0e0;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

#volumeValue {
    min-width: 50px;
    text-align: right;
    font-weight: bold;
    color: #667eea;
}

.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

.playlist-info {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
}

.playlist-info p {
    margin: 5px 0;
    color: #333;
}

.playlist-info strong {
    color: #667eea;
}

.error-message {
    background: #ff5252;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .player-card {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .music-icon {
        width: 35px;
        height: 35px;
    }

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

    #videoTitle {
        font-size: 1.3em;
    }

    .control-btn {
        width: 50px;
        height: 50px;
    }

    .control-btn svg {
        width: 25px;
        height: 25px;
    }

    .play-btn {
        width: 70px;
        height: 70px;
    }

    .play-btn svg {
        width: 35px;
        height: 35px;
    }

    .back-button {
        position: static;
        display: inline-block;
        margin-bottom: 15px;
    }

    header h1 {
        display: flex;
        flex-direction: column;
    }
}
