/* --- CONTAINER CHÍNH --- */
.wavr-player-wrapper {
    /* Biến mặc định (sẽ bị PHP ghi đè) */
    --wavr-main: #008037;
    --wavr-bg: #ffffff;
    --wavr-border: #e0e0e0;
    --wavr-text: #333333;

    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Gán biến vào thuộc tính */
    background: var(--wavr-bg);
    border: 1px solid var(--wavr-border);
    color: var(--wavr-text);
    
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    max-width: 100%;
    box-sizing: border-box;
}

.wavr-player {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap; 
}

.wavr-controls {
    display: flex;
    align-items: center;
    flex-grow: 1; 
    gap: 12px;
    min-width: 200px; 
}

/* --- NÚT PLAY --- */
.wavr-btn {
    width: 44px; 
    height: 44px;
    min-width: 44px; 
    min-height: 44px;
    flex-shrink: 0; 
    
    /* Màu nền động */
    background: var(--wavr-main); 
    
    color: white; 
    border: none;
    border-radius: 50%; 
    cursor: pointer;
    
    display: flex; 
    align-items: center; 
    justify-content: center;
    
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 0; 
}

.wavr-btn:hover {
    filter: brightness(90%);
    transform: scale(1.05);
}

.wavr-btn:active {
    transform: scale(0.95);
}

.wavr-btn svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: currentColor;
    pointer-events: none; 
}

.wavr-spin {
    animation: wavr-spin 1s linear infinite;
}
@keyframes wavr-spin { 
    100% { transform: rotate(360deg); } 
}

/* --- THỜI GIAN --- */
.wavr-time {
    font-size: 13px;
    font-weight: 500;
    color: var(--wavr-text);
    opacity: 0.8;
    
    min-width: 45px;
    text-align: center;
    font-variant-numeric: tabular-nums; 
}

/* --- THANH TIẾN TRÌNH --- */
.wavr-progress-container {
    flex-grow: 1;
    height: 6px;
    background: #e9ecef; /* Giữ màu nền thanh xám nhạt */
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.wavr-progress-bar {
    height: 100%;
    /* Màu thanh chạy động */
    background: var(--wavr-main);
    width: 0%;
    transition: width 0.2s linear;
    border-radius: 3px;
}

/* --- CÀI ĐẶT --- */
.wavr-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wavr-settings select {
    appearance: none; 
    -webkit-appearance: none;
    
    padding: 6px 30px 6px 12px; 
    border-radius: 20px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    background-color: #f3f4f6;
    color: #374151;
    cursor: pointer;
    outline: none;
    height: 32px;
    line-height: 1.2;
    max-width: 100%;
    
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

.wavr-settings select:hover {
    border-color: #9ca3af;
    background-color: #fff;
}

/* --- TRẠNG THÁI --- */
.wavr-status {
    font-size: 12px;
    color: var(--wavr-text);
    opacity: 0.7;
    
    margin-top: 10px;
    margin-left: 4px;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 480px) {
    .wavr-player {
        flex-direction: column; 
        align-items: stretch; 
        gap: 16px;
    }

    .wavr-controls {
        width: 100%;
    }

    .wavr-settings {
        width: 100%;
        justify-content: space-between; 
    }

    .wavr-settings select {
        flex-grow: 1; 
        padding-right: 25px; 
    }
    
    #wavr-speed-select {
        flex-grow: 0;
        width: 80px;
    }
    
    .wavr-status {
        text-align: center;
    }
}