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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #404040;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: #f5f5f5;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 600px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.2em;
    font-weight: 300;
}

.status-section {
    background: #e0e0e0;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 2px solid #ccc;
}

.status {
    color: #333;
    font-weight: 500;
    text-align: center;
}

.audio-info {
    margin-bottom: 30px;
    padding: 20px;
    background: #e8e8e8;
    border-radius: 12px;
    border: 2px solid #ccc;
}

.audio-info h3 a {
    color: #333;
    text-decoration: none;
    border-bottom: 1px dashed #666;
}

.audio-info h3 a:hover {
    color: #555;
    border-bottom: 1px solid #333;
}

.audio-info h3 a:visited {
    color: #666;
}

.audio-info p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.auto-play-section {
    background: #e8e8e8;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #ccc;
}

.auto-play-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    color: #333;
}

.auto-play-section input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

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

.duration-control label {
    margin: 0;
    font-weight: 500;
    color: #555;
}

.duration-control input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.duration-control input[type="number"]:focus {
    outline: none;
    border-color: #666;
}

.playlist-section {
    background: #e8e8e8;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #ccc;
}

.playlist-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1em;
    font-weight: 500;
}

.playlist-container {
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #ccc;
}

.playlist-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 0;
}

.playlist-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-item:hover {
    background-color: #f5f5f5;
}

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

.playlist-item.current {
    background-color: #ddd;
    font-weight: 500;
}

.playlist-item-title {
    flex: 1;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

.playlist-item-time {
    font-size: 0.9em;
    color: #666;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.controls button {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#playBtn {
    background: #666;
    color: white;
}

#playBtn:hover:not(:disabled) {
    background: #555;
    transform: translateY(-2px);
}

#stopBtn {
    background: #888;
    color: white;
}

#stopBtn:hover:not(:disabled) {
    background: #777;
    transform: translateY(-2px);
}

#nextBtn {
    background: #333;
    color: white;
}

#nextBtn:hover {
    background: #222;
    transform: translateY(-2px);
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-weight: 500;
    padding: 20px;
}

.loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error {
    background: #ddd;
    color: #333;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #bbb;
    margin-top: 15px;
}

audio {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .controls button {
        width: 100%;
        max-width: 200px;
    }
    
    .duration-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .duration-control input[type="number"] {
        width: 100%;
        max-width: 120px;
    }
}

