* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.player-wrapper {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

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

#m3u8Input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

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

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

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

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

.video-container {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

#videoPlayer {
    width: 100%;
    height: auto;
    min-height: 400px;
    display: block;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.info-section {
    margin-bottom: 20px;
}

.status {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

.status-label {
    font-weight: bold;
    color: #667eea;
}

.status-text {
    margin-left: 10px;
}

.video-info {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.video-info h3 {
    color: #667eea;
    margin-bottom: 10px;
}

.info-item {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.info-label {
    font-weight: bold;
    color: #555;
    margin-right: 10px;
}

.playlist-section {
    margin-top: 20px;
}

.playlist-section h3 {
    color: #667eea;
    margin-bottom: 10px;
}

#historyList {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

#historyList li {
    padding: 10px;
    background: #f8f9fa;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    word-break: break-all;
}

#historyList li:hover {
    background: #e9ecef;
}

footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

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

    #playBtn {
        width: 100%;
    }
}

